API-referanse
EU-sovereign AI inference platform
Base-URL
https://api.stav.ai/v1
Last ned OpenAPI 3.1-filen på /docs/api/spec for Postman, Insomnia eller openapi-generator. Alle kall unntatt den offentlige katalogen trenger en API-nøkkel: se Autentisering.
The Stav AI API gives you OpenAI-compatible and Anthropic-compatible inference against a curated catalogue of commercial models, with routing, a per-workspace sovereignty floor, and a per-request audit trail.
Two SDK contracts, one API
- OpenAI-compatible (
/v1/chat/completions,/v1/embeddings,/v1/models) — drop-in for the official OpenAI SDKs. Setbase_url="https://api.stav.ai/v1"and your existing code works. - Anthropic-compatible (
/v1/messages) — drop-in for the official Anthropic SDK. Setbase_url="https://api.stav.ai"(the SDK appends/v1itself) andanthropic/claude-*models proxy verbatim to Anthropic (preservingcache_control,thinking, beta features). Every other catalogue model translates to the OpenAI Chat Completions contract under the hood — same call, same shape, different upstream.
Sovereignty model
Every inference response carries an X-Stav-Sovereignty-Level header
with the effective sovereignty level of the endpoint that served the
request, on Stav's graded L0–L4 ladder:
L0— foreign jurisdiction (served under third-country law, outside the EU/EEA guarantees).L1— EU/EEA location: inference runs on EU/EEA soil.L2— EU/EEA operation + certification.L3— EU/EEA ownership & control of the serving operator.L4— full sovereignty, no exceptions.UNCLASSIFIED— not yet assessed (a data-quality state, not a rung).
The same level is recorded on every request log entry, so your compliance evidence can state per request which rung served it.
Models are proxied through Stav from their upstream providers (OpenAI, Anthropic, Mistral, Google, xAI, Cohere and others). Stav holds the upstream relationship, so your traffic terms are governed by Stav's Terms of Service rather than the commercial vendor's, and every call is logged, billed and audit-trailed by Stav.
A routing floor is set per workspace (and optionally raised per router); it applies to routing decisions, and combines by taking the strictest value. See the sovereignty ladder.
Smart Router
Pass model="auto" to let Stav's Smart Router pick a model for the
request, or @workspace-slug/router-slug to use a named routing policy your
workspace authored. Selection scores the eligible pool on quality, expected
request cost and measured end-to-end latency using your workspace's weights,
after hard-filtering on your sovereignty floor, quality floor and the
capabilities the request needs.
What the response tells you:
model— the model that actually served, which may differ from what you sent.X-Stav-ModelandX-Stav-Provider— the same, in headers.X-Stav-Route-Reason— a one-line, human-readable rationale. Prose; do not parse it.X-Stav-Router— the router that handled the request, when one did.X-Stav-Served-By: own-resourceandX-Stav-Node-Id— the request was served by one of your own Stav Tunnel nodes (non-streaming only; usage costs €0).X-Stav-Reasoning-Effort— when the request carried a reasoning control, or the router chose one, the level the provider actually received (seereasoning_effort).X-Stav-Reasoning-Chosen-By— who chose that level:caller,router(the request set none and the Smart Router picked one) orprovider_default.X-Stav-Upstream-Surface— the provider API that served the request (chat,responsesormessages). See the header's own description for when it differs from the path you called.
The full decision — every candidate, its score, and the alternatives retained for failover — is in Your workspace: open the request in Monitor → Request log.
Request parameters
Stav does not silently drop parameters a provider cannot honour. A
parameter is either honoured, or refused with a 400
(unsupported_parameter) naming the parameter and the model that
resolved. An undeclared field is likewise refused by name.
Support is keyed by wire dialect, not vendor: the openai dialect also
backs xAI, Cohere, Azure and OpenAI-compatible servers.
| Parameter | OpenAI | Anthropic | Mistral | |
|---|---|---|---|---|
temperature | yes | yes | yes | yes |
top_p | yes | yes | yes | yes |
max_tokens | yes | yes | yes | yes |
response_format | yes | yes | yes | yes |
tools | yes | yes | yes | yes |
allowed_tools | yes | 400 | 400 | 400 |
tool_choice | yes | yes | yes | yes |
reasoning_effort (reasoning, thinking) | yes | yes | yes | yes |
stop | yes | yes | yes | yes |
top_k | 400 | yes | yes | 400 |
seed | yes | 400 | 400 | 400 |
logprobs | yes | 400 | 400 | 400 |
top_logprobs | yes | 400 | 400 | 400 |
presence_penalty | yes | 400 | 400 | 400 |
frequency_penalty | yes | 400 | 400 | 400 |
logit_bias | yes | 400 | 400 | 400 |
verbosity | yes | 400 | 400 | 400 |
prediction | yes | 400 | 400 | 400 |
prompt_cache_key | yes | 400 | 400 | 400 |
safety_identifier | yes | no-op | no-op | no-op |
service_tier | yes | 400 | 400 | 400 |
user | yes | no-op | no-op | no-op |
parallel_tool_calls | yes | 400 | 400 | 400 |
min_p | 400 | 400 | 400 | 400 |
repetition_penalty | 400 | 400 | 400 | 400 |
store | 400 | 400 | 400 | 400 |
session_id | Stav | Stav | Stav | Stav |
cost_tier | Stav | Stav | Stav | Stav |
remaining_turns | Stav | Stav | Stav | Stav |
metadata | 400 | 400 | 400 | 400 |
modalities | 400 | 400 | 400 | 400 |
include_reasoning | 400 | 400 | 400 | 400 |
chat_template_kwargs | 400 | 400 | 400 | 400 |
no-op — accepted and ignored on that dialect, never a 400. Stav — meant for Stav's router and forwarded to no provider.
Per-model capabilities are discoverable before you send anything —
GET /v1/models/{model_id} returns stav_capabilities.
Rate limits
Default 300 requests/minute per production key (30 for test keys); a per-key override can change the number. Headers on a successful response report:
X-RateLimit-Limit— the key's per-minute capX-RateLimit-Remaining— requests left in this windowX-RateLimit-Reset— Unix timestamp when the window rolls over
Exceeding the cap returns 429 with a Retry-After header.
Request IDs
Every response carries X-Stav-Request-Id — on a success it is the same
value as the completion id. Quote it when contacting support.
Every error carries the same identifier twice: on the
X-Stav-Request-Id header, and as error.request_id in the body. That
holds for streaming errors too, where the SSE error frame carries
error.request_id even though the HTTP status is 200.
Endepunkter
Chat
- POST
/v1/chat/completionsCreate a chat completion (OpenAI-compatible) - POST
/v1/messagesCreate a message (Anthropic-compatible) - POST
/v1/responsesCreate a response (OpenAI Responses API, passthrough) - GET
/v1/responses/{response_id}Retrieve a stored response - DELETE
/v1/responses/{response_id}Delete a stored response - POST
/v1/responses/{response_id}/cancelCancel an in-progress (background) response - GET
/v1/responses/{response_id}/input_itemsList input items for a stored response
Embeddings
Audio
Decisions
Models
Catalogue
- GET
/v1/public/currenciesList the currencies catalogue prices can be shown in - GET
/v1/public/modelsBrowse the public model catalogue - GET
/v1/public/models/{slug}Get a catalogue model by slug - GET
/v1/public/familiesList model families - GET
/v1/public/families/{slug}Get a model family by slug - GET
/v1/public/families/{slug}/modelsList models in a family - GET
/v1/public/model-creatorsList model creators - GET
/v1/public/model-creators/{slug}Get a model creator by slug - GET
/v1/public/providersList inference providers - GET
/v1/public/providers/{slug}Inference provider detail - GET
/v1/public/sovereigntySovereignty levels - GET
/v1/public/capabilitiesCapabilities taxonomy