Unclear The maximum value is not stated.
What
API_TIMEOUT_MS is an environment variable that sets how long, in milliseconds, Claude Code waits for a request to the model. A value you set is now reduced to a fixed maximum when it is larger. Before, any value was used as given.
Why
Very large timeouts are no longer used as written. If you set a huge value, Claude Code will wait at most the maximum.
Names in the bundleAPI_TIMEOUT_MS
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Added since
A small documentation edit on Agent SDK reference - Python touched a line naming API_TIMEOUT_MS after this was published.
* `CLAUDE_CODE_MAX_RETRIES`: maximum API retries. Default `10`, capped at `15`. Each retry gets its own `API_TIMEOUT_MS` window.agent-sdk/python see the edit
Confirmed since
Anthropic's documentation has since written up API_TIMEOUT_MS, on Error reference.
| [`CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`](/docs/en/env-vars) | unset | Limit on re-sends of a [non-streaming request](#streaming-response-ended-before-any-complete-data-was-received) that times out. At the limit, the request fails. A …errors see the edit
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
The maximum value is not stated.
Anthropic's documentation agrees
Anthropic's documentation has since written up API_TIMEOUT_MS, on Error reference.