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

# Claude Code

> Claude Code 接入 ViVi-API 的配置教程。

准备好 [ViVi-API 控制台](https://api.viviai.cc/dashboard)创建的令牌 Key，并确认分组支持所选模型。已有配置请先备份，再合并所需字段。

## 1. 安装

推荐使用官方安装方式，按终端类型选择：

> [tab] Windows PowerShell
>
> ```powershell theme={null}
> irm https://claude.ai/install.ps1 | iex
> ```

> [tab] macOS / Linux / WSL
>
> ```bash theme={null}
> curl -fsSL https://claude.ai/install.sh | bash
> ```

如果使用支持 npm 安装的版本，也可使用 npm 方式：

```bash theme={null}
npm install -g @anthropic-ai/claude-code
```

安装完成后打开新终端验证：

```bash theme={null}
claude --version
```

## 2. 设置 ViVi-API 环境变量

> [tab] Windows PowerShell
>
> ```powershell theme={null}
> $env:ANTHROPIC_BASE_URL = "https://api.viviai.cc"
> $env:ANTHROPIC_AUTH_TOKEN = "sk-your-api-key"
> $env:ANTHROPIC_MODEL = "claude-sonnet-4-6"
> claude
> ```

> [tab] macOS / Linux / WSL / Git Bash
>
> ```bash theme={null}
> export ANTHROPIC_BASE_URL="https://api.viviai.cc"
> export ANTHROPIC_AUTH_TOKEN="sk-your-api-key"
> export ANTHROPIC_MODEL="claude-sonnet-4-6"
> claude
> ```

这些命令只对当前终端生效。需要长期保存时，按系统方式设置用户环境变量或 Shell 启动文件，然后在新终端启动 Claude Code。

更多说明见[接入概览](https://docs.viviai.cc/scenarios.md)与[常见问题](https://docs.viviai.cc/faq.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.