Claude Code is more careful with custom API endpoints and gateways
With a non-Anthropic ANTHROPIC_BASE_URL, the remote settings fetch withholds the API key; features it turns off are explained and gateway use is marked
What probably matters to youSection of the release
Unclear Which requests this applies to is not stated.
What
ANTHROPIC_BASE_URL sends Claude Code's requests to a different address, such as a company proxy or gateway. Several changes concern what happens when that address is not an Anthropic host.
The remote settings fetch no longer sends your API key when ANTHROPIC_BASE_URL is not an Anthropic host. It fails with "API key not sent: ANTHROPIC_BASE_URL is not an Anthropic host". Before, the key was always sent as x-api-key. A first-party TLS request path is also checked more strictly.
Some features that depend on remote settings are turned off by an API provider or a custom base URL. Claude Code now works out who set that: a machine administrator, the process environment, a launch flag, served settings or a settings file. It then tells you which source turned the feature off, or tells you to contact your administrator.
The attribution header can now end with cc_gateway=1; or cc_gateway=env; when a gateway is in use and the base URL is not a vouched Anthropic host.
Result messages gain an internal api_error_origin field. It is marked first_party only when an error came from api.anthropic.com over verified TLS, with no base URL override or gateway.
The SDK result schema, for both success and error, also gains an optional interrupted_by_shutdown field.
Why
If you route Claude Code through your own proxy, the remote settings fetch no longer hands that proxy your Anthropic API key. You also get a reason when a feature is off because of your endpoint. Programs built on the SDK can tell errors from Anthropic's own API apart from errors that passed through a proxy.
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 On a remote host without a browser: touched a line naming ANTHROPIC_BASE_URL after this was published.To override the key for a single invocation, pass [`--api-key-stdin`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/using#global-flags) and pipe the key to the command. To point at a different API host, set `ANTHROPIC_BASE_URL…cli-sdks-libraries/cli/authenticationsee the edit
Confirmed sinceAnthropic's documentation has since written up ANTHROPIC_BASE_URL, on Enterprise network configuration.| First-byte deadline | No response headers arrive after Claude Code sends the request | Direct Anthropic API and [Claude Platform on AWS](/docs/en/claude-platform-on-aws), including through an HTTPS proxy, but not when `ANTHROPIC_BASE_URL…network-configsee 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 doubtWhich requests this applies to is not stated.
Anthropic's documentation agreesAnthropic's documentation has since written up ANTHROPIC_BASE_URL, on Enterprise network configuration.
Anthropic's release notes agreeFixed sessions on a gateway-specific model name behind a custom ANTHROPIC_BASE_URL ending with "Prompt is too long · automatic compaction…