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
Makes the request retry-safe. Sail stores a reservation keyed by (organization, API key, Idempotency-Key); retrying with the same value returns the previously stored response instead of re-running inference. Keys are capped at 255 characters. See Idempotent Requests for full semantics.
255Body
10 <= x <= 20 <= x <= 1x >= 1- Option 1
- Option 2
none, minimal, low, medium, high, xhigh Only n=1 is currently supported.
1 1 elementtext When true, the response is returned as a Server-Sent Events stream of chat.completion.chunk objects instead of a single JSON response.
Options that apply when stream is true.
Only true is supported.
true 256Optional string metadata. completion_window controls scheduling; completion_webhook/webhook_token configure completion webhooks.
Response
Chat completion. Returns a single JSON object by default, or a Server-Sent Events stream of chat.completion.chunk objects when stream: true (terminated by a final data: [DONE] line).