Claude Code · Troubleshooting
Claude Code API errors and how to fix them
Find the error you see in Claude Code, then follow the fix. Most problems come from three places: the key, the base URL, or temporary limits on the model or your request rate.
Last checked
Pick your error
| Error | Meaning | First thing to try |
|---|---|---|
| 529 overloaded_error | Model temporarily out of capacity | Retry or /model to switch |
| 429 rate_limit_error | Too many requests at once | Fewer parallel agents, then retry |
| 401 authentication_error | Key missing, wrong or in the wrong variable | ANTHROPIC_AUTH_TOKEN, empty ANTHROPIC_API_KEY |
| 400 invalid_request_error | Request rejected (model ID, length, overrides) | Read the message; /compact |
| Connection error / timeout | No response from the API | Check base URL, proxy, API_TIMEOUT_MS |
529 overloaded429 rate limited401 unauthorized400 bad requestConnection error
Known-good config
Compare your ~/.claude/settings.json with this. Restart Claude Code after any change and run /status.
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
"ANTHROPIC_API_KEY": "",
"ANTHROPIC_BASE_URL": "https://api.aicodewith.ai"
}
}Are failed requests charged?
Failed requests (4xx/5xx, timeouts, dropped connections) are not charged — you're only billed for requests that complete successfully. If an upstream failure is automatically retried and succeeds, you're billed once.
Still failing?
- Check the model's page on aicodewith: it shows recent health for each channel.
- Look up the request in your dashboard usage records to see its model, status and cost.
- Email support@aicodewith.com with the time of the error, the model and the error text (never your full API key).
FAQ
Am I charged for failed requests?
Failed requests (4xx/5xx, timeouts, dropped connections) are not charged — you're only billed for requests that complete successfully. If an upstream failure is automatically retried and succeeds, you're billed once.
Why does Claude Code say API Error?
The API returned an error or did not answer. The status code (529, 429, 401, 400) or the words connection error tell you which page above applies.
Why do I see 404 instead of an error code above?
The base URL probably ends in /v1. Set ANTHROPIC_BASE_URL to https://api.aicodewith.ai and restart.
Does the base URL need /v1?
No. Use https://api.aicodewith.ai exactly.
Where do I see what happened?
Run /status in Claude Code for the endpoint, and check your dashboard usage records for each request.
Is aicodewith affiliated with Anthropic?
No. aicodewith is an independent API platform. Claude Code is a trademark of Anthropic.
Ready to try it?
Billing is per token from a prepaid balance. Rate and concurrency limits apply, and you can set daily, monthly or total spend caps on each API key.
Related
Sources
Claude and Claude Code are trademarks of Anthropic PBC. aicodewith is an independent platform and is not affiliated with or endorsed by Anthropic. Checked 2026-10-10.