Skip to main content
POST
Create a chat completion

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

Identifies one submission within your organization and API key. Reuse the same value and request body when retrying; use a new value for new work. See Idempotency.

Maximum string length: 255
X-Sail-Completion-Window
enum<string>

Completion window for this request, for clients that cannot set metadata.completion_window in the body. A window in the body takes precedence. See Completion windows.

Available options:
asap,
balanced,
flex

Body

application/json
model
string
required
messages
object[]
required
Minimum array length: 1
temperature
number | null
Required range: 0 <= x <= 2
top_p
number | null
Required range: 0 <= x <= 1
max_completion_tokens
integer | null
Required range: x >= 1
response_format
object
reasoning_effort
enum<string> | null

Reasoning effort for the model. max selects the same top tier as xhigh.

Available options:
none,
minimal,
low,
medium,
high,
xhigh,
max
n
enum<integer>

Only n=1 is currently supported.

Available options:
1
modalities
enum<string>[]
Required array length: 1 element
Available options:
text
stream
boolean

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

stream_options
object

Options that apply when stream is true.

store
enum<boolean>

Only true is supported.

Available options:
true
user
string
Maximum string length: 256
prompt_cache_key
string

Optional routing hint for prompt-prefix cache locality. Requests with the same key are preferentially routed to maximize cache hit rates.

metadata
object

Optional string metadata. completion_window controls scheduling; completion_webhook/webhook_token configure completion webhooks; supercache_write stores a reusable prompt prefix.

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

id
string
required
object
enum<string>
required
Available options:
chat.completion
created
integer
required
model
string
required
choices
object[]
required
Minimum array length: 1
usage
object
service_tier
enum<string>

The completion window Sail selected for this request, including when no window was requested. The legacy request value standard is reported as balanced. Older stored responses may omit this field.

Available options:
asap,
balanced,
flex