Skip to content

The API

Keera Gateway speaks the APIs your tools already know. All of them live under /api on the gateway's address, and all go through the same guardrails and the same request log.

API Endpoint Used by
OpenAI Chat Completions POST /api/v1/chat/completions most tools and SDKs
OpenAI Completions POST /api/v1/completions older tools, code completion
OpenAI Embeddings POST /api/v1/embeddings search and retrieval
Anthropic Messages POST /api/v1/messages Claude Code, the Anthropic SDK
OpenAI Responses POST /api/v1/responses Codex
Model list GET /api/v1/models any of them
MCP servers /api/mcp/<alias> agents that call tools

Put the name of a model or router in the model field. You can use any of the APIs with any model: the gateway translates between them.

Every endpoint and field is in the API reference.

Nothing is stored

The gateway keeps no conversations. With the Responses API, the client sends the whole conversation each time. previous_response_id works only with an OpenAI model on your organisation's own OpenAI key.

Authentication

Send your key in one of these headers:

  • Authorization: Bearer keera_sk_…
  • x-api-key: keera_sk_…
  • X-Keera-Key: keera_sk_…

Headers you can send

Header What it does
X-Keera-Session groups requests into one task in the session report; X-Session-Id also works
X-Keera-Client names your tool in the reports, instead of its User-Agent
X-Request-Id your own id for the request, kept if it is up to 64 simple characters
X-Client-Request-Id your own id, which you know even if no answer comes back

Sessions. Claude Code is recognised on its own. Other tools should send one session id per conversation. A fixed value merges all your work into one long session.

Headers you get back

Header What it tells you
X-Keera-Model the model that answered
X-Keera-Router the router, and where it sent the request
X-Keera-Filters the filters that changed or checked the request
X-Keera-Budget-Remaining money left in the tightest budget, in CHF
X-Keera-Budget-Reset when that budget resets
X-RateLimit-Remaining-Requests requests left this minute
X-Request-Id the request's id; search for it on the Requests screen

Errors

Errors come in the format of the API you called. A conversation too long for the model gets context_length_exceeded, which Claude Code and other agents understand: they shorten it and retry. See Errors for every code.