How to Read AI API Error Codes: Causes, Retries, and Fallbacks for 400, 401, 404, 429, 5xx, and 529

Explains common LLM API error codes by splitting them into "fix the request" and "wait and retry" categories, focusing on distinguishing 429 rate limits from quota exhaustion, and provides backoff retry, circuit breaker, and fallback patterns to avoid wasted retries and retry storms.

How to Design AI API Retries: What to Retry, How Long to Back Off, and What to Do When a Stream Breaks

Split LLM call errors into retryable transient failures and deterministic failures that retrying won't fix, with parameter choices for Retry-After priority and jittered exponential backoff, plus handling for three common traps: stream interruptions, nested SDK retries, and tool-call side effects.