> ## 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 for VS Code

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

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

## 1. 安装扩展

打开 VS Code 扩展商店，搜索并安装 **Anthropic 发布的 Claude Code** 扩展。

## 2. 编辑用户设置

在命令面板中执行 **Preferences: Open User Settings (JSON)**，将以下字段合并到已有的 `settings.json`：

```json settings.json theme={null}
{
  "claudeCode.environmentVariables": [
    {
      "name": "ANTHROPIC_BASE_URL",
      "value": "https://api.viviai.cc"
    },
    {
      "name": "ANTHROPIC_AUTH_TOKEN",
      "value": "sk-your-api-key"
    },
    {
      "name": "ANTHROPIC_MODEL",
      "value": "claude-sonnet-4-6"
    }
  ],
  "claudeCode.preferredLocation": "panel"
}
```

替换令牌与模型后，重新加载 VS Code 窗口，打开 Claude Code 面板并新建会话测试。这里使用用户设置，不要将密钥放入随项目共享的 `.vscode/settings.json`。

更多说明见[接入概览](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.