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.
Core Facts
Timeline (last 90 days)
The key parameters for switching providers generally include ANTHROPIC_BASE_URL (API endpoint) and ANTHROPIC_AUTH_TOKEN (or API Key) in env, as well as the model field specifying the default model.
The ANTHROPIC_AUTH_TOKEN environment variable is the authentication token sent with requests; local Ollama does not verify a real key, so any placeholder value works.
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 (8)
Claude Code uses the environment variables ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY to determine the API endpoint and authentication information.
80%UnverifiedThe key parameters for switching providers generally include ANTHROPIC_BASE_URL (API endpoint) and ANTHROPIC_AUTH_TOKEN (or API Key) in env, as well as the model field specifying the default model.
50%UnverifiedThe ANTHROPIC_AUTH_TOKEN environment variable is the authentication token sent with requests; local Ollama does not verify a real key, so any placeholder value works.
50%UnverifiedANTHROPIC_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%