Skip to main content
POST
OpenAI-compatible chat completion (streaming when `stream:true`).

Authorizations

Authorization
string
header
required

Virtual key mk-live-… on the data plane. x-api-key: mk-live-… is also accepted.

Headers

x-spillway-session-id
string

Pin this request to a routing session (sticky provider/model across a conversation). Header wins over body session_id.

Maximum string length: 256
Example:

"chat-7f3a2b"

x-spillway-require-capabilities
string

Comma-separated capability hard-filter (e.g. vision,tool_use) — candidates lacking any listed capability are excluded. Header wins over body spillway.require_capabilities. Unknown capability → 422.

Example:

"vision,tool_use"

x-spillway-provider
string

Disambiguate a model name served by multiple providers. Must be a known provider AND on the key's allow-list (403 model_not_allowed otherwise).

Example:

"anthropic"

x-spillway-trace
string

Opt into per-request tracing: on / 1 / true (case-insensitive). The response then carries x-spillway-trace-id.

Example:

"on"

x-spillway-tags
string

JSON object of request tags merged into the request metadata for reporting (body metadata wins on collision). Bounded: ≤16 keys total, key ≤64 chars, value ≤256 chars.

Example:

"{\"team\":\"platform\",\"feature\":\"chat\"}"

Body

application/json
model
string
required
Minimum string length: 1
messages
object[]
required
Minimum array length: 1
stream
boolean
max_tokens
integer
max_completion_tokens
integer
metadata
object

Response

Provider-shaped response (OpenAI/Anthropic JSON, or an SSE stream when streaming).