Skip to content

ERR_BAD_REQUEST api.anthropic.com Claude Code

Quick fix

Turn on "skip the first-install confirmation" in cc-switch and clear the conflicting environment variables to resolve the Claude Code ERR_BAD_REQUEST.

Error output
Unable to connect to Anthropic services. Failed to connect to api.anthropic.com: ERR_BAD_REQUEST.

Configuring cc-switch to run Claude Code on Windows, a request to api.anthropic.com can error with ERR_BAD_REQUEST because the first-install confirmation flow intercepts it, or because of leftover environment variables (ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL). Maintainers note that the latest cc-switch resolved this by adding a "skip the first-install confirmation" feature.

  1. Update cc-switch to the latest version for the built-in fix.

  2. In the cc-switch interface, find and turn on the "skip the first-install confirmation" option.

  3. Check and unset the ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL system environment variables to prevent a configuration conflict.

ToolClaude Code
VersionUnknown
PlatformsWindows
Is this error caused by my using a relay, or by the official Claude?
The error is usually unrelated to relay or official API — it comes from the cc-switch first-install confirmation interception or a local environment variable conflict. Follow the steps above to turn on skip-confirmation and clear the environment variables.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.