Claude Code · Server and limits
API Error: 500 Internal server error
Claude Code shows API Error 500 (Internal server error) or 502? What it means, why it isn’t your settings, and what to do while Anthropic fixes it.
Message
The exact error
API Error: 500 Internal server error. This is a server-side issue, usually temporary — try again in a moment. If it persists, check https://status.claude.com.Also appears as:
- From a proxy or gateway
- API Error: 502 Bad Gateway
- When the error arrives part-way through a reply
- API Error: Server error mid-response. The response above may be incomplete.
Meaning
What does API Error 500 mean in Claude Code?
A 5xx status means the request reached the server and failed there. It’s not something you sent: Anthropic’s error reference says a 5xx from the API itself isn’t caused by your prompt, settings or account. Claude Code has usually retried several times with backoff before showing it. When the error page comes from a proxy, load balancer or gateway in between, the message shows that page’s status and title instead, such as 502 Bad Gateway. On Amazon Bedrock, Google Cloud or Microsoft Foundry, the last sentence names that provider’s status page.
Causes
Is Claude Code down?
- A temporary fault or incident at Anthropic or your cloud provider: check status.claude.com or the status page the message names
- A proxy or gateway between you and the API failing (with
ANTHROPIC_BASE_URLset, the message names the gateway host)
Fix
What should I do about API Error 500?
Check the status page
Look at status.claude.com, or the provider status page the message names, for an active incident.
Wait a minute and resend
Your message is still in the conversation, so for a long prompt you can just type
try again.If you use a gateway, check it first
With a custom
ANTHROPIC_BASE_URL, the trailing sentence names the gateway host instead of Anthropic’s status page. A 502, 503 or 504 with a page title usually comes from that gateway or a proxy, so check its health or logs before waiting on Anthropic.Report it if it persists
With no incident posted and the error repeating, run
/feedbackso Anthropic can look at your request.
Explained
What about 502, 503 and 504 errors?
When a proxy, load balancer or LLM gateway answers with its own HTML error page, Claude Code shows the status code and the page’s title, such as API Error: 502 Bad Gateway. A page without a title shows the status code and its standard name. Before v2.1.281 the status code was dropped when the page had a title, and the raw markup was printed when it had none. If the API is at capacity rather than failing, you see Repeated 529 Overloaded errors instead, and a request that gets no answer in time ends as Request timed out.
Explained
What happens to a response cut off by a 500?
If the server error arrives after Claude has completed a block of text or a tool call, Claude Code doesn’t re-run the request, because that could run the same tool calls twice. It keeps what Claude completed, runs any tool calls that finished, and shows API Error: Server error mid-response. The response above may be incomplete. Reply with continue to pick up from the last completed block. Before v2.1.199, the partial output was discarded and the whole turn reported as an error.
FAQ
Questions people ask
Is Claude Code down when I get API Error 500?
Possibly. A 500 means a failure inside the API, and during incidents many users see it on every prompt. Check status.claude.com, or the cloud provider’s status page if you use Bedrock, Google Cloud or Foundry. If nothing is posted and only you see it, wait a few minutes and retry, then report it with /feedback.
Does Claude Code retry API Error 500 automatically?
Yes. Server errors that arrive before any of Claude’s reply has streamed are retried up to 10 times with exponential backoff, so when you see the error, those retries have already failed. An error that arrives after Claude completed part of its reply isn’t retried, to avoid running tool calls twice; Claude Code keeps the completed part instead.
What is the difference between API Error 500 and 529?
A 500 is an unexpected failure inside the service. A 529 means the service is temporarily over capacity. Both are server-side and usually clear on their own. For a 529, switching model with /model often helps, because capacity is tracked per model, and Anthropic says a 529 doesn’t count against your quota.
Related
Related errors
Keep exploring