Create a chat completion
A Chat Completions endpoint that follows the OpenAI interface. Pass stream: true to stream the reply back as Server-Sent Events made up of chat.completion.chunk objects.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
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
10 <= x <= 20 <= x <= 1x >= 1- Option 1
- Option 2
none, minimal, low, medium, high, xhigh Must be 1; requesting multiple choices is not supported yet.
1 1 elementtext Set this to true to receive the answer as a Server-Sent Events stream of chat.completion.chunk objects rather than one JSON payload.
Settings that only take effect while streaming (stream is true).
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 either: Valar stores the response either way.
256Optional string-valued metadata. Use completion_window to influence scheduling, and completion_webhook together with webhook_token to wire up a webhook that fires on completion.
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.