AI Gateway API
The gateway serves two API dialects on the same port. The dialect is chosen by the route; everything behind it — alias resolution, budgets, cache, the upstream call, metering, audit — is dialect-agnostic and operates on one canonical representation.
Client dialect is independent of upstream dialect. An Anthropic-SDK caller can be served by a vLLM upstream and an OpenAI-SDK caller by Anthropic.
Required headers
Section titled “Required headers”Every request to the data plane carries the platform tenancy headers:
| Header | Required | Purpose |
|---|---|---|
X-Kis-Tenant | yes | Tenant id — partitions registry, cache, budgets and audit |
X-Kis-Product | yes | Product id |
X-Kis-Environment | yes | Environment id |
X-Kis-Block | yes | Calling block, for cost attribution |
X-Kis-Customer | no | Customer id |
X-Kis-Priority | no | critical, normal (default) or background |
A request missing a mandatory header is rejected rather than served against a default tenant.
Model endpoints
Section titled “Model endpoints”OpenAI dialect
Section titled “OpenAI dialect”POST /v1/chat/completions chat completion, sync or SSEPOST /v1/embeddings embeddingsGET /v1/models aliases resolvable by this callerPOST /v1/batches submit a batchGET /v1/batches/{id} batch statusPOST /v1/batches/{id}/cancel cancel a batchGET /v1/batches/{id}/results batch resultsPOST /images/generations image generationPOST /audio/speech text to speechPOST /audio/transcriptions speech to textAnthropic dialect
Section titled “Anthropic dialect”POST /v1/messages message completion, sync or SSEPOST /v1/messages/count_tokens token count without generatingmodel names a gateway alias, not a provider model — support.classifier.v3, not
claude-haiku-4-5. Which upstream that resolves to is configuration.
{ "model": "support.classifier.v3", "messages": [{ "role": "user", "content": "where is my order?" }]}Streaming
Section titled “Streaming”Both dialects stream over SSE when the request asks for it. Mid-stream events are recorded, so a replayed streamed call reproduces the stream rather than only the final text. Cancelling mid-stream is supported and recorded as such in the audit trail.
Admin surface
Section titled “Admin surface”A separate port behind mTLS and platform authentication.
POST /admin/v1/aliases create an aliasGET /admin/v1/aliases list aliases visible to the tenantGET /admin/v1/aliases/{name} one alias, with resolved inheritancePUT /admin/v1/aliases/{name} publish a new versionDELETE /admin/v1/aliases/{name} retire a tenant alias
GET /admin/v1/prompts/{name} fetch a prompt, any versionPUT /admin/v1/prompts/{name} publish a new version
GET /admin/v1/budgets/{tenant} current consumption against every scope
GET /admin/v1/audit/{request_id} the audit record for one requestGET /admin/v1/stats gateway statisticsGET /admin/v1/health readinessAlias objects carry name, dialect, cache (with enabled and mode), budget (including
cost_ceiling_usd_per_tenant_per_day), fallback_count and ab_routing. Platform-owned
aliases are readable but not writable by a tenant.
Errors
Section titled “Errors”The error body is rendered in the caller’s dialect.
OpenAI envelope:
{ "error": { "message": "human-readable, no customer data", "type": "invalid_request_error", "code": "canonical_error_code" }}Anthropic envelope:
{ "type": "error", "error": { "type": "invalid_request_error", "message": "human-readable, no customer data" }}Note the asymmetry: the OpenAI envelope carries the canonical code, the Anthropic one does
not. If you are matching on error identity, use the OpenAI dialect or the request id.
| Status | Meaning |
|---|---|
400 | Malformed request |
401 / 403 | Authentication or authorisation failure |
404 | Alias not resolvable for this tenant |
429 | Budget or rate limit exceeded — sets Retry-After |
5xx | All upstreams in the fallback chain failed |
429 responses set the Retry-After header in seconds. Messages never contain customer data,
so they are safe to log and surface.
See also
Section titled “See also”- Core Concepts — aliases, caching, fallback, budgets
- Configuration — the admin API in use
- Operations — accounting, audit and replay