Skip to main content
POST

General Chat Completions API (Default Non-Streaming)

Suitable for background tasks, structured output, short Q&A, and scenarios where real-time display of the generation process is not required. When stream is omitted or set to false, the API returns a complete chat.completion object in a single response.

Request Body

model
string
required
Model name. Can be queried via the model list.
messages
array<object>
required
An array of conversation messages. Each message must contain at least role and content.
stream
boolean
Non-streaming response when omitted or set to false.
response_format
object
Specifies the output format. Commonly used for JSON output or JSON Schema structured output.
tools
array<object>
A list of function calling tools.
tool_choice
string | object
Controls the tool calling strategy.
temperature
number
Sampling temperature. The default value is determined by the upstream model.
top_p
number
Nucleus sampling parameter.
max_tokens
integer
Maximum number of generated tokens.
seed
number
Random seed. When supported by the upstream model, this can improve reproducibility.

Request Example

Structured Output

Response Example

Response Fields

choices[].message.content
string | null
The text content generated by the model. May be null when a tool call occurs.
choices[].message.tool_calls
array<object>
The function tools requested by the model.
usage
object
Token usage for this request.