API_TIMEOUT_MS
Updated by Alex Sorokoletov
API_TIMEOUT_MS is a Claude Code environment variable: Request timeout in milliseconds. Its release history is not tracked here. It is listed in the official reference.
| Status | Present in v2.1.294 |
|---|---|
| Category | Network and proxy |
| Official docs | Listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export API_TIMEOUT_MS=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"API_TIMEOUT_MS": "<value>"
}
}Release notes that mention it
- Claude Code v2.1.104 — 2 New Environment Variables: Enterprise TLS and SDK OAuth
- Claude Code Version Tracker: Undocumented Env Vars, Feature Gates & Models
- claude-code-env-vars-v2-1-245
Related variables
API_FORCE_IDLE_TIMEOUTBASH_DEFAULT_TIMEOUT_MSBASH_MAX_TIMEOUT_MSCLAUDE_AFK_TIMEOUT_MSCLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS: Default 600,000ms (10 minutes).CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MSCLAUDE_CODE_API_BASE_URL: Custom Claude Code API base URL for proxies.CLAUDE_CODE_CONNECT_TIMEOUT_MS
Frequently asked questions
What does API_TIMEOUT_MS do?
Request timeout in milliseconds
Which Claude Code version has API_TIMEOUT_MS?
Its release history is not tracked here.
How do I set API_TIMEOUT_MS?
Export it before starting Claude Code (export API_TIMEOUT_MS=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.
All variables, searchable: Claude Code environment variables.