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.
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).
Must be true; no other value is accepted.
true 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.