Chat Completions
OpenAI-compatible
Chat Completions
POST /v1/chat/completions — a fully OpenAI-compatible chat endpoint
POST
Chat Completions
Create a model response based on the conversation context (the messages array).
Every model with chat capability (OpenAI / Claude / Gemini / DeepSeek / Qwen, etc.) can be called through this endpoint.
Supported roles:
With
In the response:
After executing the tool, append the result to messages:
Call chat completions again to let the model continue answering based on the tool result.
You can also use a suffixed model ID (
Request
Authentication
Main parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | ✅ | Model ID, e.g. gpt-5.5 |
messages | array | ✅ | Conversation history, each item { role, content } |
temperature | number | 0-2, default 1. Lower is more deterministic | |
top_p | number | 0-1, nucleus sampling; use this or temperature, not both | |
n | integer | How many candidates to generate (default 1) | |
stream | boolean | true enables SSE streaming | |
stream_options | object | { include_usage: true } appends usage at the end of the stream | |
max_tokens | integer | Maximum output tokens (legacy field, replaced by max_completion_tokens for some models) | |
max_completion_tokens | integer | New field, for o3 / GPT-5 | |
stop | string | array | Stop sequences | |
presence_penalty | number | -2 to 2 | |
frequency_penalty | number | -2 to 2 | |
logit_bias | map | Token bias | |
seed | integer | Reproducibility seed | |
response_format | object | { type: "json_object" } or a JSON Schema | |
tools | array | List of function-calling tools | |
tool_choice | string | object | auto / required / { type:"function", function:{name:"..."}} | |
parallel_tool_calls | boolean | Whether to allow parallel tool calls | |
reasoning_effort | string | Reasoning effort for o3 / GPT-5: low / medium / high | |
modalities | array | Multimodal output, e.g. ["text","audio"] | |
audio | object | Audio output options | |
user | string | End-user identifier (for auditing) |
messages structure
system / user / assistant / tool (function return).
Response
finish_reason possible values: stop / length / tool_calls / content_filter.
Streaming response
Withstream: true, the server pushes chunks in SSE format:
stream_options.include_usage: true, an extra chunk with usage is sent at the end:
Function calling
Reasoning models
For the o3 / GPT-5 series, usereasoning_effort:
o3-mini-low / -medium / -high) for the equivalent effect.