error object in the response body. Use error.type together with error.code (when present) and the status code to decide what to do next.
If you need help, contact support and include traceId from the response.
Error response format
Most failed non-streaming requests return JSON like this:
On 429 responses you may also see
Retry-After and X-RateLimit-* headers.
Error reference
Readmessage for specifics — limits, model names, parameters, or which API to use.
Quick guide
- Fix first, then retry:
authentication_error,billing_denied,model_not_found,invalid_request,unsupported_protocol - Wait, then retry:
rate_limit_error— useretry_after_secorRetry-Afterwhen available - Retry with backoff:
service_unavailableand in-stream streaming errors; contact support withtraceIdif it keeps failing - Usually ignore:
client_aborted - If
codeis missing: rely onerror.typeand the HTTP status - Still stuck? Contact support with
traceId
Streaming requests
When a streaming request fails (e.g.stream: true), how the error is returned depends on when the failure happens:
- Before any stream data is sent — You get the same JSON
errorobject and a non-2xx HTTP status as in the table above. - After the stream has started — HTTP may already be 200. The failure is reported as an error event inside the stream (format depends on the API). The text is usually generic, for example upstream stream error, please retry later. Retry with backoff; if it keeps happening, contact support with
traceId.

