API

Errors

Errors use the format of the endpoint you called and a standard HTTP status code.

Error format

OpenAI-compatible endpoints
{"error": {"message": "model: no-such-model not found", "type": "not_found_error", "code": null}}
Anthropic Messages
{"type": "error", "error": {"type": "authentication_error", "message": "..."}}

Status codes

StatusMeaningWhat to do
400Invalid requestFix the request body or parameters.
401Missing or invalid API keyCheck the key and auth header.
402Key budget exhaustedTop up or raise the key budget.
403Model not allowed for this key (videos)Enable the model for the key.
404Unknown model or not enabled for the keyUse an ID from GET /v1/models.
409Idempotency conflict (videos)Use a new client_request_id.
413Request too largeShorten the input.
429Rate limitedRetry with exponential backoff.
5xxUpstream or gateway errorRetry with backoff.

Last updated