{"name":"API_TIMEOUT_MS","slug":"api-timeout-ms","family":"env","title":"Environment variables","noun":"environment variable","description":"Timeout for API requests in milliseconds (default: 600000, or 10 minutes; maximum: 2147483647). Increase this when requests time out on slow networks or when routing through a proxy. Values above the maximum overflow the underlying timer and cause requests to fail immediately","description_source":"docs","described_by":{"doc":"claude-code\/env-vars","title":"Environment variables"},"presence":{"first_seen":"2.1.138","removed_in":null,"in_current_build":true,"newest_mined":"2.1.308","builds":149,"mined_builds":149,"first_cited":{"version":"2.1.261","released_at":"2026-09-04 17:49:34","spans":3}},"aliases":[],"entries":[{"version":"2.1.305","anchor":"api-timeout-ms-error-hint-now-read-from-the-settings-env-sh","heading":"Timeout hint now notices API_TIMEOUT_MS set in settings","line":"The hint to raise API_TIMEOUT_MS after a timeout now uses the value from settings too, and only appears when it is above zero","released_at":"2026-10-20 19:29:36","reason":"found in this entry's text, named in this entry"},{"version":"2.1.295","anchor":"stream-idle-and-api-timeouts-can-come-from-a-server-side-con","heading":"Stream and request timeouts can now come from a received configuration","line":"If you leave the timeout variables unset, Claude Code can now take stream-idle and request timeouts from a received configuration","released_at":"2026-10-08 18:22:58","reason":"found in this entry's text"},{"version":"2.1.295","anchor":"cloud-gateway-body-idle-timeout-and-api-timeout-ms-parsing-r","heading":"A received configuration can now set a body idle timeout for API requests","line":"A received configuration can now switch a body idle timeout for API requests; `API_TIMEOUT_MS` still defaults to 600000","released_at":"2026-10-08 18:22:58","reason":"found in this entry's text"},{"version":"2.1.295","anchor":"network-error-messages-shortened-under-a-condition","heading":"Shorter network error messages in some situations","line":"In some situations, connection and timeout errors now drop the hints about sleep, proxies and raising `API_TIMEOUT_MS`","released_at":"2026-10-08 18:22:58","reason":"found in this entry's text"},{"version":"2.1.285","anchor":"api-timeout-ms-is-now-capped","heading":"Very large API_TIMEOUT_MS values are now capped","line":"A value you set for `API_TIMEOUT_MS` is now held to a maximum instead of being used however large it is","released_at":"2026-09-29 17:32:09","reason":"found in this entry's text, named in this entry"},{"version":"2.1.261","anchor":"more-detailed-stream-timeout-error-message-with-tunable-env","heading":"More detailed stream-timeout error message with tunable env vars","line":"Stream-timeout errors now suggest raising API_TIMEOUT_MS or CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS.","released_at":"2026-09-04 17:49:34","reason":"found in this entry's text, named in this entry"},{"version":"2.1.242","anchor":"api-requests-that-never-send-response-headers-are-now-aborte","heading":"API requests that never send response headers are now aborted","line":"Hung requests are aborted when headers never arrive, and you can tune the window.","released_at":"2026-08-24 19:16:14","reason":"named in this entry, found in this entry's text"},{"version":"1.0.93","anchor":"simplified-timeout-messages","heading":"Simplified Timeout Messages","line":null,"released_at":"2025-08-26 22:22:24","reason":"found in this entry's text"},{"version":"1.0.89","anchor":"improved-timeout-error-messages","heading":"Improved Timeout Error Messages","line":null,"released_at":"2025-08-22 22:24:06","reason":"found in this entry's text"},{"version":"0.2.56","anchor":"new-features","heading":"New Features","line":null,"released_at":"2025-03-27 22:25:37","reason":"found in this entry's text"}],"entries_total":10,"docs":[{"source":"claude-code","path":"env-vars","title":"Environment variables","documented":true},{"source":"claude-code","path":"agent-sdk\/python","title":"Agent SDK reference - Python","documented":false},{"source":"claude-code","path":"agent-sdk\/typescript","title":"Agent SDK reference - TypeScript","documented":false},{"source":"claude-code","path":"claude-apps-gateway-deploy","title":"Claude apps gateway deployment and operations","documented":false},{"source":"claude-code","path":"desktop","title":"Desktop application","documented":false},{"source":"claude-code","path":"errors","title":"Error reference","documented":false},{"source":"claude-code","path":"network-config","title":"Enterprise network configuration","documented":false}],"docs_total":7,"gates":[],"related":[{"name":"API_FORCE_IDLE_TIMEOUT","slug":"api-force-idle-timeout","description":"Override the 5-minute body idle timeout that aborts a streaming model response when no bytes arrive. Set to `0` to turn the timeout off, for example when a slow [gateway](\/docs\/en\/llm-gateway) or local model pauses longer than 5 minutes between chunks, or `1` to keep it on for every provider. When unset, the timeout is active on providers other than the direct Anthropic API and [Claude Platform on AWS](\/docs\/en\/claude-platform-on-aws). The [stream watchdogs](\/docs\/en\/network-config#streaming-idle-watchdogs) run independently of it and abort a long silent pause even when you set `0` here"},{"name":"API_MAX_INPUT_TOKENS","slug":"api-max-input-tokens","description":null},{"name":"API_TARGET_INPUT_TOKENS","slug":"api-target-input-tokens","description":null},{"name":"API_TOKEN","slug":"api-token","description":null}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/api-timeout-ms","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}