Errors
Errors use the OpenAI-compatible envelope and standard HTTP status codes, so your existing error handling carries over.
Error envelope
The branded API returns errors in the OpenAI shape — an error object with a message:
{
"error": {
"message": "human-readable description",
"type": "invalid_request_error",
"code": null
}
}Status codes
| Status | Meaning | When |
|---|---|---|
400 | Bad request | Malformed JSON, missing messages, or an unknown model id. |
401 | Unauthorized | Missing, malformed, or revoked API key. Rotate or re-check the key. |
429 | Rate limited | Per-org RPM exceeded, or the org budget cap is reached. Honor Retry-After. |
502 | Bad gateway | The upstream node returned an error or was unreachable during routing. |
503 | Service unavailable | The gateway is not currently configured or reachable. |
Retries
On 429, respect the Retry-After response header and back off. 502 is usually transient — the router already retries a failed node on the next-cheapest healthy one, so a 502 reaching you means no healthy node served the request; retry with backoff.
Requests made through the in-app console proxy are flattened to a
{ "error": "message" } string for display. Direct calls to the branded API return the full OpenAI error object shown above.