Chat Completions
POST /v1/chat/completions is the main OpenAI-compatible chat endpoint.
BASH
Request Body
Common fields:
| Field | Description |
|---|---|
model | Required. Model ID. |
messages | Required. Array of conversation messages. |
temperature, top_p, n, stop | Sampling control parameters, passed to compatible upstreams. |
max_tokens, max_completion_tokens | Output token limits. |
stream | Set to true to enable SSE streaming. |
stream_options.include_usage | Returns usage in streaming responses when supported by upstream. |
tools, tool_choice | OpenAI-compatible tool calling. |
response_format | Request structured output for supported models. |
reasoning_effort | Supported reasoning models can use low, medium, high. |
modalities, audio | Available for models that support multimodal audio. |
user | Optional. For your own end-user identification. |
Different models support different parameters. If the response says a parameter is unsupported, remove it or switch to another model.
Streaming Output
JSON
Responses use OpenAI-style SSE chunks and end with [DONE].
Tool Calling
JSON
Models that support tool calling receive tool definitions and return OpenAI-compatible tool call responses.
Legacy Completions
Legacy text completion clients can use POST /v1/completions.
