Brief
Claude Code 2.1.266 fixes gateway sign-in regression for API key setups
Claude Code v2.1.266 fixes a regression introduced in v2.1.265 that caused the undocumented CLAUDE_CODE_USE_GATEWAY environment variable to force Cloud-gateway sign-in even when used with an API key, apiKeyHelper, or custom auth headers. The variable is now ignored again unless both ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN are set.
Claude Code v2.1.266 fixes a regression from v2.1.265 that broke gateway and proxy setups. In 2.1.265, the undocumented CLAUDE_CODE_USE_GATEWAY environment variable started forcing Cloud-gateway sign-in on its own, even when used with an API key, apiKeyHelper, or custom auth headers. That caused every request to fail with 'Not signed in to the Cloud gateway'. Now the variable is ignored again unless both ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN are set. No configuration change is needed.
Source details and supporting facts
Each line is stated by the page named above it.
Stated by github.com
- v2.1.266 fixed a 2.1.265 regression affecting LLM-gateway and proxy setups.
- The undocumented CLAUDE_CODE_USE_GATEWAY environment variable, previously ignored unless ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN were both set, began forcing Cloud-gateway sign-in on its own in 2.1.265.
- Configurations that set it alongside an API key, apiKeyHelper, or custom auth headers failed every request with 'Not signed in to the Cloud gateway'.
- The variable on its own is ignored again; no configuration change is needed.
Sources
- Anthropic Claude Code release notes (GitHub)Text stored 15 September 2026
How this story was checked. Written from the 1 page listed above, stored 15 September 2026; claims checked against that stored text on 15 September 2026.
What that means
- 4 of 4 reported statements were confirmed against the page that carries them; the rest were removed rather than published.
- Figures in the text were required to appear in the stored source text: yes. Identifiers: yes.
- The check reads stored text only: no claim rests on a fresh look that did not happen.
- Where the reporting was silent, the text says so instead of filling the gap.