> ## Documentation Index
> Fetch the complete documentation index at: https://docs-vip.apigo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> 在 Claude Code 中通过 Anthropic 兼容中转站接入 Claude 模型。

## 安装 Claude Code

<Tabs>
  <Tab title="Native Install (Recommended)">
    **macOS, Linux, WSL:**

    ```bash theme={null}
    curl -fsSL https://claude.ai/install.sh | bash
    ```

    **Windows PowerShell:**

    ```powershell theme={null}
    irm https://claude.ai/install.ps1 | iex
    ```

    **Windows CMD:**

    ```bat theme={null}
    curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
    ```
  </Tab>

  <Tab title="Homebrew">
    **macOS, Linux:**

    ```bash theme={null}
    brew install --cask claude-code
    ```
  </Tab>

  <Tab title="WinGet">
    **Windows:**

    ```powershell theme={null}
    winget install Anthropic.ClaudeCode
    ```
  </Tab>
</Tabs>

如需查看更多安装方式和版本说明，可参考 [Claude Code 官方文档](https://docs.claude.com/zh-CN/docs/claude-code/setup)。

## 配置平台 API

> **重要提示：** 在配置前，请确保清除以下 Anthropic 相关的环境变量，以免旧配置覆盖平台设置：
>
> * `ANTHROPIC_BASE_URL`
> * `ANTHROPIC_AUTH_TOKEN`

## 选择接入方式

<Tabs>
  <Tab title="手动配置">
    编辑或创建 Claude Code 的配置文件：

    * MacOS & Linux：`~/.claude/settings.json`
    * Windows：`用户目录/.claude/settings.json`

    将以下占位符替换为您平台的实际信息：

    * `YOUR_PLATFORM_API_KEY`：平台提供的 API Key

    ```json theme={null}
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://api-vip.apigo.ai",
        "ANTHROPIC_AUTH_TOKEN": "YOUR_PLATFORM_API_KEY"
      }
    }
    ```

    只要这两个变量配置正确，Claude Code 就会通过您的平台转发 Claude 请求。无需额外指定模型相关字段。

    然后编辑或新增 `~/.claude.json`：

    ```json theme={null}
    {
      "hasCompletedOnboarding": true
    }
    ```

    > 注意：环境变量 `ANTHROPIC_AUTH_TOKEN` 和 `ANTHROPIC_BASE_URL` 优先级高于配置文件。
  </Tab>
</Tabs>

## 启动 Claude Code

配置完成后，进入工作目录，在终端中运行 `claude` 命令以启动 Claude Code。

## 信任文件夹

启动后，选择 **信任此文件夹**（Trust This Folder），以允许 Claude Code 访问该文件夹中的文件，随后即可通过平台中转使用 Claude 模型。
