gradiated

Errors, limits, and retries

Error codes tell your application whether to change the request, wait, or ask for user action.

CodeAction
invalid_api_keyCheck the key. Create another key if it was revoked or expired.
model_not_foundUse an exact ID from the model catalog.
model_unavailableRetry later or select another ready model.
insufficient_balanceAdd credits or use another funded workspace.
context_length_exceededReduce the input or output limit.
unsupported_parameterRemove or change the named parameter.
capacity_exceededRetry with backoff.

Retry rules

Retry 429 and temporary 503 responses. Use exponential backoff, add random delay, and set a retry limit.

Do not retry 401, 404, or parameter errors without changing the request.

A 429 response means that no model slot is available now. The gateway does not queue the request.

Request IDs

Keep the response request or generation ID in your application logs. Do not log prompts, outputs, or API keys with it.