Errors, limits, and retries

The following error codes tell you what went wrong during your request.
CodeAction
invalid_api_keyCheck the key. Create another key if it was revoked or expired.
model_not_foundChoose a model 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

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

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

A 429 response means that the model is currently at full capacity, retrying will cause the request to succeed.