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

StatusCause
400The body could not be read, or it names a model this router does not sell on that route — the message says which.
401The key is missing, unknown or revoked.
403Out of credit, over the key's monthly budget, or credit reserved by in-flight tasks — the message says which.
408The request body stopped arriving before the router had all of it: 60 seconds for a JSON body, five minutes for an upload.
413The request body is larger than the router buffers: 20 MiB, or 64 MiB on /v1/images/edits and /v1/audio/transcriptions.
429Five unpaid top-ups are already open on the account.
502The chosen upstream's reply could not be relayed: the connection dropped mid-stream, or the response was too large to pass on.
503No 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.

Base URLhttps://api.blastrouter.com