Errors
An error comes back in the envelope of the wire format you used, never in one of the router's own.
Envelopes
The same failure — an unknown key — in each of the three shapes.
Anthropic
json
{ "type": "error", "error": { "type": "authentication_error", "message": "invalid API key" }}OpenAI
json
{ "error": { "message": "invalid API key", "type": "authentication_error", "param": null, "code": null }}Gemini
json
{ "error": { "code": 401, "message": "invalid API key", "status": "UNAUTHENTICATED" }}Status codes
| Status | Cause |
|---|---|
400 | The body could not be read, or it names a model this router does not sell on that route — the message says which. |
401 | The key is missing, unknown or revoked. |
403 | Out of credit, over the key's monthly budget, or credit reserved by in-flight tasks — the message says which. |
408 | The request body stopped arriving before the router had all of it: 60 seconds for a JSON body, five minutes for an upload. |
413 | The request body is larger than the router buffers: 20 MiB, or 64 MiB on /v1/images/edits and /v1/audio/transcriptions. |
429 | Five unpaid top-ups are already open on the account. |
502 | The chosen upstream's reply could not be relayed: the connection dropped mid-stream, or the response was too large to pass on. |
503 | No configured upstream could serve the request — every one in cooldown or failed — or the router is shedding load. |
Retry a 502 or a 503 with backoff. The rest name their cause in message.