POST /v1/chat/completions
Creates a chat completion for the given messages and model.Request body
The model ID to use. See the models page for available models.Example:
openai/gpt-oss-120bA list of messages comprising the conversation.Each message is an object with:
role— one ofsystem,user, orassistantcontent— the message text
Maximum number of tokens to generate. Defaults to the model’s maximum.
Sampling temperature between 0 and 2. Lower values are more deterministic. Defaults to
1.Nucleus sampling parameter. Defaults to
1.If
true, responses are sent as server-sent events. Defaults to false.Up to 4 sequences where the model will stop generating.
Example request
Example response
Streaming
Setstream: true to receive responses as server-sent events. Each event contains a chunk of the response.
usage field with token counts.