Preflight Checklist
What's Wrong?
We are using LiteLLM and a locally installed Claude Code binary.
We noticed that new users are now getting the following error when they try to run claude code.
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com: ERR_BAD_REQUEST
Please check your internet connection and network settings.
Note: Claude Code might not be available in your country. Check supported countries at https://anthropic.com/supported-countries
api.anthropic.com is blocked by our proxy which is not an issue because our ANTHROPIC_BASE_URL points to a local LiteLLM. But these users cannot continue until we manually add "hasCompletedOnboarding": true to their ~/claude.json.
Reaching out to the anthropic API should not be a requirement for starting Claude Code. At some point CC set "hasCompletedOnboarding": true automatically when users were using LiteLLM or it checked the user's key against the correct ANTHROPIC_BASE_URL.
This seems to be a regression that happened in the past month or so. I am not sure when.
What Should Happen?
When users start CC for the first time the API key check should use the ANTHROPIC_BASE_URL and not api.anthropic.com
Error Messages/Logs
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com: ERR_BAD_REQUEST
Please check your internet connection and network settings.
Note: Claude Code might not be available in your country. Check supported countries at https://anthropic.com/supported-countries
Steps to Reproduce
remove "hasCompletedOnboarding": true from ~/claude.json and start up claude code with an ANTHROPIC_BASE_URL that is not api.anthropic.com.
Claude code will try to connect to api.anthropic.com.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.1.47 (Claude Code)
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
i tried 2.1.22 and it was still broken then.
Preflight Checklist
What's Wrong?
We are using LiteLLM and a locally installed Claude Code binary.
We noticed that new users are now getting the following error when they try to run claude code.
api.anthropic.com is blocked by our proxy which is not an issue because our ANTHROPIC_BASE_URL points to a local LiteLLM. But these users cannot continue until we manually add
"hasCompletedOnboarding": trueto their ~/claude.json.Reaching out to the anthropic API should not be a requirement for starting Claude Code. At some point CC set "hasCompletedOnboarding": true automatically when users were using LiteLLM or it checked the user's key against the correct ANTHROPIC_BASE_URL.
This seems to be a regression that happened in the past month or so. I am not sure when.
What Should Happen?
When users start CC for the first time the API key check should use the ANTHROPIC_BASE_URL and not api.anthropic.com
Error Messages/Logs
Unable to connect to Anthropic services Failed to connect to api.anthropic.com: ERR_BAD_REQUEST Please check your internet connection and network settings. Note: Claude Code might not be available in your country. Check supported countries at https://anthropic.com/supported-countriesSteps to Reproduce
remove
"hasCompletedOnboarding": truefrom ~/claude.json and start up claude code with an ANTHROPIC_BASE_URL that is not api.anthropic.com.Claude code will try to connect to api.anthropic.com.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.1.47 (Claude Code)
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
i tried 2.1.22 and it was still broken then.