API error fixes & troubleshooting
Short, accurate fixes for the errors that actually stop developers mid-build on the Claude and OpenAI APIs — what each error means, how to tell look-alike errors apart, and the retry/backoff patterns that resolve them. Every page is verified against the provider's current documentation.
Claude API errors
- Claude API
overloaded_error(HTTP 529) — why it happens, how it differs from a 429, and the backoff pattern to handle it. - Anthropic API 401
authentication_error— the 6 root causes of a bad API key,401vs403, the.strip()whitespace fix, and how to check key prefix (sk-ant-vssk-proj-).
OpenAI API errors
- OpenAI API 429: rate limit vs. quota — the same status code, two opposite causes (
rate_limit_exceededvsinsufficient_quota), and how to fix each. - OpenAI
context_length_exceeded(400) — how to count tokens with tiktoken, the context window table for all current models, and the 5 fix strategies ranked by trade-off. - OpenAI
model_not_found(404) — wrong model ID, no access, or deprecated model: 3 causes with a current valid-ID reference and a deprecation migration table. - OpenAI API timeout errors — connect vs. read timeout types, SDK defaults, configuring
httpx.Timeout, and the retry-safety decision tree for long-running requests.
Building something cost-sensitive? See our how-to guides for cutting API costs and capping spend.