Skip to content
exoticrouter.com ↗

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.

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.

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.

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

The quickest test is to ask for the balance. A good key answers with it; a bad one answers 401.

Terminal window
curl https://api.exoticrouter.com/v1/balance \
-H "Authorization: Bearer $EXOTIC_API_KEY"
{ "object": "balance", "balance_usd": 12.5, "currency": "USD" }
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.

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.