[KongchangAI]
ConceptBase URL环境变量

ANTHROPIC_BASE_URL

An environment variable for Claude Code used to specify the target domain to which API requests are sent, supporting access through third-party compatible providers.

Core Facts

Timeline (last 90 days)

Oct 14

For streaming requests via a custom ANTHROPIC_BASE_URL, if no data arrives within 180 seconds the request is aborted; this is now extended to 300 seconds.

Unverified50%
Oct 13

For users in China, a common practice is to configure a proxy or use a third-party gateway compatible with the Anthropic API, and point to the alternative endpoint via environment variables such as ANTHROPIC_BASE_URL.

Unverified50%
Oct 13

Claude Code can point to localhost by setting the ANTHROPIC_BASE_URL environment variable, communicating with local models without a proxy translation layer.

Unverified50%
Oct 12

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.

Unverified50%
Oct 12

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.

Unverified50%
Oct 12

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.

Unverified50%
Oct 6

ANTHROPIC_BASE_URL specifies the API gateway address, used to forward requests originally destined for Anthropic to the chosen platform.

Unverified50%
Sep 18

In v2.1.275, users who forward requests to third-party proxies or enterprise internal gateways via a custom ANTHROPIC_BASE_URL experience a 100% request failure rate.

Unverified50%
Sep 18

v2.1.276 fixes an issue where every request would fail with a 400 error (Input tag 'advisor_20260301') when ANTHROPIC_BASE_URL pointed to a proxy or gateway.

Unverified50%
Sep 11

Previously, telemetry and metrics requests sent to Anthropic carried the API key configured for third-party gateways (ANTHROPIC_BASE_URL); this version fixes the issue so that credentials are only sent to their corresponding host

Unverified50%

All Facts (11)

Verified

Claude Code uses the environment variables ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY to determine the API endpoint and authentication information.

80%
Unverified

For streaming requests via a custom ANTHROPIC_BASE_URL, if no data arrives within 180 seconds the request is aborted; this is now extended to 300 seconds.

50%
Unverified

For users in China, a common practice is to configure a proxy or use a third-party gateway compatible with the Anthropic API, and point to the alternative endpoint via environment variables such as ANTHROPIC_BASE_URL.

50%
Unverified

Claude Code can point to localhost by setting the ANTHROPIC_BASE_URL environment variable, communicating with local models without a proxy translation layer.

50%
Unverified

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.

50%
Unverified

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.

50%
Unverified

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.

50%
Unverified

ANTHROPIC_BASE_URL specifies the API gateway address, used to forward requests originally destined for Anthropic to the chosen platform.

50%
Unverified

v2.1.276 fixes an issue where every request would fail with a 400 error (Input tag 'advisor_20260301') when ANTHROPIC_BASE_URL pointed to a proxy or gateway.

50%
Unverified

In v2.1.275, users who forward requests to third-party proxies or enterprise internal gateways via a custom ANTHROPIC_BASE_URL experience a 100% request failure rate.

50%
Unverified

Previously, telemetry and metrics requests sent to Anthropic carried the API key configured for third-party gateways (ANTHROPIC_BASE_URL); this version fixes the issue so that credentials are only sent to their corresponding host

50%

Source Articles