爱意满满的作品展示区。
sofarsofunny1

claude code 一键使用自己的 open ai 站点 key

  •  
  •   sofarsofunny1 · Jul 5, 2025 · 2190 views
    This topic created in 317 days ago, the information mentioned may be changed or developed.

    github 代码位置: https://github.com/tingxifa/claude_proxy/tree/main

    一行命令直接使用:

    bash <(curl -sSL https://raw.githubusercontent.com/tingxifa/claude_proxy/main/claude_proxy.sh)
    

    示例:

     bash <(curl -sSL https://raw.githubusercontent.com/tingxifa/claude_proxy/main/claude_proxy.sh)
    === Claude Code 代理配置 ===
    
    请输入 Worker URL [默认: https://claude-code-proxy.suixifa.workers.dev]: 
    请输入 API Key [默认: sk-]: 
    请输入 OpenAI URL (不带 http 协议) [默认: tbai.xin/v1]: 
    请输入模型名称 [默认: gemini-2.5-pro]: 
    
    配置确认:
    Worker URL: https://claude-code-proxy.suixifa.workers.dev
    API Key: sk-...
    OpenAI URL: tbai.xin/v1
    模型: gemini-2.5-pro
    
    确认配置? (y/N): y
    Checking for Claude Code installation...
    Claude Code is already installed.
    Setting up Claude Code configuration...
    Settings file exists. Updating API configuration...
    Updated existing settings file with new API configuration.
    Original values backed up with _OLD suffix.
    Configuration complete!
    Settings saved to: /Users/lz/.claude/settings.json
    
    === 测试代理连接 ===
    正在测试代理连接...
    测试 URL: https://claude-code-proxy.suixifa.workers.dev/tbai.xin/v1/gemini-2.5-pro/v1/messages
    使用 curl 测试代理连接...
    
    ❌ 代理连接失败
    HTTP 状态码: 401
    响应: {"error":{"message":"未提供令牌 (request id: 20250705184143637697649lHBiIeQv)","type":"new_api_error"}}
    
    现在可以使用 'claude' 命令通过代理访问模型了!
    
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2942 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 13:43 · PVG 21:43 · LAX 06:43 · JFK 09:43
    ♥ Do have faith in what you're doing.