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

# Claude Code

> 通过 Anthropic 兼容协议将 Claude Code 接入 MaxAPI。

[Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) 是一款可以使用自定义模型端点的命令行 AI 工具。

<Steps>
  <Step title="安装">
    ```bash theme={null}
    npm install -g @anthropic-ai/claude-code
    ```
  </Step>

  <Step title="配置 MaxAPI">
    ```bash theme={null}
    export ANTHROPIC_API_KEY="YOUR_API_KEY"
    export ANTHROPIC_BASE_URL="https://api.maxapi.ai/anthropic"
    ```
  </Step>

  <Step title="启动工具">
    ```bash theme={null}
    claude
    ```
  </Step>
</Steps>

<Warning>
  请仅在受信任的设备上保存 API Key。不要将真实密钥提交到 Git 仓库或分享给他人。
</Warning>

<Note>
  请将 `YOUR_MODEL_ID` 替换为 MaxAPI 模型列表中的模型 ID。不同工具版本使用的环境变量名称可能不同；如果配置未生效，请检查工具的当前版本文档。
</Note>
