Troubleshooting
Diagnostic Commands
Run Diagnostic Check
bash
claude /doctorCheck Environment Variables
bash
# macOS / Linux
echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKEN
# Windows PowerShell
echo $env:ANTHROPIC_BASE_URL
echo $env:ANTHROPIC_AUTH_TOKENCommon Errors and Solutions
| Error Message | Possible Cause | Solution |
|---|---|---|
| API key is invalid | ① Key entered incorrectly (extra spaces) ② Key expired or reset ③ Wrong environment variable name | Check for extra spaces in the key; confirm the key is valid; ensure the variable name is ANTHROPIC_AUTH_TOKEN |
| Connection refused / Network error | ① ANTHROPIC_BASE_URL set incorrectly② Firewall blocking connection ③ Proxy settings conflict | Check BASE_URL config; review firewall rules; check proxy settings |
| Insufficient quota | Quota depleted | Log in to the admin dashboard to check quota and top up |
| Command not found: claude | Command not found | Re-run the installation command, or reopen the terminal |
| Model not found | Incorrect model name | Check the model name and ensure it's enabled in the dashboard |
API Connection Test
Test API connection with curl:
bash
curl https://anyapi.pro/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"If a model list is returned, the connection is working.
Get More Help
- Official Documentation: Claude Code official docs include more advanced usage → Anthropic Docs
- Contact Administrator: If the above methods don't resolve your issue, contact the administrator
