v1
latestOpenAPI 3.0.02026-07-262088144.5 KBCreate chat completion
Request body
The model to use, which can be:
- A model id (e.g., gpt-oss-120b). The best provider is automatically selected by latency, or you can control provider selection via extra_body.provider. See Models for available models.
- A provider-prefixed model id (e.g., openai/gpt-5). This specifies the provider and model to use.
- auto for automatic model selection based on criteria like price, latency, or intelligence
- A router, which is specified by inworld/<router-name>. The router name must be prefixed by inworld/.
If true, partial message deltas will be sent as server-sent events.
Sampling temperature between 0 and 2. Higher values make output more random.
Nucleus sampling parameter. Must be greater than 0.
Maximum number of tokens to generate.
Maximum number of completion tokens to generate.
Penalizes tokens based on presence in the text.
Penalizes tokens based on frequency in the text.
Random seed for generation.
Up to 4 sequences where the API will stop generating.
Controls the amount of reasoning effort the model uses. Note: This parameter is provider/model-specific and may not be supported by all models (e.g., OpenAI models do not support this parameter). This will be overridden if extra_body.reasoning is specified.
A unique identifier for the end user. When used with a router, the same user will consistently receive the same variant across requests (sticky routing).
Output modalities to generate. Defaults to ["text"]. Include "image" to request image generation (e.g., ["text", "image"]). Currently supported for OpenAI and Google image models.
Response
A successful response. Returns either a complete chat completion or streaming chunks.
Unique identifier for the chat completion.
Object type, always 'chat.completion'.
Unix timestamp when the completion was created.
The model that was actually used.