Create a message (Anthropic-compatible)
https://api.stav.ai/v1/messagesAnthropic Messages API. Drop-in for the official Anthropic SDK —
set base_url="https://api.stav.ai" (the SDK appends /v1) and
api_key=sk_stav_live_....
Routing:
anthropic/claude-*models are proxied verbatim toapi.anthropic.com. Full Messages-API fidelity includingcache_controlmarkers, extendedthinking, and beta features.- Every other catalogue model is translated to the OpenAI Chat Completions
contract and dispatched through the same path as
/v1/chat/completions.model="auto"invokes the Smart Router.
Per-key rate limits apply. App attribution via the X-Stav-App-Id
header is supported and recorded on the inference log.
Header parameters
X-Stav-App-IdstringOptional app slug for attribution on the inference log.
Request body
modelstringrequiredmax_tokensintegerrequiredmessagesarray of objectsrequiredShow 2 child fields
roleenumrequireduserassistantcontentstring | array of objectrequired
systemstring | array of objecttemperaturenumbertop_pnumbertop_kintegerstreambooleanstop_sequencesarray of stringproviderobjectStav extension. Same object as on
/v1/chat/completions. On an explicitly named model, the model must passonly/ignore/max_price/quantizationsor the request is refused. Never forwarded to Anthropic.sort,require_parametersandallow_fallbacksreturn 400.Show 4 child fields
onlyarray of stringignorearray of stringmax_priceobjectShow 2 child fields
promptnumbercompletionnumber
quantizationsarray of string
toolsarray of objectsTool definitions. On a non-Claude model, server tools (any
typeother thancustom, e.g.web_search_20250305) are dropped and named in theX-Stav-Dropped-Paramsresponse header, together withtool_choicewhen it pointed at one. Tools with aninput_schemaare passed on.Show 4 child fields
namestringrequiredinput_schemarequiredJSON Schema 2020-12 document for the tool's input.
descriptionstringcache_controlobjectShow 1 child field
typestring
tool_choiceobjectShow 3 forms
Form 1typestring
Form 2typestring
Form 3typestringrequirednamestringrequired
thinkingobjectExtended thinking config (Anthropic models only).
Show 2 child fields
typeenumenableddisabledbudget_tokensinteger
metadataobjectShow 1 child field
user_idstring
Response headers
| Header | Meaning |
|---|---|
X-Stav-Request-Id | Unique request identifier, identical to the completion |
X-Stav-Model | The model that actually served the request — not necessarily the one you asked for, when routing or failover intervened. |
X-Stav-Provider | The provider that served the request. |
X-Stav-Sovereignty-Level | The effective sovereignty level (L0–L4 ladder) of the endpoint
that served this request. |
X-Stav-Reasoning-Effort | Present when the request carried a reasoning control
( |
X-Stav-Reasoning-Chosen-By | Who chose the reasoning level the provider received: |
X-Stav-Upstream-Surface | The provider API that served the request: |
Errors
| Status | When |
|---|---|
| 400 | Invalid request — malformed JSON, missing required fields, or invalid parameter values. |
| 401 | Missing or invalid API key. |
| 403 | API key lacks the required scope (e.g., |
| 404 | Model id is not in the catalogue, or the caller's key doesn't have access to it. |
| 429 | Per-key or per-IP rate limit exceeded. |
| 502 | An upstream provider (Anthropic, OpenAI, etc.) returned an error. |
| 503 | Upstream Anthropic credential not configured on this deployment. |
Every error code, what it means and what to do: Errors.