The exact messages
API Error: 500 {"type":"error","error":{"type":"api_error","message":"Internal server error"}}
API Error: 500 {"type":"error","error":{"type":"api_error","message":"Internal server error"},"request_id":null}
[Bug] Anthropic API Error: 500 Internal Server Error
All three are the same failure. The first two are what the CLI prints; the third is the title of the auto-generated bug reports that Claude Code files through /bug, which is why the tracker has hundreds of identical ones — the most recent in this batch were filed on September 16 and September 22, 2026, the latter reporting 500s and 529s together.
Why it happens
- Upstream incident. The most common cause by far. When Anthropic has a partial outage, every user of a model sees 500s at the same time — the January 2026 wave in #9066 was answered by Anthropic staff with a single link: the status page.
- One model degraded, others fine. 500s are frequently per-model. In #3127 the top-voted fix was simply switching from Opus to Sonnet; the same session then worked.
- Context exhausted, compaction failed. The original #3127 report hit the 500 "when the remaining context left is at exactly 0% and Claude Code has failed to auto-compact". An oversized request can surface as a 500 instead of the cleaner
Prompt is too long400. - A specific request shape the backend chokes on. Rarer; #91801 reproduced 500s tied to certain prompt prefixes. If one message reliably 500s and others don't, change that message.
Fixes, in the order to try them
- 1. Look at status.claude.com. If there's an incident, nothing on your side will help — wait it out.
- 2. Resume, don't restart:
claude -ccontinues the last session; the half-finished turn is retried. - 3. Switch tier for the current task:
/model→ Sonnet if you were on Opus/Fable, or the reverse. Capacity and failures are per model. - 4. If the context meter was near 0%:
/compact(or/clearand re-brief), then continue. Moving to a(1M)model variant also works. - 5. Update:
claude update. Several 500-adjacent bugs have been fixed client-side over time. - 6. Still failing on one specific message? Rephrase or split it — a request-shape 500 is deterministic.
claude -c # resume the session
/model claude-sonnet-5 # inside the session: another tier
/compact # if the context was exhausted
claude update # latest CLI
500 vs 529 vs 429
- 500 — the server failed. Retry, switch model, check status.
- 529 — the server is up but at capacity (
overloaded_error). See the overloaded guide. - 429 — *you* exceeded a limit. See rate limits.
- 400 — the request itself was rejected. See API Error 400.
Why gateways see fewer of them
A 500 from one upstream account is a single point of failure only if you have one upstream account. This gateway pools several and fails a request over to another when one returns 500 or 529, so most transient 500s never reach your terminal. A real, provider-wide incident still does — nobody can route around the model being down. Point Claude Code at it with ANTHROPIC_BASE_URL=https://aiprimetech.io and a gateway key.
Frequently asked questions
What does Claude Code API Error 500 mean?
The Claude API failed internally while answering ({"type":"api_error","message":"Internal server error"}). It is a server-side error, not a problem with your key or configuration.
How do I fix API Error: 500 in Claude Code?
Check status.claude.com, resume with claude -c, switch model tier with /model, and /compact if the context was nearly full. Update with claude update if it persists.
Why do I keep getting 500 errors from Claude?
Usually an ongoing upstream incident or a degraded model. If only one message triggers it every time, the request itself is the problem — rephrase or split it.
Is Claude down when I get error 500?
Often, yes — at least one model is. The status page and the GitHub issue tracker both light up within minutes during an incident.
Run Claude Code on the gateway
Same models, two environment variables, credits at 7.69× face value — or a flat-rate unlimited plan.
Get an API key See unlimited plansAI Prime Tech is an independent API gateway and is not affiliated with, endorsed by, or sponsored by Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic. Claude Code features described here follow Anthropic’s public documentation at the time of writing and change frequently; prices and model lists on this page are read from this gateway’s live settings.