安装 Claude Code 后无法配置第三方 API

3 月 13 日
 commoccoom

使用 irm https://claude.ai/install.ps1 | iex 安装后,在 ~/.bashrc 配置 API

export ANTHROPIC_BASE_URL="https://api.poe.com"
export ANTHROPIC_AUTH_TOKEN="$POE_API_KEY"
export ANTHROPIC_API_KEY="" # Important: Must be explicitly empty

但是启动 Claude Code 后只能 3 个选项

 Claude Code can be used with your Claude subscription or billed based on API usage through your Console
  account.

 Select login method:

   1. Claude account with subscription · Pro, Max, Team, or Enterprise

   2. Anthropic Console account · API usage billing

 > 3. 3rd-party platform · Amazon Bedrock, Microsoft Foundry, or Vertex AI

选 1 ,2 需要登录 Anthropic

选 3 后

Using 3rd-party platforms

 Claude Code supports Amazon Bedrock, Microsoft Foundry, and Vertex AI. Set the required environment
 variables, then restart Claude Code.

 If you are part of an enterprise organization, contact your administrator for setup instructions.


 Documentation:
 · Amazon Bedrock: https://code.claude.com/docs/en/amazon-bedrock
 · Microsoft Foundry: https://code.claude.com/docs/en/microsoft-foundry
 · Vertex AI: https://code.claude.com/docs/en/google-vertex-ai


 Press Enter to go back to login options.

Claude Code v2.1.74

2954 次点击
所在节点    Claude Code
7 条回复
Leeeeex
3 月 13 日
就选 1 正常登录,我记得用第三方的时候就正常登录,然后还是可以走配置的 API 地址。
commoccoom
3 月 13 日
@Leeeeex 现在试了又好了,我人傻了。。。
leimu012
3 月 13 日
可以用下载个 CC Switch ,配置第三方 api 比较方便
hosea3000
3 月 13 日
@commoccoom CC Switch +1
commoccoom
3 月 13 日
@hosea3000
@leimu012

好的,我试试 CC Switch
v2er4241
3 月 13 日
看起来就是 API KEY 没有生效。
apibox
3 月 14 日
一般是网络有点问题,没加载完成。你可以试试直接用 VS Code 里面的 Claude Code 插件,和 cli 共用一份配置,但使用体验上更好一些。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1197932

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX