Skip to content
AI Dev Toolkit.
Esc
  • Loading…

Claude Code · Certificates and network

Request timed out

Fix “Request timed out” in Claude Code: when to retry, how to raise API_TIMEOUT_MS for slow proxies, and what “No response from API” means.

Message

The exact error

Claude Code
Request timed out

Also appears as:

When the cause is your connection
Request timed out. Check your internet connection and proxy settings
No response headers at all (related)
API Error: No response from API (waited 3m, then 10m on the retry). If a proxy or gateway on your network holds responses until they complete, raise API_TIMEOUT_MS or CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS to wait longer.

Meaning

What does “Request timed out” mean in Claude Code?

Claude Code waits a set time for the API before giving up; the default request timeout is 10 minutes. When the message only says Request timed out, the API was slow, often during busy periods or while generating a very large reply. When it adds “Check your internet connection and proxy settings”, the delay was on your side of the connection. Either way, Claude Code has already retried: timeouts that arrive before any of the reply has streamed are retried up to 10 times with backoff before you see the error.

Causes

Why does Claude Code time out?

  • High load on the API
  • A very large response being generated
  • A slow, unstable or congested network, VPN or proxy
  • A proxy or gateway that holds the whole response until it is complete

Fix

How do I fix it and raise API_TIMEOUT_MS?

  1. Retry

    Send the message again. Your message is still in the conversation, so for a long prompt you can type try again.

  2. Give a slow proxy more time

    If your network or proxy is slow but working, raise API_TIMEOUT_MS (in milliseconds) before starting Claude Code, for example to 15 minutes:

    macOS / Linux
    export API_TIMEOUT_MS=900000
    claude
    Windows PowerShell
    $env:API_TIMEOUT_MS = '900000'
    claude
  3. Make the timeout permanent

    Put it in the env block of ~/.claude/settings.json so every session gets it, including background agents, which don’t reliably inherit your shell’s variables. On Windows you can instead set a user variable and open a new terminal. The settings.json builder writes the env block for you.

    ~/.claude/settings.json
    {
      "env": {
        "API_TIMEOUT_MS": "900000"
      }
    }
    Windows Command Prompt
    setx API_TIMEOUT_MS "900000"
  4. Check service status

    If it keeps happening on a healthy network, check status.claude.com for incidents.

Explained

Doesn’t Claude Code retry automatically?

Yes. Claude Code retries server errors, overloaded responses and request timeouts that arrive before any of Claude’s reply has streamed, up to 10 times with exponential backoff, and shows a Retrying in Ns · attempt x/y countdown while it does. CLAUDE_CODE_MAX_RETRIES changes the count. So when you see Request timed out, several attempts have already failed. For a fault inside the API instead, see API Error 500; for capacity problems, 529 Overloaded.

Explained

What does “Waiting for API response · will retry” mean?

If no data arrives on the response stream for 20 seconds while a request is still pending, the spinner shows Waiting for API response · will retry in … · check your network. The request hasn’t failed yet: the countdown runs to the point where Claude Code aborts the stalled connection and retries. The banner clears on its own when data resumes; if it comes back on every attempt, treat it as a connection problem.

Explained

What is “No response from API”?

API Error: No response from API (waited 3m, then 10m on the retry) means the API sent no response headers before the first-byte deadline, so Claude Code aborted the request instead of waiting the full API_TIMEOUT_MS, and the one retry went unanswered too. If a proxy or gateway on your network holds responses until they complete, raise API_TIMEOUT_MS so the retry waits longer. If only the first attempt times out and the retry then succeeds, raise CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS (v2.1.242 or later).

Explained

How do I keep long unattended runs alive?

In CI or overnight jobs, set CLAUDE_CODE_RETRY_WATCHDOG=1. On v2.1.199 or later it raises the default retry count for timeouts, server errors and dropped connections to 300, roughly three hours of backoff, and keeps retrying 429 and 529 capacity errors instead of failing. It still fails at once on a spend limit or exhausted usage credits.

FAQ

Questions people ask

What is the default timeout in Claude Code?

API_TIMEOUT_MS defaults to 600000 milliseconds, which is 10 minutes per request. Raise it only when a slow network, proxy or gateway is the cause, for example to 900000 for 15 minutes. It also caps how long Claude Code waits for response headers, which matters for the “No response from API” error.

How do I set API_TIMEOUT_MS permanently?

Add it to the env block of ~/.claude/settings.json so every session gets it, or on Windows run setx API_TIMEOUT_MS "900000" and open a new terminal, as Anthropic’s environment variable docs show. On macOS and Linux, you can also export it in your shell profile, such as ~/.zshrc or ~/.bashrc.

Does “Request timed out” mean my internet is down?

Not necessarily. Plain “Request timed out” usually means the API was slow, during heavy load or while writing a very long reply. If the message adds “Check your internet connection and proxy settings”, the delay was on your side. If “No response from API” keeps repeating, Anthropic suggests treating it as a network or proxy problem.

Related

Search all Claude Code errors

Keep exploring