GrepBoard/Manuals
605 manuals ·

Fix Claude Code "No response from API" (API_TIMEOUT_MS)

·Tested on Claude Code official docs · 2026-10·Test scope ↓·5 steps

Claude Code No response from API means response headers never arrived in time. Resend once; if it repeats, suspect a proxy and raise API_TIMEOUT_MS.

output
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.

Claude Code sent a streaming request, no response headers arrived within the first-byte deadline, and the retry fared the same. Once, just resend; if it repeats, suspect a proxy or gateway that holds responses until they complete and raise API_TIMEOUT_MS. The 3m and 10m in parentheses are how long the first attempt and the retry each waited.

Tell it apart from similar messages first.

MessageMeaning
No response from API (waited …)Response headers missed the first-byte deadline, retry included
Request timed outThe API didn't respond before the connection deadline (API_TIMEOUT_MS, 10 minutes by default). That deadline covers receiving response headers; it doesn't limit how long a stream runs after that
Waiting for API response · will retry in …No data on the response stream for a while (20 seconds direct; 45 seconds on v2.1.309+ through a gateway or a non-Anthropic ANTHROPIC_BASE_URL), still waiting; not a failure yet

[1] Send your message again. The original is still in the conversation, so for a long prompt you can type try again instead of pasting it again.

[2] If it comes back, check the network. The official docs say to treat a repeat as a network or proxy problem. Check that the machine reaches the API host.

console
$ curl -sS -o /dev/null -w "%{http_code} %{time_total}s\n" https://api.anthropic.com/

Calling the root without credentials normally returns 404 (around 404 0.05s in a 2026-10 test); whatever the code, a fast answer means the connection itself works. If this also hangs or fails, look at your company proxy, firewall, or HTTPS_PROXY value first. Proxy settings are covered in the connection-refused step of Fix common Claude Code errors by message.

[3] If a proxy or LLM gateway on the path collects the whole response before passing it on, give the retry more time. The retry waits one second less than API_TIMEOUT_MS, so raising this value lengthens the retry's wait. The default is 600000 (10 minutes).

console
$ export API_TIMEOUT_MS=1200000$ claude

To keep it, add it to the env block of a settings file.

~/.claude/settings.json
{  "env": {    "API_TIMEOUT_MS": "1200000"  }}

[4] If the first attempt always times out and the retry then succeeds, lengthen the first attempt's deadline too. CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS is how long the first attempt waits for the first response byte; it is clamped to between 10 seconds and 30 minutes and needs v2.1.242 or later. On Amazon Bedrock the retry uses the same deadline as the first attempt, so raise this variable there as well.

console
$ export CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS=600000

[5] For unattended CI jobs there is also CLAUDE_CODE_RETRY_WATCHDOG=1. With it set, Claude Code keeps re-sending within the retry budget instead of ending the turn with this error. On v2.1.199 or later it raises the default retries for transient errors such as server errors and timeouts to 300, roughly three hours of backoff, so use it for unattended runs rather than interactive sessions someone is watching.

If Request timed out appears every time and you have set API_TIMEOUT_MS=0, versions before v2.1.305 don't handle 0 correctly, so update or set a positive value.

#claude-code#timeout#proxy#api-error