Skip to main content
POST

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>

Service tier for this request, for clients that cannot set service_tier in the body. A tier in the body takes precedence. See Service tiers.

Available options:
asap,
balanced,
flex

Body

application/json
model
string
required
input
required

Text input, plus image input (input_image) on multimodal models and inline PDF input (input_file) on every model. Audio, files referenced by file_id or file_url, and item references are not currently supported.

Minimum string length: 1
raw_prompt_tokens
integer[]

Sail extension: pre-tokenized prompt as an array of token ids, forwarded to the model verbatim (no chat templating or tokenization). When set, input is still required but ignored; pass a placeholder string.

Required array length: 1 - 2000000 elements
Required range: 0 <= x <= 2147483647
max_output_tokens
integer | null
Required range: x >= 1
temperature
number | null
Required range: 0 <= x <= 2
top_p
number | null
Required range: 0 <= x <= 1
text
object
reasoning
object
instructions
string

Prepended to the input as a system message.

parallel_tool_calls
boolean

Accepted for OpenAI compatibility. Models decide their own tool-call cadence, so this field has no effect.

include
string[]

Additional data to include. reasoning.encrypted_content is accepted for OpenAI-client compatibility, but reasoning items are returned without encrypted content.

background
boolean

When true, submits a background request using a supported balanced or flex tier; defaults to false. See Background mode for restrictions and Default behavior for tier selection.

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.

store
boolean

Accepted for OpenAI compatibility. false does not change Sail's normal temporary request/response storage for processing, retries, polling, and idempotency; Customer Data remains governed by Sail's DPA retention and deletion terms.

truncation
enum<string>
Available options:
disabled
stream
boolean

When true on a foreground request, returns OpenAI Responses Server-Sent Events. background=true requests cannot be streamed.

user
string
Maximum string length: 256
metadata
object

Optional string metadata. The keys supercached_input_tokens and supercache_write_input_tokens are reserved for response output. A request that supplies either key returns HTTP 400.

service_tier
enum<string>

Service tier controls request scheduling and token pricing.

Defaults when omitted

  • Core model inference: asap (low latency).
  • Batch: flex. Other tiers are rejected.
  • LoRA: flex. Explicit balanced or asap is rejected; use background Responses or Batch.
  • Background Responses: an available non-ASAP tier. Models that only support asap are rejected.
  • Flex-only models: flex is the default and only tier, including for Batch and LoRA.

Requirements

  • An explicit tier must be supported by the model or Sail returns an error. See the Pricing support matrix.
  • Use flex through the Batch API or Responses with background: true. Synchronous Responses, Chat Completions, and Messages reject flex. Background Responses cannot stream.

See default behavior and Flex request requirements for details.

Available options:
asap,
balanced,
flex

Response

Response completed and returned synchronously. When stream=true, returns Server-Sent Events.

id
string
required
object
enum<string>
required
Available options:
response
created_at
integer
required
status
enum<string>
required
Available options:
queued,
in_progress,
failed,
completed,
incomplete,
cancelled
model
string
required
usage
object | null
required
metadata
object
required

Response metadata. A completed response includes supercached_input_tokens and supercache_write_input_tokens as decimal strings when Supercache accounting data is available. Both fields are included when their value is zero.

input

Text input, plus image input (input_image) on multimodal models and inline PDF input (input_file) on every model. Audio, files referenced by file_id or file_url, and item references are not currently supported.

Minimum string length: 1
output
error
object | null
incomplete_details
object | null
max_output_tokens
integer | null
reasoning
object
text
object
store
boolean
temperature
number
top_p
number
parallel_tool_calls
boolean
tool_choice
tools
object[]
truncation
user
string | null
service_tier
enum<string>

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

Available options:
asap,
balanced,
flex