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

# Claude Code

# Claude Code

Claude Code 使用 Anthropic Messages 格式。推荐通过 [CC Switch](/cc-switch) 的内置 **PIPELLM** 供应商完成配置，避免手动维护 `settings.json`。

<Tip>
  在 CC Switch 中选择 **PIPELLM**，填入 PIPELLM Code API Key 后，Claude Code 配置会自动生成。
</Tip>

## 基础配置

Claude Code 的请求地址为：

```text theme={null}
https://cc-api.pipellm.ai
```

在「API Key」中填入你的 PIPELLM Code API Key。该 API Key 可在 [https://code.pipellm.ai](https://code.pipellm.ai) 获取。

<Frame>
  <img src="https://mintcdn.com/pipellmcode/dzjATQcx3kQQ-O-8/images/cc-switch-pipellm-claude-basic.png?fit=max&auto=format&n=dzjATQcx3kQQ-O-8&q=85&s=8776b18a50208d18134e96c3db8bf15e" alt="PIPELLM Claude Code 基础配置" width="2002" height="1900" data-path="images/cc-switch-pipellm-claude-basic.png" />
</Frame>

## 模型映射

CC Switch 会自动带出 PIPELLM Code 的 Claude Code 模型映射。你也可以按需调整 Sonnet、Opus、Fable、Haiku 对应的模型名称。

<Frame>
  <img src="https://mintcdn.com/pipellmcode/dzjATQcx3kQQ-O-8/images/cc-switch-pipellm-claude-models.png?fit=max&auto=format&n=dzjATQcx3kQQ-O-8&q=85&s=9b786c93ada6093cffe3ef216de17dc4" alt="PIPELLM Claude Code 模型映射" width="2002" height="1900" data-path="images/cc-switch-pipellm-claude-models.png" />
</Frame>

## 手动配置参考

如果你需要手动检查配置，可以参考以下字段：

```json theme={null}
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "<YOUR_API_KEY>",
    "ANTHROPIC_BASE_URL": "https://cc-api.pipellm.ai",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_MODEL": "claude-opus-4-6",
    "ANTHROPIC_REASONING_MODEL": "claude-opus-4-6"
  },
  "hooks": {},
  "includeCoAuthoredBy": false,
  "model": "claude-sonnet-4-6"
}
```
