v1

latestOpenAPI 3.1.02026-07-26105141.0 KB
Chat Completions API

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.

post/chat/completions

Headers

Idempotency-Keystring

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.

Request body

modelstring required
temperaturenumber nullable
top_pnumber nullable
max_completion_tokensinteger nullable
reasoning_effort'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' nullable
n1

Only n=1 is currently supported.

modalitiesstring[]
streamboolean

When true, the response is returned as a Server-Sent Events stream of chat.completion.chunk objects instead of a single JSON response.

storetrue

Only true is supported.

userstring

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).

idstring required
object'chat.completion' required
createdinteger required
modelstring required