windows以下命令生成中转配置:

New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude" | Out-Null; @'{  "env": {    "ANTHROPIC_AUTH_TOKEN": "密钥",    "ANTHROPIC_BASE_URL": "中转服务网址",    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1  },  "permissions": {    "allow": [],    "deny": []  }}'@ | Set-Content "$env:USERPROFILE\.claude\settings.json" -Encoding UTF8

上面配置完,命令行启动claude发现不行,提示:

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

看样子还是连接的官方服务。
找到C:\Users\你的用户名\.claude.json,添加下面的这个配置即可解决:

 "hasCompletedOnboarding": true