Inference APIs

How do I handle errors?

Errors use the OpenAI envelope {"error": {"message", "type", "code"}}. 401 missing or invalid key · 402 insufficient_balance · 404 model_not_found · 400 wrong_endpoint (for example a speech model sent to chat) · 413 input too large · 503 model_unavailable · 502 backend error · 429 upstream_rate_limited, which is rare and means the backend is busy, not that you used up a quota. Retry 429, 502 and 503 with backoff; the others are deterministic. The full table is in the API documentation.

Related

More questions