---
title: CC Switch | RunAPI
description: 安裝 CC Switch，新增 RunAPI Claude Code Provider，選擇模型，並驗證連接。
url: https://runapi.ai/zh-HK/docs/resources/tool-integrations/cc-switch.md
canonical: https://runapi.ai/zh-HK/docs/resources/tool-integrations/cc-switch
locale: zh-HK
---

> HTML 版本: https://runapi.ai/zh-HK/docs/resources/tool-integrations/cc-switch
> 智能代理網站索引: https://runapi.ai/llms.txt

# CC Switch

## 概覽

CC Switch 是一款用於管理編碼工具供應商的桌面應用程式。
本指南將其 Claude Code 供應商連接至 RunAPI，無需手動編輯
Shell 配置文件或項目文件。

## 開始之前

* 安裝 Claude Code 並登入您的 RunAPI 帳戶。
* 依照[身份驗證指南](https://runapi.ai/zh-HK/docs/guides/authentication.md)建立標準 API 金鑰。將其儲存於 CC Switch 中，切勿加入原始碼管理。
* 使用可透過此連線取得的 RunAPI 模型識別碼。您可從 CC Switch 選取，或從[模型目錄](https://runapi.ai/zh-HK/models)複製。

## 安裝

從其[官方發布版本][1]下載適用於 Windows、macOS
或 Linux 的 CC Switch。在 macOS 上使用 Homebrew，請使用以下命令安裝：



[1]: https://github.com/farion1231/cc-switch/releases

```shell
brew install --cask cc-switch
```

安裝後開啟 CC Switch，並在應用程式切換器中選擇 **Claude Code**。

## 配置 RunAPI

1.  選擇**Add Provider**，然後選擇**Custom**預設設定。
2.  將提供商命名為 `RunAPI`，並在其設定編輯器中輸入您的 API 金鑰和 Base URL：

```json
{
  "env": {
    "ANTHROPIC_API_KEY": "YOUR_RUNAPI_API_KEY",
    "ANTHROPIC_BASE_URL": "https://runapi.ai"
  }
}
```

上方的 API 金鑰為佔位符。請透過[身份驗證指南](https://runapi.ai/zh-HK/docs/guides/authentication.md)建立並輪替您的實際金鑰。

## 選擇模型

1.  僅使用**Fetch Models**來探索候選模型。若模型未列出，請從[模型目錄](https://runapi.ai/zh-HK/models)複製其識別碼。擷取操作不會將模型分配至 Claude Code 請求角色。
2.  將所選識別碼設定為**Default fallback model**，然後選擇**Quick Set**。這會將識別碼套用至每個**Actual Request Model**行：Sonnet、Opus、Fable、Haiku 及 Subagent。
3.  儲存前，確認每行均顯示預期的 RunAPI 識別碼。CC Switch 將此對應關係持久化為 `ANTHROPIC_MODEL`、`ANTHROPIC_DEFAULT_SONNET_MODEL`、`ANTHROPIC_DEFAULT_OPUS_MODEL`、`ANTHROPIC_DEFAULT_FABLE_MODEL`、`ANTHROPIC_DEFAULT_HAIKU_MODEL` 及 `CLAUDE_CODE_SUBAGENT_MODEL`。
4.  儲存提供商，在提供商清單中選擇它，然後啟用。

## 驗證

在項目目錄中開啟新終端機並啟動 Claude Code：

```shell
claude
```

執行 `/status` 檢查當前模型，然後傳送簡短提示，例如 `Describe this repository in one sentence.` 正常回應確認 CC Switch 正在使用有效的 RunAPI 供應商。

## 疑難排解

* **身份驗證失敗：** 請驗證 CC Switch 中已啟用 Provider 的 API 金鑰，如有需要，請按照[身份驗證指南](https://runapi.ai/zh-HK/docs/guides/authentication.md)建立新金鑰。
* **預期的模型不可用：** 請重新整理模型選擇器，或從[模型目錄](https://runapi.ai/zh-HK/models)複製受支援的模型識別碼，然後將其設定為**預設後備模型**並再次選擇 **Quick Set**。
* **Claude Code 仍然使用另一個 Provider：** 請在 CC Switch 中啟用 RunAPI Provider，然後開啟新的終端機會話。請查閱 CC Switch 的 [provider 文件][1]以了解環境衝突問題。



[1]: https://github.com/farion1231/cc-switch/tree/main/docs/user-manual/en/2-providers

## 後續步驟

有關協議選擇及請求行為，請使用 [LLM API
快速入門](https://runapi.ai/zh-HK/docs/guides/llm-api/quickstart.md)。有關請求及回應欄位，請使用 [Anthropic Messages API
參考](https://runapi.ai/zh-HK/docs/api/anthropic/messages.md)。如需將 RunAPI 工具新增至 Claude
Code，請繼續查閱 [MCP 概覽](https://runapi.ai/zh-HK/docs/resources/mcp.md)。

---

## RunAPI 的更多內容

- [首頁](https://runapi.ai/zh-HK/.md)
- [模型目錄](https://runapi.ai/zh-HK/models.md)
- [收費](https://runapi.ai/zh-HK/pricing.md)
- [服務商](https://runapi.ai/zh-HK/models)
- [文件](https://runapi.ai/zh-HK/docs/guides)
- [SDK](https://runapi.ai/zh-HK/sdk.md)
- [CLI](https://runapi.ai/zh-HK/cli.md)
- [MCP Server](https://runapi.ai/zh-HK/mcp.md)
- [Claude Code 與 Cursor](https://runapi.ai/zh-HK/claude-code-vs-cursor.md)
- [Cursor API 設定](https://runapi.ai/zh-HK/cursor-api-setup.md)
- [RunAPI 與 OpenRouter](https://runapi.ai/zh-HK/openrouter-alternative.md)
- [企業版](https://runapi.ai/zh-HK/contact.md)
- [聯絡](https://runapi.ai/zh-HK/contact.md)
- [條款](https://runapi.ai/zh-HK/terms.md)
- [私隱](https://runapi.ai/zh-HK/privacy.md)
- [智能代理網站索引](https://runapi.ai/llms.txt)

聯絡我們: contact@runapi.ai

## 結構化資料

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-HK",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/zh-HK/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-HK",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/zh-HKicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "TechArticle",
    "headline": "CC Switch",
    "description": "安裝 CC Switch，新增 RunAPI Claude Code Provider，選擇模型，並驗證連接。",
    "url": "https://runapi.ai/zh-HK/docs/resources/tool-integrations/cc-switch",
    "mainEntityOfPage": "https://runapi.ai/zh-HK/docs/resources/tool-integrations/cc-switch"
  }
]
```
