V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
commoccoom
V2EX  ›  Claude Code

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

  •  
  •   commoccoom · 1 天前 · 904 次点击

    使用 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

    7 条回复    2026-03-14 16:31:24 +08:00
    Leeeeex
        1
    Leeeeex  
    PRO
       1 天前
    就选 1 正常登录,我记得用第三方的时候就正常登录,然后还是可以走配置的 API 地址。
    commoccoom
        2
    commoccoom  
    OP
       1 天前
    @Leeeeex 现在试了又好了,我人傻了。。。
    leimu012
        3
    leimu012  
       1 天前
    可以用下载个 CC Switch ,配置第三方 api 比较方便
    hosea3000
        4
    hosea3000  
       1 天前
    @commoccoom CC Switch +1
    commoccoom
        5
    commoccoom  
    OP
       1 天前
    @hosea3000
    @leimu012

    好的,我试试 CC Switch
    v2er4241
        6
    v2er4241  
       1 天前
    看起来就是 API KEY 没有生效。
    apibox
        7
    apibox  
       7 小时 45 分钟前
    一般是网络有点问题,没加载完成。你可以试试直接用 VS Code 里面的 Claude Code 插件,和 cli 共用一份配置,但使用体验上更好一些。
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1677 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 16:16 · PVG 00:16 · LAX 09:16 · JFK 12:16
    ♥ Do have faith in what you're doing.