New CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS env var configures the LLM gateway's model-discovery timeout
When Claude Code queries an LLM gateway's /v1/models endpoint to discover available models, it waits for a response before giving up. That wait time was previously fixed in code; it can now be set with the CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS environment variable, and still defaults to 3000ms (3 seconds) if unset. The failure log also now says explicitly when the request failed because of a timeout, rather than a generic failure.
Users running a slower or more distant LLM gateway can extend the timeout instead of hitting a discovery failure at the fixed default, and the clearer log message makes timeout-related discovery failures easier to diagnose.
* Added `CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS` to extend the LLM gateway `/v1/models` discovery timeout (default 3s)see the edit
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.
To give a slow gateway longer, set [`CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS`](/docs/en/env-vars#variables). The variable requires Claude Code v2.1.269 or later.llm-gateway-protocol see the edit
| `CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS` | Timeout in milliseconds for the [gateway model discovery](/docs/en/llm-gateway-protocol#model-discovery) request that `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` turns on (default: `300…env-vars see the edit
CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS on Claude Code changelog
Added CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS to extend the LLM gateway /v1/models discovery timeout (default 3s)
New in this build: CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS