API Error: 500 Internal server error
The message
API Error: 500 Internal server errorWhat it means
Something failed inside Anthropic's API (or your provider's) while handling the request. Claude Code had usually retried it several times already, and your prompt, settings and plan aren't the cause.
What to do
Check status.claude.com, wait a minute and send the message again (typing try again is enough). If it keeps failing with no incident posted, run /feedback.
A 500 means the request reached Anthropic's API and something broke on their side while it was being handled. It's the least informative status code there is, and the API's own label for it is api_error. In Claude Code 2.1.282 the line starts like this:
API Error: 500 Internal server error
and carries on with two more sentences: that it's "a server-side issue, usually temporary", with a suggestion to try again in a moment, and then a pointer to a status page. We read the binary to see how the line is put together and when Claude Code retries, and read the official error reference and the GitHub issues next to it.
How Claude Code builds the line
The formatter has one branch for every 5xx status except 529 (overload gets its own wording, covered on the 529 page). It takes the status code, pulls the message field out of the JSON body the API sent back, and glues them together after API Error:. On the Anthropic API that message is "Internal server error", which is how you get the line above. A 502 or 503 lands in the same branch, so the words after the number are whatever the server that answered put in its body.
The last sentence changes with how you're connected. On a normal setup it reads If it persists, check https://status.claude.com., and with a custom ANTHROPIC_BASE_URL it names your gateway's host instead. That second case matters. A 500 from a proxy you run is a 500 from the proxy, and Anthropic's status page can be green the whole time.
The old version of the same error
If you've searched this before you may have seen it looking rougher. Older releases printed the API's raw response body:
API Error: 500 {"type":"error","error":{"type":"api_error","message":"Internal server error"}}
That's the form in issue #3127, filed July 8, 2025 on Claude Code 1.0.44, which picked up 121 comments. The reply from an Anthropic contributor was short: "We had a brief increase in errors, this should be resolved now!" 765 issues in the repo quote that JSON shape as of September 25, 2026. It's the same failure; the newer releases just read the message out of the JSON for you.
What the retries already did
This is the part I didn't expect. By the time you read the line, Claude Code has usually tried the request several times. Its retry check returns yes for any status of 500 or above, with one exception: if the response carries an x-should-retry: false header, it stops at once. The official reference puts the budget at up to 10 attempts with exponential backoff, and CLAUDE_CODE_MAX_RETRIES changes it (capped at 15 unless CLAUDE_CODE_RETRY_WATCHDOG is set, which is meant for unattended runs).
There's a condition, though. Server errors only get retried if they arrive before any of Claude's answer has streamed. If one lands after Claude has already finished a block of text or a tool call, re-sending could run the same tools twice, so Claude Code keeps what arrived and prints a different line:
API Error: Server error mid-response. The response above may be incomplete.
That variant needs v2.1.199 or later. Before then a mid-stream 500 threw the partial output away and failed the whole turn.
What to do about it
Anthropic's error reference is blunt that a 500 "is not caused by your prompt, settings, or account". Its advice, in order:
- check status.claude.com, or the provider page the message names, for an incident;
- wait a minute and send the message again. The original prompt is still in the conversation, so typing
try againis enough; - if it keeps failing and nothing is posted, run
/feedbackso they get your request details.
The person who filed #3127 tried regenerating their API token first, and it didn't help. What did work was starting a new chat, while resuming the old one kept failing (they'd hit 0% context left just before it started, for what that's worth).
One report from September 3, 2026 (#91801, version 2.1.259) is odd enough to mention. The same prompt failed with a 500 four times running, and dropping the word "okay" from the front made it go through first time. A commenter pointed out the status page showed elevated errors that day, so it was probably coincidence. Still, if one exact message keeps failing, rewording it costs nothing.
How it differs from its neighbors
A 529 is overload across every user, and Claude Code suggests switching model for it. A 429 is a rate limit; if yours says Server is temporarily limiting requests (not your usage limit), that's a throttle of its own. A 504 or a timeout is covered on the request timed out page, and the plain API version of the 5xx family is on the Claude API 529 page.
Other lines the same feature prints
Match yours against these if the one at the top of the page is not quite it. They come from the same code and mean related things.
API Error: 500 {"type":"error","error":{"type":"api_error","message":"Internal server error"}}API Error: Server error mid-response. The response above may be incomplete.If it persists, check https://status.claude.com.