Create a chat completion
OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects. With background: true it returns 202 and a response id to poll, as the Responses API does.
Authorizations
Headers
Lets you retry safely. Valar records a reservation under the combination of organization, API key, and Idempotency-Key, so sending the same value again hands back the stored response rather than running inference a second time. Values can be up to 255 characters. See Idempotent Requests for the complete rules.
255Body
Accepted for compatibility and ignored. Chat Completions carries a model's thinking as ordinary content you resend, so there is nothing for this field to select. It does not control retention. See the Data Processing Addendum for retention commitments.
Valar extension, the same as background on the Responses API. Set to true to get a handle instead of holding the connection: the call returns 202 with a response object right away, and you poll Fetch a response with its id. Once the run succeeds, that fetch returns the finished chat completion. Cannot be combined with stream.
Response
The chat completion. By default this is one JSON object; with stream: true it becomes a Server-Sent Events stream of chat.completion.chunk objects closed by a final data: [DONE] line.