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

StatusMeaningWhen
400Bad requestMalformed JSON, missing messages, or an unknown model id.
401UnauthorizedMissing, malformed, or revoked API key. Rotate or re-check the key.
429Rate limitedPer-org RPM exceeded, or the org budget cap is reached. Honor Retry-After.
502Bad gatewayThe upstream node returned an error or was unreachable during routing.
503Service unavailableThe 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.