You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
1Signal: worth watching, 1 to 5
AuthArea: what it touches
ImprovementsKind: in v2.1.326,
ImprovementsSection of the release
Unclear It is not clear what following the key does in practice, for example whether changing ANTHROPIC_API_KEY during a session is picked up.
What
When a session starts, Claude Code now makes its API key check follow the key set in the ANTHROPIC_API_KEY environment variable. An environment variable is a value set in your shell before Claude Code runs. The information Claude Code reports about a running session now also includes the Claude Code version.
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 sinceA small documentation edit on Best practices for Claude Code touched a line naming ANTHROPIC_API_KEY after this was published.* [`--bare`](https://code.claude.com/docs/en/headless#start-faster-with-bare-mode) skips your hooks, skills, plugins, MCP servers, and `CLAUDE.md` files from the repo and your home directory. It also doesn't use your claude.ai login: auth …best-practicessee the edit
Confirmed sinceAnthropic's documentation has since written up ANTHROPIC_API_KEY, on Beta.-H "Authorization: Bearer $ANTHROPIC_API_KEY" \api/betasee the edit
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtIt is not clear what following the key does in practice, for example whether changing `ANTHROPIC_API_KEY` during a session is picked up.
Anthropic's documentation agreesAnthropic's documentation has since written up ANTHROPIC_API_KEY, on Beta.
Anthropic's release notes agreeFixed /login ending on "Login successful" while an approved ANTHROPIC_API_KEY was still used; it now says requests still use the key