What a failed request looks like, and what to do about it.
Error format
A failed request returns a non-2xx status and a JSON body. Quote the request_id if you ask for help; the same ID is in your Logs.
429 Too Many Requests
{"error":{"type":"rate_limit_error","code":"rate_limited","message":"Rate limit reached for this key. Retry after 4 seconds.","request_id":"req_8c1d0b7e4a21"}}
Status codes
Status
Type
What to do
400
invalid_request_error
The request is malformed, or asks for something the model or computer can't do. The message says which field.
401
authentication_error
The key is missing, wrong, revoked or expired.
402
billing_error
The balance, the key's cap or the organization limit is used up.
403
permission_error
The key may not use this service or model.
404
not_found_error
That computer, file, model or video does not exist.
409
conflict_error
The computer is in the wrong state, for example stopped when you ran a command.
429
rate_limit_error
Too many requests. Wait Retry-After seconds.
502
api_error
The model could not answer. Retry, or add fallback models.
5xx
api_error
Something went wrong on our side. Retry with backoff.