Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Claude Code error

Claude Code: API Error: 500 Internal server error

Error message
API Error: 500 Internal server error. This is a server-side issue, usually temporary

Status: WorkaroundLast verified 3 documented fixes4 sources

What it means

The Claude API (or the provider behind your endpoint) returned a 5xx response. Per the official error reference, a 5xx from the API indicates an unexpected failure inside the API and is not caused by your prompt, settings, or account. Older versions printed the raw JSON form: API Error: 500 {"type":"error","error":{"type":"api_error","message":"Internal server error"}}.

Causes

  • An unexpected failure inside the API or the inference provider (Anthropic API, Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or a custom gateway)
  • A proxy, load balancer, or gateway answering with an HTML error page, shown as for example API Error: 502 Bad Gateway
  • Short-lived service incidents: on issue #3127 an Anthropic contributor replied "We had a brief increase in errors, this should be resolved now!" and closed it

How to fix it

  1. Fix 1.

    Check status.claude.com, or the provider status page named in the message, for active incidents.

  2. Fix 2.

    Wait a minute, then send your message again. Your original message is still in the conversation, so for a long prompt you can type try again instead of pasting it again.

    Snippet
    try again
  3. Fix 3.

    If the error persists with no posted incident, run /feedback so Anthropic can investigate with your request details.

    Slash command
    /feedback

More Claude Code errors

All 18 Claude Code errors

FAQ

What does "API Error: 500 Internal server error" mean in Claude Code?

The Claude API (or the provider behind your endpoint) returned a 5xx response. Per the official error reference, a 5xx from the API indicates an unexpected failure inside the API and is not caused by your prompt, settings, or account. Older versions printed the raw JSON form: API Error: 500 {"type":"error","error":{"type":"api_error","message":"Internal server error"}}.

How do I fix "API Error: 500 Internal server error"?

There are 3 documented fixes. Start with the first: Check status.claude.com, or the provider status page named in the message, for active incidents.

Is this Claude Code error fixed?

Status: Workaround. No release removes the cause. The documented fixes work around it. Affected versions: All versions (server-side). Before v2.1.281 the status code was dropped when a proxy HTML error page had a title. v2.1.108 added a status.claude.com link to 5xx/529 errors.

Sources

Last verified against 4 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.