Skip to main content
Before an OpenAI-compatible stream begins, API errors use this structure:
This is an illustrative authentication error. Match the HTTP status and machine-readable code; do not parse human-readable error messages.

Status guide

Common stable codes include invalid_request, invalid_model, unsupported_feature, provider_rejected_request, rate_limited, provider_unavailable, usage_unavailable, and inference_timeout. Backend details and credentials are not included in error messages. Prepaid admission uses these more specific codes:

Streaming errors

After HTTP headers have been sent, the server cannot replace the response with a different status. A stream may end early or carry a provider failure event. Catch SDK iteration errors, inspect terminal events, and check Activity; a 200 alone does not prove completion.

Retry deliberately

The gateway performs no automatic upstream inference retries. The official SDKs may retry some failures unless you set JavaScript maxRetries: 0 or Python max_retries=0, as in the quickstart. Inference POST requests are not deduplicated by an idempotency key. Replaying a request can generate another response and incur another charge, even if the first response was lost in transit. For interactive applications, show an explicit retry action after partial output. For jobs, store your own job state and use bounded exponential backoff with jitter. Capture X-Request-ID for diagnosis. Never include your API key in logs or support messages.

Messages, administration, and policies

Messages errors add a top-level type: "error" and use Anthropic-style categories such as authentication_error and rate_limit_error. Continue matching the HTTP status and error.code. Administrative errors and policy errors include error.request_id. A stale policy revision returns 409 with policy_revision_conflict; read the latest revision before editing. Creation retries must keep the same idempotency key and payload. An expired key-secret replay window returns idempotency_reconciliation_required; inspect existing keys before issuing another. A blocking policy can return policy_violation; an unavailable evaluator can return policy_evaluation_unavailable. These use policy_error. Do not silently disable a policy to retry an otherwise rejected request.