Which Model API errors should I retry?
Retry only 429 rate_limited and the 5xx errors. Every other error means something in the request, the key or the account has to change first.
Retry (with backoff)#
| Code | Wait |
|---|---|
rate_limited (429) | Exactly Retry-After seconds |
model_overloaded, model_unavailable (503) | Retry-After if sent, else exponential backoff |
model_timeout (504) | Backoff; consider streaming or a smaller max_tokens |
empty_response, stream_error (502) | Backoff |
Don't retry#
| Code | Instead |
|---|---|
| 400 codes | Fix the body |
| 401 codes | Fix the key or the X-Clatter-Account header |
out_of_credits (402) | Add credits, alert a person |
insufficient_scope (403) | Use a key with models:invoke |
account_suspended (403) | Wait until resets_at |
model_not_found, not_supported (404) | Fix the id or endpoint |
model_retired (410) | Switch to a SuperCosmos id |
request_too_large (413) | Make the request smaller |
A good backoff#
Start around 1 second, double each attempt, add a little random jitter, cap the wait, and stop after a few attempts. Always prefer Retry-After when the response has it. OpenAI SDKs already retry some of these for you (see max_retries).
Still need help?#
- General support: support@clatterlabs.com or team@clatterlabs.xyz
- Infrastructure questions, or permanent deletion of your data (your whole account or one service): infrastructure@clatterlabs.xyz
We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Related articles
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.