Claude Code errors: fixing 529 Overloaded, 429, Prompt is too long, and connection errors
What Claude Code's 529 Overloaded, 429 rate limit, Credit balance is too low, Prompt is too long and connection errors mean, and how to keep working.


Quick lookup by error message
Most runtime errors in Claude Code fall into four buckets: Anthropic server load (529 / 500), rate limits or billing (429 / Credit balance is too low), a full context window (Prompt is too long), or a proxy dropping the connection (Socket is closed / ECONNRESET). Check the exact line printed in your terminal below.
| What you see | Cause | First fix |
|---|---|---|
| API Error: Repeated 529 Overloaded errors | Model capacity full across all users (not your quota) | Run /model to switch models, or wait and check status.claude.com |
| API Error: 500 Internal server error | Temporary server-side failure (or gateway 502/504) | Retry in a moment; check status.claude.com or your gateway |
| Request rejected (429) | API key, Bedrock, or Google Cloud rate limit | Run /status to check active auth; wait or raise tier limit |
| Credit balance is too low | Console balance is empty, or an old ANTHROPIC_API_KEY is overriding your plan | Check /status; unset ANTHROPIC_API_KEY if on a plan, or add funds in Console |
| Prompt is too long | Conversation and attached files exceed context window | Run /compact to summarize history, or /clear to start fresh |
| Socket is closed / Unable to connect to API | Proxy, firewall, VPN or DNS dropped the connection | Run claude update (v2.1.214+ retries closed sockets) and check proxy settings |
529 Overloaded and 500 server errors
API Error: Repeated 529 Overloaded errors means the API is temporarily at capacity across all users. Claude Code already retried several times before printing it. A 529 is not your personal usage limit and does not count against your quota.
- Switch models with
/model: Anthropic tracks capacity per model, so when Opus is under heavy load, switching to Sonnet (or another available model) often lets you keep working right away. - Check the status URL named in the message: direct Anthropic traffic points to
status.claude.com; Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, and customANTHROPIC_BASE_URLgateways name their own status host. - For
API Error: 500(orAPI Error: 502 Bad Gatewayfrom a proxy/gateway): the failure is inside the API or proxy, not in your prompt or account. Wait a moment and retry.
429 rate limits and “Credit balance is too low”
- Server is temporarily limiting requests
- A server-side throttle, not your subscription limit (Claude Code tells them apart by checking for unified quota headers). From v2.1.199, Claude Code retries this automatically with backoff across all sign-in types; if it persists, wait briefly and check
status.claude.com. - Request rejected (429)
- Your API key, Amazon Bedrock project, or Google Cloud project hit its configured rate limit (or a proxy/gateway in between returned its own 429). Run
/statusfirst to make sure a strayANTHROPIC_API_KEYisn't hijacking a subscription. - Credit balance is too low
- Your Claude Console prepaid balance is empty — or you have a Pro, Max, Ultra, Team or Enterprise plan, but an approved
ANTHROPIC_API_KEYin your shell is routing requests through Console instead. Run/status, check theAPI keyrow, and eitherunset ANTHROPIC_API_KEY(and remove it from your shell profile) or top up atplatform.claude.com/settings/billing.
Article · Claude Code usage limits: what the messages mean, and how to keep working → Hit “You've hit your session limit” or weekly limit instead? How those limits work.
“Prompt is too long” / “Context limit reached”
This appears when the conversation history plus files read into the session exceed the model's context window. In an interactive terminal session, Claude Code displays Context limit reached · /compact or /clear to continue; in non-interactive (-p) output and transcripts, it prints Prompt is too long.
- Run
/compactto summarize earlier turns and free space while keeping the current task. - Run
/clearif you are moving to a new task — starting fresh also cuts token spend. - Check
/config› Auto-compact: if you turnedautoCompactEnabledoff, Claude Code reminds you in the error line. IfDISABLE_COMPACTis set in your environment, only/clearis offered.
Connection, timeout and proxy errors
- Unable to connect to API
- The TCP connection never completed. The code in parentheses tells you where it broke:
ConnectionRefused/ECONNREFUSED(firewall or proxy blocking),ENOTFOUND(DNS or offline),EHOSTUNREACH(network route or VPN),ERR_PROXY_TUNNEL(proxy rejected the tunnel or credentials), orECONNRESET(connection dropped mid-flight). - Socket is closed
- The streaming connection closed while a reply was still arriving — most commonly behind a corporate proxy on Windows. Versions before v2.1.214 stopped the turn immediately; run
claude updateto v2.1.214 or later so Claude Code retries automatically, and check proxy settings if it keeps happening. - Request timed out
- The default request timeout is 10 minutes. Setting
API_TIMEOUT_MS=0turns off that overall cap, though first-byte and streaming idle watchdogs still apply (and versions before v2.1.305 failed immediately whenAPI_TIMEOUT_MSwas0— update or set a positive millisecond value). - Streaming response ended before any complete data was received
- A proxy or gateway buffered or modified the streaming response so no usable chunks arrived, and Claude Code retried without streaming (which sends the request twice). Configure your proxy or gateway to pass streaming response bodies and headers through unmodified.
Keep working in Mirasim when one provider is down
When Anthropic is returning repeated 529s or a single account hits its limit, you don't have to stop and re-explain the task in another terminal.
- Switch agent in the same pane: move the session from Claude Code to Codex, Kimi Code, DeepSeek Harness or another installed agent — Mirasim carries the conversation over so the work picks up where it left off.
- Switch account or credit source: keep multiple saved sign-ins with live quota status (under Settings › Agents), or switch a session to your own API key or Mirasim credit without editing shell profiles.
Chapter 16 · Models, accounts and quota › Several accounts, and live quota → Saved accounts, live quota, and switching models per session in Mirasim.
Questions
- Does a 529 Overloaded error use my Claude quota?
- No. Anthropic states that a 529 is a server-capacity error, not your usage limit, and doesn't count against your quota.
- Why do I get “Credit balance is too low” when I pay for Claude Pro or Max?
- An approved
ANTHROPIC_API_KEYin your shell takes priority over a subscription login. Run/statusto confirm, thenunset ANTHROPIC_API_KEY, remove it from your shell profile, and restartclaude. - How do I fix “Prompt is too long” without losing my progress?
- Run
/compactinside the session to summarize older turns into a shorter context. If auto-compact was turned off, re-enable it in/config.
Article · Using an API key with Claude Code and Codex: setup, custom endpoints, and switching back → Using an API key or custom gateway with Claude Code and Codex, and fixing 401/403/429.
Article · Claude Code login: how to sign in, switch accounts, and fix login problems → Fixing Claude Code login and OAuth errors.
Article · Codex “stream disconnected before completion”: what it means and how to fix it → Hit a disconnect in Codex instead? Fixing “stream disconnected before completion”.
Article · Cutting Claude Code and Codex token usage: /context, /compact, prompt caching, and model routing → Cutting token spend with /context, /compact, /clear, prompt caching and subagents.
Article · Configuring Claude Code and Codex behind a proxy, firewall, or custom CA certificate → Configuring HTTPS_PROXY, NO_PROXY and custom CA certificates for Claude Code and Codex.
Article · Fixing OpenAI and Codex 403 “unsupported_country_region_territory” → Hit OpenAI / Codex 403 unsupported_country_region_territory? False-positive checks and alternatives.
Sources
Checked on November 29, 2026 against Anthropic's Claude Code errors reference at code.claude.com/docs/en/errors. Version thresholds and messages change as Claude Code updates; check that page and status.claude.com for the latest.
Keep reading

Fixing OpenAI and Codex 403 “unsupported_country_region_territory”
Why OpenAI and Codex return 403 unsupported_country_region_territory, how to fix false positives on VPNs or cloud IPs, and compliant alternatives.

Running Claude Code and Codex on Amazon Bedrock, Vertex AI, and Microsoft Foundry
Connect Claude Code and Codex to Amazon Bedrock, Vertex AI, and Microsoft Foundry: env vars, config.toml, auth, model pinning, and limits.

Using Claude Code with Chrome and Codex Browser: live debugging, Playwright, and previews
How to connect Claude Code to Chrome (extension, console logs, login limits) and use Codex Browser or Playwright, plus live dev-server previews in Mirasim.