Skip to main content
What each failure means, and whether to retry with the same idempotency key. An over-budget payment is declined, with no approval path, so don’t poll for one. See Over budget. For the daily cap, see Limits. To resume a paused agent, see Pause or revoke an agent.

Payment failures

Inference failures

Every error these inference endpoints return once they accept a request is an OpenAI-compatible JSON body, {"error": {"message", "type", "code"}}, so an OpenAI SDK or a client built on one shows error.message to the user as-is: POST /v1/chat/completions, GET /v1/models, the image, video, and audio generation routes, and their status polls. POST /v1/messages returns the same errors in Anthropic’s shape, covered in Anthropic Messages API. POST /v1/decide keeps its own error shape, covered in Typed judgments. Three kinds of request are rejected before they reach an inference endpoint, with a non-JSON body instead: an HTTP method the route doesn’t serve gets 405 Method Not Allowed, except on /v1/messages, which answers in its own JSON error shape; a request whose declared Content-Length is over 2 MiB gets 413 Request Entity Too Large, except a POST to an inference endpoint that takes POST, which refuses an oversized body in its own JSON error shape; and an unsafe browser request from another site, such as a cross-site POST, gets 403 Forbidden. These non-JSON responses carry no error.code and no x-should-retry, so handle them by HTTP status. For every other error, the message says what happened, and the table below says what to do; branch on error.code. Each of those responses also carries x-should-retry: true or false, which the OpenAI SDKs follow when deciding whether to retry on their own. When a payment was submitted, the message names the transaction and the response carries it in X-Transaction-ID, and the message says how to resend the request without paying twice: the identical request, with the same Idempotency-Key if you sent one, and with none added if you didn’t. The message never quotes the model provider’s own error text.