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

ErrorMeaningFirst thing to try
529 overloaded_errorModel temporarily out of capacityRetry or /model to switch
429 rate_limit_errorToo many requests at onceFewer parallel agents, then retry
401 authentication_errorKey missing, wrong or in the wrong variableANTHROPIC_AUTH_TOKEN, empty ANTHROPIC_API_KEY
400 invalid_request_errorRequest rejected (model ID, length, overrides)Read the message; /compact
Connection error / timeoutNo response from the APICheck 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.

~/.claude/settings.json
{
  "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).

Model status and pricesContact supportDocs

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.