Authentication
One key, sent the way your SDK already sends it. The gateway reads it from the header each lab’s client uses, so nothing but the address changes.
Your key
Section titled “Your key”Keys are made on the API keys page. A key starts with sk-er- and belongs to your account: every key spends from the same balance, so give each tool or server a key of its own and name it for where it is used.
- An account can hold up to 50 keys.
- A key can be switched off, switched back on, or deleted. A change takes up to about half a minute to take effect everywhere.
- Each key has its own rate limit.
Where the key goes
Section titled “Where the key goes”The gateway looks in the places the labs’ own clients put a key, in this order, and takes the first it finds.
| Sent as | Used by | Read on |
|---|---|---|
Authorization: Bearer <key> |
OpenAI SDKs and most tools | Every endpoint |
x-api-key: <key> |
Anthropic SDKs | Every endpoint |
x-goog-api-key: <key> |
Google’s SDKs | Every endpoint |
?key=<key> |
Gemini-style URLs | The Gemini, Messages, Responses, embeddings, image and audio endpoints, and starting a video |
The ?key= form is not read on Chat Completions, on the balance, or when asking for a video’s status or file: send a header there. When a request has an Authorization header, that is the one that counts and the others are not looked at.
The base URL
Section titled “The base URL”Each SDK is given the gateway’s address and adds its own paths to it.
| Client | Base URL | It then calls |
|---|---|---|
| OpenAI SDK | https://api.exoticrouter.com/v1 |
/v1/chat/completions, /v1/responses, /v1/embeddings, … |
| Anthropic SDK | https://api.exoticrouter.com |
/v1/messages |
| Gemini SDK | https://api.exoticrouter.com |
/v1beta/models/{model}:generateContent |
Check a key
Section titled “Check a key”The quickest test is to ask for the balance. A good key answers with it; a bad one answers 401.
curl https://api.exoticrouter.com/v1/balance \ -H "Authorization: Bearer $EXOTIC_API_KEY"{ "object": "balance", "balance_usd": 12.5, "currency": "USD" }When a key is refused
Section titled “When a key is refused”| Status | Code | Meaning |
|---|---|---|
| 401 | missing_api_key |
No key was found in the request. |
| 401 | invalid_api_key |
The key is unknown, or it has been switched off or deleted. The two cases answer alike. |
{ "error": { "message": "Invalid API key.", "type": "authentication_error", "param": null, "code": "invalid_api_key" }}A key with no credit behind it is still a valid key: its requests answer 402, not 401. Errors lists every status.
Calling from a browser
Section titled “Calling from a browser”The gateway answers requests from any origin, so a web page can call it. A key in a page is a key every visitor can read, though: keep keys on your server and call the gateway from there. The list of models needs no key and can be read from anywhere.
Where next
Section titled “Where next”- Models and ids: How a model is named, and how to list what is live.
- Rate limits: Requests per minute, per key.