ANTHROPIC_AUTH_TOKEN
An environment variable for Claude Code used to store API authentication credentials; a third-party provider's API key can be entered here.
Timeline (last 90 days)
ANTHROPIC_AUTH_TOKEN sends authentication via the Authorization: Bearer header, ANTHROPIC_API_KEY sends it via the x-api-key header, and ANTHROPIC_API_KEY overrides subscription login and requires interactive confirmation.
If ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY are both set with different values, the manager rejects the request with a 401.
Meta's documentation defines three environment variables to point Claude Code at its API: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_MODEL, and requires setting the Opus, Sonnet, and Haiku aliases and the sub-agent model to the same ID to ensure no request falls back to a Claude model.
By setting environment variables such as ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_MODEL, Claude Code can be pointed at Meta's API, but only Muse Wonder is available, not Wonder Full.
Claude Code decides the domain to which requests are sent by reading the environment variable ANTHROPIC_BASE_URL, and performs authentication through ANTHROPIC_AUTH_TOKEN.
All Facts (5)
ANTHROPIC_AUTH_TOKEN sends authentication via the Authorization: Bearer header, ANTHROPIC_API_KEY sends it via the x-api-key header, and ANTHROPIC_API_KEY overrides subscription login and requires interactive confirmation.
50%UnverifiedIf ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY are both set with different values, the manager rejects the request with a 401.
50%UnverifiedBy setting environment variables such as ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_MODEL, Claude Code can be pointed at Meta's API, but only Muse Wonder is available, not Wonder Full.
50%UnverifiedMeta's documentation defines three environment variables to point Claude Code at its API: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_MODEL, and requires setting the Opus, Sonnet, and Haiku aliases and the sub-agent model to the same ID to ensure no request falls back to a Claude model.
50%UnverifiedClaude Code decides the domain to which requests are sent by reading the environment variable ANTHROPIC_BASE_URL, and performs authentication through ANTHROPIC_AUTH_TOKEN.
50%