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

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

Request Example

Structured Output

Response Example

Response Fields

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