API reference
Authentication for the gateway's client endpoints, request and response headers, what each endpoint does and its limits, streaming and usage accounting, model name resolution, and the error format.
The gateway serves OpenAI- and Anthropic-compatible endpoints under /v1. Apart from the model field, request bodies are passed to the upstream largely unchanged; when the upstream speaks a different format from the client, the gateway translates requests and responses.
Authentication
| Method | Header |
|---|---|
| Bearer | Authorization: Bearer sk-rst-... |
| Anthropic style | x-api-key: sk-rst-... |
Both work on every /v1 endpoint. Without an active licence, every endpoint returns 403 license_required.
Endpoints
| Method | Path | Format | Description |
|---|---|---|---|
| POST | /v1/chat/completions | OpenAI | Chat completions, with streaming and tool calls |
| POST | /v1/responses | OpenAI Responses | Served as a chat completion; see below |
| POST | /v1/messages | Anthropic Messages | Streaming and tool calls; errors in Anthropic format |
| POST | /v1/completions | OpenAI | Text completions |
| POST | /v1/embeddings | OpenAI | Embeddings; needs an embedding model |
| POST | /v1/rerank | vLLM | Rerank; needs a suitable model |
| POST | /v1/score | vLLM | Relevance scoring; needs a suitable model |
| GET | /v1/models | OpenAI | Model names and aliases the key may use |
Every endpoint applies the same metering, limits, content safety and personal information masking.
GET /v1/models
Returns {"object": "list", "data": [...]}; each id is a public name or alias, sorted by name. If the key is limited to certain models, only those are listed.
POST /v1/messages
For clients that speak the Anthropic format, such as Claude Code. For OpenAI-compatible upstreams such as vLLM, the gateway converts the request to OpenAI format and merges all system content, in order, into one leading message. For Anthropic upstreams, cache-read and cache-write tokens count as input usage. When the model has Forward priority on, the key's priority is passed to vLLM here too.
Errors look like {"type": "error", "error": {"type": "...", "message": "<code>: <message>"}}.
POST /v1/responses
The gateway turns a Responses request into a chat completion and returns the result in Responses format. Streaming events run from response.created through response.output_text.delta and end with response.completed. Any upstream can serve this endpoint. Multi-turn conversations, function calls, namespaced MCP tools and custom-format tools are supported.
The gateway stores nothing, as if store: false were set:
previous_response_id,conversation,backgroundanditem_referencereturn 400unsupported_parameter; send the whole conversation ininput.- OpenAI-hosted tools such as web search and file search are ignored.
instructionsand any system and developer messages are merged, in order, into one leading system message.
Request handling
- Model name:
modelcan be a public name or an alias. An unknown name returns 404model_not_found; a model the key may not use returns 403model_not_allowed. - Output cap: when the key has a per-request output cap, a larger
max_tokensis lowered and a missing one is added. - Priority: a
priorityfield in the request body is not passed on; the gateway uses the key's priority, and writes it into the request only when the model has Forward priority on. - Streaming: for streamed requests the gateway sets
stream_options.include_usagefor metering, so the stream ends with an extra chunk carryingusage. If a stream breaks off, tokens are estimated from what was generated. - Body size: up to 32 MB; larger bodies get 413
body_too_large. - Routing: fallback models take over on queue timeout, when all upstreams are unavailable or answer 5xx; the long-context model takes over when the context length would be exceeded. See Models.
Response headers
| Header | Description |
|---|---|
X-Request-Id | On every response; matches the request log entry |
X-PII-Masked | Number of replacements when personal information masking is set to mask and continue |
Retry-After | On 429 responses, value 1 |
Error format
Errors from the OpenAI-compatible endpoints:
{"error": {"message": "...", "type": "...", "code": "rate_limit_rpm"}}Callers should branch on error.code. The full list is under Error codes. Requests the gateway rejects (rate limits, budgets, disallowed models, queue timeouts and so on) are still written to the request log; requests with an invalid key are not.
Console management API
The console's /api endpoints are available to external systems for automation, for example to pull usage reports, authenticated with an API token as Authorization: Bearer fab_...; see API tokens. Download the specification from the Integration Guide page or fetch GET /api/openapi.yaml.
Integration
Connection parameters, the console's Integration Guide page, calling the gateway with curl, Python and Node.js, connecting Claude Code and Codex to local models, reasoning models and request IDs.
Request logs
The fields recorded for each call, filtering and export, timing, usage, source and routing in the request detail, retained conversation content, and the retention period.