Errors, limits, and retries

The following error codes tell you what went wrong during your request.

Each error response has the code in error.code. If a /v1/responses stream fails after it starts, the error event has the code in code.

CodeStatusAction
invalid_request400Fix the request body or the named parameter.
unsupported_parameter400Remove or change the named parameter.
context_length_exceeded400Reduce the input or output limit.
invalid_api_key401Check the key. Create another key if it was revoked or expired.
insufficient_balance402Add credits or use another funded workspace.
workspace_archived403Use a key from a workspace that is not archived.
organization_suspended403Contact team@gradiated.com.
model_not_found404Choose a model from the model catalog.
model_unavailable404Retry later or select another ready model.
payload_too_large413Send a request body smaller than 32 MB.
concurrency_exceeded429Wait for a running request to finish, then retry.
capacity_exceeded, settlement_backlog429Retry with backoff.
runtime_unavailable, serving_state_unavailable, finalization_unavailable503Retry with backoff.

Retry rules#

You should retry 429 and temporary 503 responses with exponential backoff.

Do not retry a request that has a 401, model_not_found, or parameter errors without changing the request, it will continue to fail.

A 429 response can repeat on retry. Use the error code to choose the action in the table above.