Claude Code provider switch: a CC Switch tutorial in 5 minutes
> This tutorial follows CC Switch v4.0.26 (November 2026). Button labels may change in later releases; the configuration model is stable.
CC Switch moves Claude Code onto AIHubMix through one provider card, one API key, and one model ID, and Claude Code picks up the change without a restart in the usual case. The result is a working Claude Code session against AIHubMix, with your hooks, permissions, MCP configuration, and plugins still in ~/.claude/settings.json, and a card click to switch back.
The engineering problem is not the switch. It is everything around it: the base URL path, the model ID the preset leaves out, and the ANTHROPIC_* exports in your shell profile that can override the file CC Switch just wrote. That last failure is quiet — no error about precedence, just requests going to the old endpoint.
The short version: install CC Switch, create an AIHubMix key, choose the AiHubMix preset under Claude Code, paste the key, add ANTHROPIC_MODEL=claude-sonnet-5-5 to the provider, click Switch, and run claude -p "1+1, output only the answer" --model claude-sonnet-5-5. The sections below cover the parts that need judgment.
What CC Switch is
CC Switch is an open-source desktop app (MIT, Tauri + Rust + React) for managing provider configurations across Claude Code, Codex, Gemini CLI, OpenCode, and other coding tools. It ships more than 90 provider presets and supports custom providers. The repository and user manual are at farion1231/cc-switch.
Three modes matter:
- Direct mode rewrites the key fields in the client's configuration file and lets the client talk to the provider.
- Routing mode runs a local gateway at 127.0.0.1:15721, with API-format conversion, failover, health checks, and request logs.
- Aggregation mode puts models from several providers into one /model list.
Download only from ccswitch.io or the GitHub Releases page. A site that asks for payment or account credentials is not an official source.
Prerequisites
- Claude Code, runnable from a terminal. Check with claude --version. If it is missing, use curl -fsSL https://claude.ai/install.sh | bash or npm i -g @anthropic-ai/claude-code with Node.js 22 or newer.
- An AIHubMix account and API key. Create one in the AIHubMix console. The key usually starts with sk-.
- A CC Switch installer from one of the official sources above.
Step 1: Install CC Switch
| OS | Install |
|---|---|
| macOS 12 Monterey or later | brew install --cask cc-switch, or the signed and notarized .dmg |
| Windows 10 or later | The .msi installer, or the portable .zip |
| Debian / Ubuntu | The .deb package |
| Fedora / RPM distributions | The .rpm package |
| Arch Linux | paru -S cc-switch-bin |
| Other Linux | The .AppImage; requires glibc 2.35+ and WebKitGTK 4.1 |
On first launch, CC Switch imports your existing Claude Code configuration as a provider named default and adds an official provider. Your original configuration is not lost, and you can switch back at any time. If Claude Code is not installed yet, the Apps page in CC Switch can install or upgrade it.
Step 2: Create an AIHubMix API key
Open the AIHubMix API keys page, create a key, and copy it.
The placeholder AIHUBMIX_API_KEY in the documentation is not a real key. If you paste it verbatim, the request fails with 401 invalid key: AIHUBMIX_API_KEY.
Step 3: Add AIHubMix to Claude Code
1. Select Claude Code in the left sidebar.
2. Click the + button in the top-right corner.
3. Search for AiHubMix, or find it under the third-party platforms category.
4. The name and endpoint are filled in automatically: https://aihubmix.com. Paste your key into API Key.
5. Click Add.
The preset stores two environment variables:
{
"env": {
"ANTHROPIC_API_KEY": "sk-your-key",
"ANTHROPIC_BASE_URL": "https://aihubmix.com"
}
}
The preset does not set a model. AIHubMix's guide treats ANTHROPIC_MODEL as a core variable, so add it to the same env block before you switch:
{
"env": {
"ANTHROPIC_API_KEY": "sk-your-key",
"ANTHROPIC_BASE_URL": "https://aihubmix.com",
"ANTHROPIC_MODEL": "claude-sonnet-5-5"
}
}
Without a model, Claude Code sends its own default model ID, which may not be one AIHubMix serves.
Two details matter at this point.
Do not append /v1 to the base URL. Claude Code speaks the Anthropic Messages protocol and builds the request path itself. https://aihubmix.com is correct. https://aihubmix.com/v1 is the OpenAI-compatible base for other clients; Claude Code would append its own /v1/messages to it.
The preset uses ANTHROPIC_API_KEY; AIHubMix's own Claude Code guide uses ANTHROPIC_AUTH_TOKEN. AIHubMix accepts both: ANTHROPIC_AUTH_TOKEN sends a Bearer header, and ANTHROPIC_API_KEY sends x-api-key. Pick one, and do not fill both with different values. The setup details, model IDs, and error reference are in the AIHubMix Claude Code documentation.
If the preset is missing — an older release, or a card you deleted — choose Custom Configuration and paste the JSON above. The provider card's endpoint manager can test latency, and the preset includes https://api.aihubmix.com as an alternate endpoint if aihubmix.com does not resolve.
Step 4: Switch and verify
On the Direct tab, click Switch on the AiHubMix card. The button changes to In use when the configuration has been written.
Claude Code reloads the configuration automatically; a restart is not usually required. If the current session keeps using the old provider, exit and start it again.
For quick changes, right-click the CC Switch icon in the system tray, open the Claude Code submenu, and click a provider. The submenu title shows the active provider and a quota summary.
Focused commands
Three commands cover the whole path:
# CLI on PATH
claude --version
# end-to-end request through the configured provider
claude -p "1+1, output only the answer" --model claude-sonnet-5-5
# stale exports that can override the written configuration
grep -n "ANTHROPIC" ~/.zshrc ~/.bash_profile 2>/dev/null
A response of 2 from the second command means the request reached AIHubMix. In an interactive session, the Anthropic base URL line in /status should show https://aihubmix.com.
To go back to the official provider, switch to Claude Official, restart Claude Code, and complete the login flow.
What the switch actually changes
In direct mode, CC Switch replaces only the connection and compatibility fields in ~/.claude/settings.json: ANTHROPIC_*, AWS_*, protocol selectors such as CLAUDE_CODE_USE_BEDROCK, model, apiKeyHelper, and a few provider-scoped compatibility options such as CLAUDE_CODE_DISABLE_ARTIFACT and the context window.
permissions, hooks, enabledPlugins, statusLine, MCP configuration, comments, and anything else you added stay in place. The exact list is in the configuration-file reference.
Before the first rewrite of a tool's configuration, CC Switch backs up the original to ~/.cc-switch/backups/live-first-write/. If the JSON is malformed, it refuses to write, reports the line and column, and leaves the file unchanged.
Provider configurations live in ~/.cc-switch/, with a SQLite database at its center. Automatic backups keep the most recent 10 by default, and WebDAV or S3-compatible sync is available. The database and exported backups include provider configurations, including keys, so treat them as secrets.
Model aliases
With ANTHROPIC_MODEL set, Claude Code's default is Sonnet 5.5. The /model aliases (opus, sonnet, haiku, fable) still need mapping before they resolve to AIHubMix's model IDs. Add these keys inside env:
| Role | Variable | AIHubMix model ID |
|---|---|---|
| Default | ANTHROPIC_MODEL | claude-sonnet-5-5 |
| Opus alias | ANTHROPIC_DEFAULT_OPUS_MODEL | claude-opus-5-5 |
| Sonnet alias | ANTHROPIC_DEFAULT_SONNET_MODEL | claude-sonnet-5-5 |
| Haiku alias | ANTHROPIC_DEFAULT_HAIKU_MODEL | claude-haiku-5-5 |
| Fable alias | ANTHROPIC_DEFAULT_FABLE_MODEL | claude-fable-5-1 |
The complete provider configuration then looks like this:
{
"env": {
"ANTHROPIC_API_KEY": "sk-your-key",
"ANTHROPIC_BASE_URL": "https://aihubmix.com",
"ANTHROPIC_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-fable-5-1"
}
}
Model selection priority, highest first: /model <name> → claude --model <name> → ANTHROPIC_MODEL → the model field in settings.json. Copy model IDs from the AIHubMix model list; they are case-sensitive.
Failure modes and fixes
Stale ANTHROPIC_* variables
If you previously followed a manual setup guide and added export ANTHROPIC_BASE_URL=... or export ANTHROPIC_AUTH_TOKEN=... to ~/.zshrc or ~/.bash_profile, those variables may override the values CC Switch writes. The card says In use, but requests still go to the old endpoint.
CC Switch detects the conflict. A yellow banner at the top of the window warns that environment variables may override your configuration; the details show the variable name, value, and source. Delete Selected removes them and writes a backup to ~/.cc-switch/backups/env-backup-<timestamp>.json first.
To check manually, run the third command above. Comment out the old exports, then run source ~/.zshrc or open a new terminal. AIHubMix's own documentation recommends removing global ANTHROPIC_* variables when CC Switch manages the configuration. The full conflict workflow is in the environment-variable reference.
Errors from AIHubMix
The strings below are quoted from AIHubMix's Claude Code documentation.
| Error | What to do |
|---|---|
| 401 no key provided | Check the base URL; clear stale env vars. |
| 401 invalid key: AIHUBMIX_API_KEY | Use the real key, not the placeholder. |
| 401 this key is not enabled | Check the key and quota in the console. |
| 400 Incorrect model ID | Copy the full ID from the model list. |
Non-error symptoms
- Login screen or Not logged in: check /status; enable Skip Claude Code first-run confirmation under Settings → App config → Claude Code; restart; confirm the key is filled in.
- The switch has no effect: a stale shell variable or cached session; open a new terminal or restart Claude Code.
- The card's connection test passes but requests fail: the test checks reachability, not the key or model; run the end-to-end claude -p command.
- You want the official provider back: switch to Claude Official, restart Claude Code, and log in again.
- claude is not found on macOS: the official installer usually places it in ~/.local/bin/claude; add export PATH="$HOME/.local/bin:$PATH" to your shell profile and open a new terminal.
When direct mode is not enough
Direct mode is the right default for AIHubMix. The endpoint already speaks Anthropic Messages, so no protocol conversion is needed.
Use routing when you want a failover queue, or when you need to put an OpenAI-format provider behind Claude Code. Routing points Claude Code at http://127.0.0.1:15721, replaces the key in the config with PROXY_MANAGED, and injects the real key from CC Switch. The app must stay running; quitting CC Switch writes the direct configuration back. Official Claude subscriptions do not go through routing; use direct mode for those.
Use aggregation when you want models from several providers in one /model list. The default provider handles requests without a prefix; other providers' models appear with a ccs- prefix. Aggregation does not fail over. It is available for Claude Code and Codex only, and Claude official subscriptions are not supported in aggregation. The ccs- model list needs Claude Code 2.1.243 or newer. Claude Code picks up model-list changes immediately; Codex needs a full restart.
What this walkthrough cannot verify for you
- Your CC Switch build. The steps follow v4.0.26 (November 2026). Later releases can move button labels; the configuration model is stable. An older release may not ship the AiHubMix preset, in which case use Custom Configuration.
- That Claude Code reloaded. The card shows the configuration was written. The /status base URL and the end-to-end command show the request path. If a session keeps the old provider, restart it.
- The card's connection check. It tests reachability, not your API key or your model. A passing result is not an end-to-end pass.
- Your account state. Check whether the key is enabled and has quota in the AIHubMix console; the error table gives the strings to look for.
- Model IDs. Copy them from the AIHubMix model list, and keep the casing; they are case-sensitive. The card's connection check does not validate the model ID.
- The error strings' provenance. They are quoted from AIHubMix's Claude Code documentation, not generated by your installation.
- Download legitimacy. Only ccswitch.io and GitHub Releases are official download sources. A site that asks for payment or account credentials is not.
Sources
- CC Switch repository
- CC Switch user manual: Add Provider
- CC Switch user manual: Switch Provider
- CC Switch user manual: Configuration Files
- AIHubMix documentation: Claude Code
CC Switch で Claude Code の接続先を切り替える手順とハマりどころ
:::note info
この記事は AIHubMix が作成しました。CC Switch v4.0.26(2026年11月)時点の画面と設定を説明しています。以降のリリースではボタン名が変わることがありますが、設定の仕組みは安定しています。
:::
Claude Code の接続先をプロバイダー間で切り替えるとき、通常は ~/.claude/settings.json を編集します。ベース URL、API キー、場合によってはモデル。1つならまだ管理できますが、2つ、3つになると小さな保守作業になります。しかも失敗は静かです。シェルに残った ANTHROPIC_* の export が、直前に編集したファイルを上書きすることがあります。
CC Switch は、この切り替えをクリックできるカードにします。組み込みの AiHubMix プリセットがエンドポイントを埋め、API キーを1つ貼るだけです。Claude Code は通常、再起動なしで変更を読み込みます。本記事ではセットアップの全体、CC Switch が実際に書き換えるもの、環境変数の罠、direct モードで足りる場面を説明します。
TL;DR
- CC Switch の AiHubMix プリセットなら、Claude Code の接続先はカードのクリックで切り替わります
- プリセットが設定するのは ANTHROPIC_API_KEY と ANTHROPIC_BASE_URL の2つです。モデルは自分で追加します
- ベース URL に /v1 は付けません。Claude Code は Anthropic Messages を話し、パスを自分で組み立てます
- 切り替えが効かないように見える典型的な原因は、シェルプロファイルに残った ANTHROPIC_* の export です
- 完了確認は claude -p "1+1, output only the answer" --model claude-sonnet-5-5 が 2 を返すことです
CC Switch とは
CC Switch は、Claude Code、Codex、Gemini CLI、OpenCode などのコーディングツールのプロバイダー設定を管理するオープンソースのデスクトップアプリです(MIT、Tauri + Rust + React)。90以上のプロバイダープリセットを同梱し、カスタムプロバイダーにも対応します。リポジトリとユーザーマニュアルは farion1231/cc-switch にあります。
単なるキーの切り替えツールではありません。3つのモードがあります。
- direct モード:クライアントの設定ファイルにあるキーのフィールドを書き換え、クライアントがプロバイダーと直接通信します。
- ルーティングモード:127.0.0.1:15721 でローカルゲートウェイを動かし、API 形式の変換、フェイルオーバー、ヘルスチェック、リクエストログを提供します。
- アグリゲーションモード:複数プロバイダーのモデルを1つの /model リストにまとめます。
配布元は ccswitch.io と GitHub Releases だけです。支払いやアカウント情報を求めるサイトは公式の配布元ではありません。
前提
- Claude Code がターミナルから実行できること。 claude --version で確認します。未インストールの場合は公式インストーラー curl -fsSL https://claude.ai/install.sh | bash、または Node.js 22以上の環境で npm i -g @anthropic-ai/claude-code を使います。
- AIHubMix のアカウントと API キー。 AIHubMix コンソール で作成します。キーは通常 sk- で始まります。
- CC Switch のインストーラー。 上記の公式配布元から取得します。
ステップ1:CC Switch をインストールする
| OS | インストール方法 |
|---|---|
| macOS 12 Monterey 以降 | brew install --cask cc-switch、または署名・公証済みの .dmg |
| Windows 10 以降 | .msi インストーラー、またはポータブル .zip |
| Debian / Ubuntu | .deb パッケージ |
| Fedora / RPM 系 | .rpm パッケージ |
| Arch Linux | paru -S cc-switch-bin |
| その他の Linux | .AppImage(glibc 2.35以上と WebKitGTK 4.1 が必要) |
初回起動時、CC Switch は既存の Claude Code 設定を default という名前のプロバイダーとしてインポートし、公式プロバイダーを追加します。元の設定は失われず、いつでも戻せます。
Claude Code がまだインストールされていない場合は、CC Switch の Apps ページからインストールまたはアップグレードできます。
ステップ2:AIHubMix の API キーを作成する
AIHubMix の API キーページを開き、キーを作成してコピーします。
ドキュメント内のプレースホルダー AIHUBMIX_API_KEY は実際のキーではありません。そのまま貼り付けると、リクエストは 401 invalid key: AIHUBMIX_API_KEY で失敗します。
ステップ3:Claude Code に AIHubMix を追加する
1. 左サイドバーで Claude Code を選択します。
2. 右上の + ボタンをクリックします。
3. AiHubMix を検索するか、サードパーティプラットフォームのカテゴリから選びます。
4. 名前とエンドポイントが自動入力されます。https://aihubmix.com です。API Key にキーを貼り付けます。
5. Add をクリックします。
プリセットが保存する環境変数は2つです。
{
"env": {
"ANTHROPIC_API_KEY": "sk-your-key",
"ANTHROPIC_BASE_URL": "https://aihubmix.com"
}
}
プリセットはモデルを設定しません。AIHubMix のガイドは ANTHROPIC_MODEL を中心となる変数として扱っているため、切り替える前に同じ env ブロックへ追加します。
{
"env": {
"ANTHROPIC_API_KEY": "sk-your-key",
"ANTHROPIC_BASE_URL": "https://aihubmix.com",
"ANTHROPIC_MODEL": "claude-sonnet-5-5"
}
}
モデルを設定しないと、Claude Code は自身のデフォルトモデル ID を送ります。それが AIHubMix の提供するモデルとは限りません。
ここで押さえておきたい点が2つあります。
ベース URL に /v1 を付けない。 Claude Code は Anthropic Messages プロトコルを話し、リクエストパスを自分で組み立てます。https://aihubmix.com が正解です。https://aihubmix.com/v1 は他のクライアント向けの OpenAI 互換ベースで、Claude Code はそこに自身の /v1/messages を追加してしまいます。
プリセットは ANTHROPIC_API_KEY を使い、AIHubMix 自身の Claude Code ガイドは ANTHROPIC_AUTH_TOKEN を使います。 AIHubMix はどちらも受け付けます。ANTHROPIC_AUTH_TOKEN は Bearer ヘッダーを送り、ANTHROPIC_API_KEY は x-api-key を送ります。どちらか一方を選び、異なる値で両方を埋めないでください。設定の詳細、モデル ID、エラーのリファレンスは AIHubMix の Claude Code ドキュメント にあります。
プリセットが見つからない場合(古いリリース、またはカードを削除した場合)は、Custom Configuration を選び、上の JSON を貼り付けます。プロバイダーカードのエンドポイントマネージャーはレイテンシーをテストできます。プリセットには、aihubmix.com が解決できない場合の代替エンドポイント https://api.aihubmix.com も含まれています。
ステップ4:切り替えて確認する
Direct タブで AiHubMix カードの Switch をクリックします。設定の書き込みが完了すると、ボタンは In use に変わります。
Claude Code は設定を自動で再読み込みします。通常、再起動は不要です。現在のセッションが古いプロバイダーを使い続ける場合は、いったん終了して起動し直します。
エンドツーエンドの経路を確認します。
claude -p "1+1, output only the answer" --model claude-sonnet-5-5
2 が返れば、リクエストは AIHubMix に届いています。対話セッションでは、/status の Anthropic base URL 行が https://aihubmix.com を示すはずです。
素早く切り替えたいときはシステムトレイを使います。CC Switch のアイコンを右クリックし、Claude Code サブメニューでプロバイダーをクリックします。サブメニューのタイトルには、有効なプロバイダーとクォータの概要が表示されます。
公式プロバイダーに戻すには、Claude Official に切り替え、Claude Code を再起動し、ログインフローを完了します。
切り替えが実際に変えるもの
direct モードでは、CC Switch は ~/.claude/settings.json の接続と互換性のフィールドだけを置き換えます。ANTHROPIC_*、AWS_*、CLAUDE_CODE_USE_BEDROCK のようなプロトコルセレクター、model、apiKeyHelper、そして CLAUDE_CODE_DISABLE_ARTIFACT やコンテキストウィンドウのようなプロバイダー単位の互換オプションです。
permissions、hooks、enabledPlugins、statusLine、MCP 設定、コメント、その他追加したものはそのまま残ります。正確なリストは 設定ファイルのリファレンス にあります。
ツール設定の初回書き換えの前に、CC Switch は元のファイルを ~/.cc-switch/backups/live-first-write/ にバックアップします。JSON が壊れている場合は書き込みを拒否し、行と列を報告し、ファイルを変更しません。
モデルエイリアスを設定する
ANTHROPIC_MODEL を設定すると、Claude Code のデフォルトは Sonnet 5.5 になります。/model のエイリアス(opus、sonnet、haiku、fable)は、AIHubMix のモデル ID に解決するために別途マッピングが必要です。env の中に次のキーを追加します。
| 役割 | 変数 | AIHubMix のモデル ID |
|---|---|---|
| デフォルト | ANTHROPIC_MODEL | claude-sonnet-5-5 |
| Opus エイリアス | ANTHROPIC_DEFAULT_OPUS_MODEL | claude-opus-5-5 |
| Sonnet エイリアス | ANTHROPIC_DEFAULT_SONNET_MODEL | claude-sonnet-5-5 |
| Haiku エイリアス | ANTHROPIC_DEFAULT_HAIKU_MODEL | claude-haiku-5-5 |
| Fable エイリアス | ANTHROPIC_DEFAULT_FABLE_MODEL | claude-fable-5-1 |
プロバイダー設定の全体は次のようになります。
{
"env": {
"ANTHROPIC_API_KEY": "sk-your-key",
"ANTHROPIC_BASE_URL": "https://aihubmix.com",
"ANTHROPIC_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-fable-5-1"
}
}
モデル選択の優先順位は、高い順に /model <name> → claude --model <name> → ANTHROPIC_MODEL → settings.json の model フィールドです。モデル ID は AIHubMix のモデル一覧 からコピーしてください。大文字と小文字は区別されます。
ハマりどころ
カードは In use なのに、リクエストが古いエンドポイントへ行く
以前に手動セットアップのガイドに従い、export ANTHROPIC_BASE_URL=... や export ANTHROPIC_AUTH_TOKEN=... を ~/.zshrc や ~/.bash_profile に追加した場合、それらの変数が CC Switch が書き込んだ値を上書きすることがあります。カードを AIHubMix に切り替えても、リクエストは古いエンドポイントへ送られます。
CC Switch はこの競合を検出します。ウィンドウ上部の黄色いバナーが、環境変数が設定を上書きする可能性を警告し、詳細には変数名、値、ソースが表示されます。Delete Selected を押すとそれらが削除され、その前に ~/.cc-switch/backups/env-backup-<timestamp>.json へバックアップが書き込まれます。
手動で確認するには、次のコマンドを実行します。
grep -n "ANTHROPIC" ~/.zshrc ~/.bash_profile 2>/dev/null
古い export をコメントアウトし、source ~/.zshrc を実行するか新しいターミナルを開きます。AIHubMix のドキュメントも、CC Switch が設定を管理する場合はグローバルの ANTHROPIC_* 変数を削除することを推奨しています。競合のワークフロー全体は 環境変数のリファレンス にあります。
ベース URL に /v1 を付けてしまう
https://aihubmix.com が正解です。https://aihubmix.com/v1 は他のクライアント向けの OpenAI 互換ベースで、Claude Code はそこに自身の /v1/messages を追加してしまいます。Claude Code は Anthropic Messages を話し、パスを自分で組み立てるため、OpenAI 互換のベースを渡す場所ではありません。
接続テストが通ってもリクエストが失敗する
カードの接続テストは、エンドポイントに到達できるかだけを確認します。API キーやモデルは検証しません。テストが通っても、キーが無効だったりモデル ID が間違っていたりすれば、リクエストは失敗します。最終確認は claude -p のエンドツーエンド実行です。
モデル ID が設定されていない、または一致しない
プリセットはモデルを設定しません。ANTHROPIC_MODEL を追加しないと、Claude Code は自身のデフォルトモデル ID を送ります。それが AIHubMix の提供するモデルとは限りません。400 Incorrect model ID が返る場合は、モデル一覧から完全な ID をコピーしてください。大文字と小文字は区別されます。
ログイン画面が出る、または Not logged in と表示される
/status を確認します。Settings → App config → Claude Code の Skip Claude Code first-run confirmation を有効にし、再起動し、キーが入力されていることを確認します。
macOS で claude コマンドが見つからない
公式インストーラーは通常、claude を ~/.local/bin/claude に配置します。シェルプロファイルに export PATH="$HOME/.local/bin:$PATH" を追加し、新しいターミナルを開きます。
AIHubMix が返すエラー
次の文字列は AIHubMix の Claude Code ドキュメントからの引用です。
| エラー | 対処 |
|---|---|
| 401 no key provided | ベース URL を確認し、古い環境変数を消します |
| 401 invalid key: AIHUBMIX_API_KEY | プレースホルダーではなく実際のキーを使います |
| 401 this key is not enabled | コンソールでキーとクォータを確認します |
| 400 Incorrect model ID | モデル一覧から完全な ID をコピーします |
ルーティングとアグリゲーションが必要なとき
AIHubMix では direct モードを使うのが基本です。エンドポイントはすでに Anthropic Messages を話すため、プロトコル変換は不要です。
ルーティングは、フェイルオーバーのキューが必要なとき、または OpenAI 形式のプロバイダーを Claude Code の背後に置きたいときに使います。Claude Code の接続先を http://127.0.0.1:15721 に向け、設定内のキーを PROXY_MANAGED に置き換え、実際のキーは CC Switch から注入します。アプリは動かし続ける必要があり、CC Switch を終了すると direct の設定が書き戻されます。公式の Claude サブスクリプションはルーティングを通りません。それらには direct モードを使ってください。
アグリゲーションは、複数プロバイダーのモデルを1つの /model リストにまとめたいときに使います。デフォルトプロバイダーがプレフィックスなしのリクエストを処理し、他のプロバイダーのモデルは ccs- プレフィックス付きで表示されます。フェイルオーバーは行いません。Claude Code と Codex のみで利用でき、Claude の公式サブスクリプションはサポートされません。ccs- のモデルリストには Claude Code 2.1.243以降が必要です。Claude Code はモデルリストの変更を即座に反映しますが、Codex は完全な再起動が必要です。
この記事で確認できないこと
- CC Switch のビルド。 手順は v4.0.26(2026年11月)に基づきます。以降のリリースではボタン名が変わる可能性がありますが、設定の仕組みは安定しています。古いリリースに AiHubMix プリセットがない場合は Custom Configuration を使います。
- Claude Code が再読み込みしたか。 カードは設定が書き込まれたことを示します。リクエスト経路は /status とエンドツーエンドのコマンドで確認します。セッションが古いプロバイダーを保持する場合は再起動します。
- カードの接続確認。 到達性だけをテストし、API キーやモデルは検証しません。合格はエンドツーエンドの合格ではありません。
- アカウントの状態とモデル ID。 キーが有効でクォータがあるかは AIHubMix コンソールで確認します。モデル ID はモデル一覧からコピーし、大文字小文字を保ちます。カードの接続確認はモデル ID を検証しません。
- エラー文字列の出典。 AIHubMix の Claude Code ドキュメントからの引用で、読者の環境が生成したものではありません。
- 配布元の正当性。 ccswitch.io と GitHub Releases だけが公式の配布元です。支払いやアカウント情報を求めるサイトは公式ではありません。
まとめ
- CC Switch の AiHubMix プリセットは、ベース URL と API キーの2つを設定します。モデルは自分で追加します
- ベース URL は https://aihubmix.com です。/v1 は付けません
- シェルに残った ANTHROPIC_* の export は、書き込まれた設定を上書きすることがあります
- In use は書き込みの完了を示します。リクエスト経路は /status と claude -p で確認します
- AIHubMix では direct モードで足ります。ルーティングとアグリゲーションは別の要件に答えます
AIHubMix の Claude Code エンドポイントは https://aihubmix.com です。API キーを作成して AiHubMix カードに貼り付け、claude -p の確認で 2 が返るところまで進めてください。
参考
1. CC Switch repository(GitHub)
2. CC Switch ユーザーマニュアル: Add Provider(CC Switch)
3. CC Switch ユーザーマニュアル: Switch Provider(CC Switch)
4. CC Switch ユーザーマニュアル: Configuration Files(CC Switch)
5. AIHubMix ドキュメント: Claude Code(AIHubMix)
1 like
还在手动切换 Claude Code、Codex 和其他编码代理?
现在,一款桌面应用可以统一管理它们的账户与设置,让切换工具变得像切换标签一样简单
cc-switch 已获得 146k 颗星,背后原因很简单:开发者们早就厌倦了反复登录和手动配置
了解更多
farion1231/cc-switch
3 likes · 80 views
@lidangzzz 用简洁的 GUI 管理多个 Agent 应用的供应商、用量、会话历史、MCP、Skills,稳定、原生、低侵入
farion1231/cc-switch
7 likes · 1,080 views
5 popular Claude Code repos, ranked by GitHub stars #shorts
Five popular Claude Code related repos by GitHub stars (checked 2026-10-22): anthropics/claude-code 152.9k, farion1231/cc-switch 147.6k, garrytan/gstack 137.3k, stablyai/orca 102.5k, thedotmack/claude-mem 102.3k. This is a hand-picked list, not a complete ranking of GitHub.
anthropics/claude-code
farion1231/cc-switch
garrytan/gstack
stablyai/orca
thedotmack/claude-mem
Independent tutorial channel. Not affiliated with or endorsed by Anthropic.
3 likes · 367 views
cc-switch: The Hottest Rust Repo on GitHub Right Now #Shorts
In this video, we break down farion1231/cc-switch - one of the hottest open-source projects on GitHub right now.
A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io. It has already earned 147,675 stars on GitHub and is written primarily in Rust. We look at what it does, why developers are paying attention to it right now, and who should try it.
📂 Repo: farion1231/cc-switch
🌐 Stars: 147,675 | Language: Rust | Forks: 9,726
🔔 Subscribe for daily picks of the hottest GitHub repos: / @reporadar
#github #opensource #programming
keywords: coding, developer tools, github, opensource, programming, software, tech
#Shorts
11 views
cc-switch: The Hottest Rust Repo on GitHub Right Now
In this video, we break down farion1231/cc-switch - one of the hottest open-source projects on GitHub right now.
A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io. It has already earned 147,675 stars on GitHub and is written primarily in Rust. We look at what it does, why developers are paying attention to it right now, and who should try it.
📂 Repo: farion1231/cc-switch
🌐 Stars: 147,675 | Language: Rust | Forks: 9,726
🔔 Subscribe for daily picks of the hottest GitHub repos: / @reporadar
#github #opensource #programming
keywords: coding, developer tools, github, opensource, programming, software, tech
9 views
How to switch Claude Code between API providers in one click with CC Switch (and run GPT in it)
If you use Claude Code with more than one API provider, you know the routine: open ~/.claude/settings.json, swap the base URL, swap the key, swap the model, hope you did not break the JSON, and do it again tomorrow when you hit a limit. Multiply that by Codex and Gemini CLI, which each keep their own config in their own format, and switching becomes a chore you avoid.
CC Switch is a desktop app for Windows, macOS and Linux that does this in one click. Pick a preset, paste a key, press Enable. It manages Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes Agent, Pi, MiniMax Code, Kimi Code and Oh My Pi, and the README lists 90+ provider presets, including AWS Bedrock and NVIDIA NIM.
This guide covers install, your first switch, running GPT or local models inside Claude Code through its routing mode, and the details that trip people up.
Install
macOS (Homebrew is the recommended route):
brew install --cask cc-switch
Update later with:
brew upgrade --cask cc-switch
The macOS build is universal (Apple Silicon and Intel) and is signed and notarized. On Arch Linux:
paru -S cc-switch-bin
Windows and other Linux users download the .msi, .deb, .rpm or .AppImage from the repo's Releases page. Requirements per the README: Windows 10+, macOS 12+, or Linux with glibc 2.35+ and WebKitGTK 4.1 (Ubuntu 22.04+, Debian 12+).
Working on a server over SSH with no desktop? The README points to the community CC Switch CLI, which shares the same ~/.cc-switch data folder:
brew install cc-switch-cli
Nothing you already have gets lost
On first launch, CC Switch imports your existing Claude Code, Codex, Gemini CLI and Grok Build config as a provider called default, and adds an official provider for each tool. Before it rewrites any config file for the first time, it backs up the original to ~/.cc-switch/backups/live-first-write/.
It also only touches the key fields when you switch: endpoint, key, model and API protocol. Your plugins, hooks, permissions, MCP servers, your own environment variables and even comments in the file stay as they are. That is the main reason to use it over a shell script that overwrites the whole file.
Your first switch
1. Pick the tool in the sidebar (say, Claude Code).
2. Click "+" in the top right and choose a preset, or create a custom config.
3. Paste your API key and save.
4. Select the provider and click "Enable".
Claude Code picks up the change without a restart. Codex, Gemini CLI and Grok Build need you to restart the terminal or the CLI. Claude Desktop needs a full quit and reopen.
You can also switch from the system tray, which shows one row per tool with its current mode, provider and quota.
To go back to your subscription, switch to the built-in "Claude Official" provider and run /login in Claude Code. For Codex, use "OpenAI Official" and codex login.
Use GPT, Gemini or a local model inside Claude Code
Claude Code speaks the Anthropic Messages format. Many providers, and most local model servers, only offer an OpenAI-style Chat Completions endpoint. CC Switch handles this with Routing mode: it runs a local router on your machine that converts between Anthropic Messages, OpenAI Chat Completions, OpenAI Responses and Gemini's native format.
To set it up:
1. Edit the provider and open "Advanced Options".
2. Set "Upstream Format" to match the provider: "OpenAI Chat Completions" for Chat Completions only services (many local servers), "OpenAI Responses API" for Responses endpoints, or "Gemini Native generateContent" for Gemini.
3. On the Claude Code page, open the "Routing" tab and click "Start routing".
The README is direct about the failure mode: choosing the wrong format or forgetting to start routing usually gives you a 404 or 405.
While routing is on, your Claude Code config points at http://127.0.0.1:15721 with a placeholder key PROXY_MANAGED. That is expected. The real address and key live in CC Switch, and "Usage" in the sidebar shows "requested model to actual model" for each request. Quitting CC Switch writes your direct config back first, so Claude Code keeps working without it.
Routing also gives you auto-failover: set a queue of providers per tool, and when a request fails CC Switch moves to the next one. Note that official providers like Claude Official cannot go through routing.
Aggregation: several providers in one model picker
On the Claude Code and Codex pages there is also an "Aggregation" mode. Add a few providers and their models all appear in the tool's own model list, and each request goes to whichever provider owns the model you picked. Two caveats from the docs: aggregation does not do failover, and Claude Code needs version 2.1.243 or later. Switching models mid-session also rebuilds the prompt cache, so the first turn after a switch costs a bit more.
Gotchas
- The model resets after a switch. The model is a key field that belongs to the provider. If you change it with /model inside Claude Code, it lasts until your next switch. To keep it, edit the provider in CC Switch.
- "Connectivity check" passing does not mean your key works. It only checks the address is reachable. If requests fail, check the key, model name and upstream format, and read the request log under "Usage".
- WSL on Windows. Point the tool's config folder at the WSL path (for example \\wsl.localhost\Ubuntu\home\<user>\.claude) in "Settings, App config". For routing, switch WSL2 to mirrored networking, because 127.0.0.1 inside WSL cannot reach the router on Windows in the default NAT mode.
Bonus: one place for MCP, skills and prompts
CC Switch also has panels to add an MCP server or skill once and sync it to each tool, and a prompt library that writes to CLAUDE.md, AGENTS.md or GEMINI.md. Its usage dashboard tracks tokens, cache hit rate and spending per provider and model from each tool's local session logs, even with routing off.
CC Switch or a gateway?
CC Switch is for one developer on one machine who wants to flip providers without editing files. If you need a shared, server-side gateway for a team or an app, look at something like LiteLLM, which lets you call 100+ LLMs with one OpenAI-format API. We compare both kinds in the best AI repos for LLM gateways and routers.
The short version of this guide, with the exact steps and a prompt, lives on the Deduped page for switching Claude Code providers in one click.
---
Get one email every Monday with the week's hottest AI repos and exactly how to use them: subscribe free at dedupedai.com
现在一个桌面应用就能管理 Claude Code、Codex 和你跑的其他所有编程智能体的账号和设置
cc-switch 拿了 14.6 万颗星,就是因为大家不想再手动切来切去了
farion1231/cc-switch
3 likes · 1,579 views
3 Trending GitHub Repos: CC Switch, New API & LocalAI – Where Your AI Calls Go
Three repositories trending on GitHub today, explained in plain language: what each one does, how it works, who should try it, how to get started, and where the caveats are.
This edition is all about the plumbing between AI tools and AI models: a desktop app that switches providers for your coding agents in one click, a self-hosted gateway that puts one API in front of every model provider for a whole team, and an engine that runs models on your own hardware.
⏱ Chapters
0:00 Intro & this week in dev tools
1:39 CC Switch: one app for your coding agents
4:43 New API: a self-hosted AI gateway
8:03 LocalAI: run any model on your own hardware
11:11 Summary
📦 Repos
1. farion1231/cc-switch – CC Switch, by Jason Young (Rust · MIT)farion1231/cc-switch
2. QuantumNous/new-api – New API, by QuantumNous (Go · AGPL-3.0)QuantumNous/new-api
Docs: docs.newapi.ai
3. mudler/LocalAI – LocalAI, by Ettore Di Giacinto and the LocalAI team (Go · MIT)mudler/LocalAI
Docs: localai.io
📰 News mentioned
• OpenCode Console breach exposes stored API keys (Oct 17): techcrunch.com
• VS Code 1.142 adds agent Canvases (Oct 14): code.visualstudio.com
• GitHub open source license compliance generally available (Oct 16): github.blog
Star counts are as of 21 October 2026. Features and claims are as described in each project's README and release notes; try them in your own setup before relying on them.
If you found this useful, like and subscribe for the next round of trending repos.
#GitHub #OpenSource #AI #DeveloperTools #LLM
44 views
Mentions
Claude Code provider switch: a CC Switch tutorial in 5 minutes > This tutorial follows CC Switch v4.0.26 (November 2026). Button labels may change in later releases; the configuration model is stable. CC Switch moves Claude Code onto AIHubMix through one provider card, one API key, and one model ID, and Claude Code picks up the change without a restart in the usual case. The result is a working Claude Code session against AIHubMix, with your hooks, permissions, MCP configuration, and plugins still in ~/.claude/settings.json, and a card click to switch back. The engineering problem is not the switch. It is everything around it: the base URL path, the model ID the preset leaves out, and the ANTHROPIC_* exports in your shell profile that can override the file CC Switch just wrote. That last failure is quiet — no error about precedence, just requests going to the old endpoint. The short version: install CC Switch, create an AIHubMix key, choose the AiHubMix preset under Claude Code, paste the key, add ANTHROPIC_MODEL=claude-sonnet-5-5 to the provider, click Switch, and run claude -p "1+1, output only the answer" --model claude-sonnet-5-5. The sections below cover the parts that need judgment. What CC Switch is CC Switch is an open-source desktop app (MIT, Tauri + Rust + React) for managing provider configurations across Claude Code, Codex, Gemini CLI, OpenCode, and other coding tools. It ships more than 90 provider presets and supports custom providers. The repository and user manual are at farion1231/cc-switch. Three modes matter: - Direct mode rewrites the key fields in the client's configuration file and lets the client talk to the provider. - Routing mode runs a local gateway at 127.0.0.1:15721, with API-format conversion, failover, health checks, and request logs. - Aggregation mode puts models from several providers into one /model list. Download only from ccswitch.io or the GitHub Releases page. A site that asks for payment or account credentials is not an official source. Prerequisites - Claude Code, runnable from a terminal. Check with claude --version. If it is missing, use curl -fsSL https://claude.ai/install.sh | bash or npm i -g @anthropic-ai/claude-code with Node.js 22 or newer. - An AIHubMix account and API key. Create one in the AIHubMix console. The key usually starts with sk-. - A CC Switch installer from one of the official sources above. Step 1: Install CC Switch | OS | Install | |---|---| | macOS 12 Monterey or later | brew install --cask cc-switch, or the signed and notarized .dmg | | Windows 10 or later | The .msi installer, or the portable .zip | | Debian / Ubuntu | The .deb package | | Fedora / RPM distributions | The .rpm package | | Arch Linux | paru -S cc-switch-bin | | Other Linux | The .AppImage; requires glibc 2.35+ and WebKitGTK 4.1 | On first launch, CC Switch imports your existing Claude Code configuration as a provider named default and adds an official provider. Your original configuration is not lost, and you can switch back at any time. If Claude Code is not installed yet, the Apps page in CC Switch can install or upgrade it. Step 2: Create an AIHubMix API key Open the AIHubMix API keys page, create a key, and copy it. The placeholder AIHUBMIX_API_KEY in the documentation is not a real key. If you paste it verbatim, the request fails with 401 invalid key: AIHUBMIX_API_KEY. Step 3: Add AIHubMix to Claude Code 1. Select Claude Code in the left sidebar. 2. Click the + button in the top-right corner. 3. Search for AiHubMix, or find it under the third-party platforms category. 4. The name and endpoint are filled in automatically: https://aihubmix.com. Paste your key into API Key. 5. Click Add. The preset stores two environment variables: { "env": { "ANTHROPIC_API_KEY": "sk-your-key", "ANTHROPIC_BASE_URL": "https://aihubmix.com" } } The preset does not set a model. AIHubMix's guide treats ANTHROPIC_MODEL as a core variable, so add it to the same env block before you switch: { "env": { "ANTHROPIC_API_KEY": "sk-your-key", "ANTHROPIC_BASE_URL": "https://aihubmix.com", "ANTHROPIC_MODEL": "claude-sonnet-5-5" } } Without a model, Claude Code sends its own default model ID, which may not be one AIHubMix serves. Two details matter at this point. Do not append /v1 to the base URL. Claude Code speaks the Anthropic Messages protocol and builds the request path itself. https://aihubmix.com is correct. https://aihubmix.com/v1 is the OpenAI-compatible base for other clients; Claude Code would append its own /v1/messages to it. The preset uses ANTHROPIC_API_KEY; AIHubMix's own Claude Code guide uses ANTHROPIC_AUTH_TOKEN. AIHubMix accepts both: ANTHROPIC_AUTH_TOKEN sends a Bearer header, and ANTHROPIC_API_KEY sends x-api-key. Pick one, and do not fill both with different values. The setup details, model IDs, and error reference are in the AIHubMix Claude Code documentation. If the preset is missing — an older release, or a card you deleted — choose Custom Configuration and paste the JSON above. The provider card's endpoint manager can test latency, and the preset includes https://api.aihubmix.com as an alternate endpoint if aihubmix.com does not resolve. Step 4: Switch and verify On the Direct tab, click Switch on the AiHubMix card. The button changes to In use when the configuration has been written. Claude Code reloads the configuration automatically; a restart is not usually required. If the current session keeps using the old provider, exit and start it again. For quick changes, right-click the CC Switch icon in the system tray, open the Claude Code submenu, and click a provider. The submenu title shows the active provider and a quota summary. Focused commands Three commands cover the whole path: # CLI on PATH claude --version # end-to-end request through the configured provider claude -p "1+1, output only the answer" --model claude-sonnet-5-5 # stale exports that can override the written configuration grep -n "ANTHROPIC" ~/.zshrc ~/.bash_profile 2>/dev/null A response of 2 from the second command means the request reached AIHubMix. In an interactive session, the Anthropic base URL line in /status should show https://aihubmix.com. To go back to the official provider, switch to Claude Official, restart Claude Code, and complete the login flow. What the switch actually changes In direct mode, CC Switch replaces only the connection and compatibility fields in ~/.claude/settings.json: ANTHROPIC_*, AWS_*, protocol selectors such as CLAUDE_CODE_USE_BEDROCK, model, apiKeyHelper, and a few provider-scoped compatibility options such as CLAUDE_CODE_DISABLE_ARTIFACT and the context window. permissions, hooks, enabledPlugins, statusLine, MCP configuration, comments, and anything else you added stay in place. The exact list is in the configuration-file reference. Before the first rewrite of a tool's configuration, CC Switch backs up the original to ~/.cc-switch/backups/live-first-write/. If the JSON is malformed, it refuses to write, reports the line and column, and leaves the file unchanged. Provider configurations live in ~/.cc-switch/, with a SQLite database at its center. Automatic backups keep the most recent 10 by default, and WebDAV or S3-compatible sync is available. The database and exported backups include provider configurations, including keys, so treat them as secrets. Model aliases With ANTHROPIC_MODEL set, Claude Code's default is Sonnet 5.5. The /model aliases (opus, sonnet, haiku, fable) still need mapping before they resolve to AIHubMix's model IDs. Add these keys inside env: | Role | Variable | AIHubMix model ID | |---|---|---| | Default | ANTHROPIC_MODEL | claude-sonnet-5-5 | | Opus alias | ANTHROPIC_DEFAULT_OPUS_MODEL | claude-opus-5-5 | | Sonnet alias | ANTHROPIC_DEFAULT_SONNET_MODEL | claude-sonnet-5-5 | | Haiku alias | ANTHROPIC_DEFAULT_HAIKU_MODEL | claude-haiku-5-5 | | Fable alias | ANTHROPIC_DEFAULT_FABLE_MODEL | claude-fable-5-1 | The complete provider configuration then looks like this: { "env": { "ANTHROPIC_API_KEY": "sk-your-key", "ANTHROPIC_BASE_URL": "https://aihubmix.com", "ANTHROPIC_MODEL": "claude-sonnet-5-5", "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5", "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5", "ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-fable-5-1" } } Model selection priority, highest first: /model <name> → claude --model <name> → ANTHROPIC_MODEL → the model field in settings.json. Copy model IDs from the AIHubMix model list; they are case-sensitive. Failure modes and fixes Stale ANTHROPIC_* variables If you previously followed a manual setup guide and added export ANTHROPIC_BASE_URL=... or export ANTHROPIC_AUTH_TOKEN=... to ~/.zshrc or ~/.bash_profile, those variables may override the values CC Switch writes. The card says In use, but requests still go to the old endpoint. CC Switch detects the conflict. A yellow banner at the top of the window warns that environment variables may override your configuration; the details show the variable name, value, and source. Delete Selected removes them and writes a backup to ~/.cc-switch/backups/env-backup-<timestamp>.json first. To check manually, run the third command above. Comment out the old exports, then run source ~/.zshrc or open a new terminal. AIHubMix's own documentation recommends removing global ANTHROPIC_* variables when CC Switch manages the configuration. The full conflict workflow is in the environment-variable reference. Errors from AIHubMix The strings below are quoted from AIHubMix's Claude Code documentation. | Error | What to do | |---|---| | 401 no key provided | Check the base URL; clear stale env vars. | | 401 invalid key: AIHUBMIX_API_KEY | Use the real key, not the placeholder. | | 401 this key is not enabled | Check the key and quota in the console. | | 400 Incorrect model ID | Copy the full ID from the model list. | Non-error symptoms - Login screen or Not logged in: check /status; enable Skip Claude Code first-run confirmation under Settings → App config → Claude Code; restart; confirm the key is filled in. - The switch has no effect: a stale shell variable or cached session; open a new terminal or restart Claude Code. - The card's connection test passes but requests fail: the test checks reachability, not the key or model; run the end-to-end claude -p command. - You want the official provider back: switch to Claude Official, restart Claude Code, and log in again. - claude is not found on macOS: the official installer usually places it in ~/.local/bin/claude; add export PATH="$HOME/.local/bin:$PATH" to your shell profile and open a new terminal. When direct mode is not enough Direct mode is the right default for AIHubMix. The endpoint already speaks Anthropic Messages, so no protocol conversion is needed. Use routing when you want a failover queue, or when you need to put an OpenAI-format provider behind Claude Code. Routing points Claude Code at http://127.0.0.1:15721, replaces the key in the config with PROXY_MANAGED, and injects the real key from CC Switch. The app must stay running; quitting CC Switch writes the direct configuration back. Official Claude subscriptions do not go through routing; use direct mode for those. Use aggregation when you want models from several providers in one /model list. The default provider handles requests without a prefix; other providers' models appear with a ccs- prefix. Aggregation does not fail over. It is available for Claude Code and Codex only, and Claude official subscriptions are not supported in aggregation. The ccs- model list needs Claude Code 2.1.243 or newer. Claude Code picks up model-list changes immediately; Codex needs a full restart. What this walkthrough cannot verify for you - Your CC Switch build. The steps follow v4.0.26 (November 2026). Later releases can move button labels; the configuration model is stable. An older release may not ship the AiHubMix preset, in which case use Custom Configuration. - That Claude Code reloaded. The card shows the configuration was written. The /status base URL and the end-to-end command show the request path. If a session keeps the old provider, restart it. - The card's connection check. It tests reachability, not your API key or your model. A passing result is not an end-to-end pass. - Your account state. Check whether the key is enabled and has quota in the AIHubMix console; the error table gives the strings to look for. - Model IDs. Copy them from the AIHubMix model list, and keep the casing; they are case-sensitive. The card's connection check does not validate the model ID. - The error strings' provenance. They are quoted from AIHubMix's Claude Code documentation, not generated by your installation. - Download legitimacy. Only ccswitch.io and GitHub Releases are official download sources. A site that asks for payment or account credentials is not. Sources - CC Switch repository - CC Switch user manual: Add Provider - CC Switch user manual: Switch Provider - CC Switch user manual: Configuration Files - AIHubMix documentation: Claude Code
CC Switch で Claude Code の接続先を切り替える手順とハマりどころ :::note info この記事は AIHubMix が作成しました。CC Switch v4.0.26(2026年11月)時点の画面と設定を説明しています。以降のリリースではボタン名が変わることがありますが、設定の仕組みは安定しています。 ::: Claude Code の接続先をプロバイダー間で切り替えるとき、通常は ~/.claude/settings.json を編集します。ベース URL、API キー、場合によってはモデル。1つならまだ管理できますが、2つ、3つになると小さな保守作業になります。しかも失敗は静かです。シェルに残った ANTHROPIC_* の export が、直前に編集したファイルを上書きすることがあります。 CC Switch は、この切り替えをクリックできるカードにします。組み込みの AiHubMix プリセットがエンドポイントを埋め、API キーを1つ貼るだけです。Claude Code は通常、再起動なしで変更を読み込みます。本記事ではセットアップの全体、CC Switch が実際に書き換えるもの、環境変数の罠、direct モードで足りる場面を説明します。 TL;DR - CC Switch の AiHubMix プリセットなら、Claude Code の接続先はカードのクリックで切り替わります - プリセットが設定するのは ANTHROPIC_API_KEY と ANTHROPIC_BASE_URL の2つです。モデルは自分で追加します - ベース URL に /v1 は付けません。Claude Code は Anthropic Messages を話し、パスを自分で組み立てます - 切り替えが効かないように見える典型的な原因は、シェルプロファイルに残った ANTHROPIC_* の export です - 完了確認は claude -p "1+1, output only the answer" --model claude-sonnet-5-5 が 2 を返すことです CC Switch とは CC Switch は、Claude Code、Codex、Gemini CLI、OpenCode などのコーディングツールのプロバイダー設定を管理するオープンソースのデスクトップアプリです(MIT、Tauri + Rust + React)。90以上のプロバイダープリセットを同梱し、カスタムプロバイダーにも対応します。リポジトリとユーザーマニュアルは farion1231/cc-switch にあります。 単なるキーの切り替えツールではありません。3つのモードがあります。 - direct モード:クライアントの設定ファイルにあるキーのフィールドを書き換え、クライアントがプロバイダーと直接通信します。 - ルーティングモード:127.0.0.1:15721 でローカルゲートウェイを動かし、API 形式の変換、フェイルオーバー、ヘルスチェック、リクエストログを提供します。 - アグリゲーションモード:複数プロバイダーのモデルを1つの /model リストにまとめます。 配布元は ccswitch.io と GitHub Releases だけです。支払いやアカウント情報を求めるサイトは公式の配布元ではありません。 前提 - Claude Code がターミナルから実行できること。 claude --version で確認します。未インストールの場合は公式インストーラー curl -fsSL https://claude.ai/install.sh | bash、または Node.js 22以上の環境で npm i -g @anthropic-ai/claude-code を使います。 - AIHubMix のアカウントと API キー。 AIHubMix コンソール で作成します。キーは通常 sk- で始まります。 - CC Switch のインストーラー。 上記の公式配布元から取得します。 ステップ1:CC Switch をインストールする | OS | インストール方法 | |---|---| | macOS 12 Monterey 以降 | brew install --cask cc-switch、または署名・公証済みの .dmg | | Windows 10 以降 | .msi インストーラー、またはポータブル .zip | | Debian / Ubuntu | .deb パッケージ | | Fedora / RPM 系 | .rpm パッケージ | | Arch Linux | paru -S cc-switch-bin | | その他の Linux | .AppImage(glibc 2.35以上と WebKitGTK 4.1 が必要) | 初回起動時、CC Switch は既存の Claude Code 設定を default という名前のプロバイダーとしてインポートし、公式プロバイダーを追加します。元の設定は失われず、いつでも戻せます。 Claude Code がまだインストールされていない場合は、CC Switch の Apps ページからインストールまたはアップグレードできます。 ステップ2:AIHubMix の API キーを作成する AIHubMix の API キーページを開き、キーを作成してコピーします。 ドキュメント内のプレースホルダー AIHUBMIX_API_KEY は実際のキーではありません。そのまま貼り付けると、リクエストは 401 invalid key: AIHUBMIX_API_KEY で失敗します。 ステップ3:Claude Code に AIHubMix を追加する 1. 左サイドバーで Claude Code を選択します。 2. 右上の + ボタンをクリックします。 3. AiHubMix を検索するか、サードパーティプラットフォームのカテゴリから選びます。 4. 名前とエンドポイントが自動入力されます。https://aihubmix.com です。API Key にキーを貼り付けます。 5. Add をクリックします。 プリセットが保存する環境変数は2つです。 { "env": { "ANTHROPIC_API_KEY": "sk-your-key", "ANTHROPIC_BASE_URL": "https://aihubmix.com" } } プリセットはモデルを設定しません。AIHubMix のガイドは ANTHROPIC_MODEL を中心となる変数として扱っているため、切り替える前に同じ env ブロックへ追加します。 { "env": { "ANTHROPIC_API_KEY": "sk-your-key", "ANTHROPIC_BASE_URL": "https://aihubmix.com", "ANTHROPIC_MODEL": "claude-sonnet-5-5" } } モデルを設定しないと、Claude Code は自身のデフォルトモデル ID を送ります。それが AIHubMix の提供するモデルとは限りません。 ここで押さえておきたい点が2つあります。 ベース URL に /v1 を付けない。 Claude Code は Anthropic Messages プロトコルを話し、リクエストパスを自分で組み立てます。https://aihubmix.com が正解です。https://aihubmix.com/v1 は他のクライアント向けの OpenAI 互換ベースで、Claude Code はそこに自身の /v1/messages を追加してしまいます。 プリセットは ANTHROPIC_API_KEY を使い、AIHubMix 自身の Claude Code ガイドは ANTHROPIC_AUTH_TOKEN を使います。 AIHubMix はどちらも受け付けます。ANTHROPIC_AUTH_TOKEN は Bearer ヘッダーを送り、ANTHROPIC_API_KEY は x-api-key を送ります。どちらか一方を選び、異なる値で両方を埋めないでください。設定の詳細、モデル ID、エラーのリファレンスは AIHubMix の Claude Code ドキュメント にあります。 プリセットが見つからない場合(古いリリース、またはカードを削除した場合)は、Custom Configuration を選び、上の JSON を貼り付けます。プロバイダーカードのエンドポイントマネージャーはレイテンシーをテストできます。プリセットには、aihubmix.com が解決できない場合の代替エンドポイント https://api.aihubmix.com も含まれています。 ステップ4:切り替えて確認する Direct タブで AiHubMix カードの Switch をクリックします。設定の書き込みが完了すると、ボタンは In use に変わります。 Claude Code は設定を自動で再読み込みします。通常、再起動は不要です。現在のセッションが古いプロバイダーを使い続ける場合は、いったん終了して起動し直します。 エンドツーエンドの経路を確認します。 claude -p "1+1, output only the answer" --model claude-sonnet-5-5 2 が返れば、リクエストは AIHubMix に届いています。対話セッションでは、/status の Anthropic base URL 行が https://aihubmix.com を示すはずです。 素早く切り替えたいときはシステムトレイを使います。CC Switch のアイコンを右クリックし、Claude Code サブメニューでプロバイダーをクリックします。サブメニューのタイトルには、有効なプロバイダーとクォータの概要が表示されます。 公式プロバイダーに戻すには、Claude Official に切り替え、Claude Code を再起動し、ログインフローを完了します。 切り替えが実際に変えるもの direct モードでは、CC Switch は ~/.claude/settings.json の接続と互換性のフィールドだけを置き換えます。ANTHROPIC_*、AWS_*、CLAUDE_CODE_USE_BEDROCK のようなプロトコルセレクター、model、apiKeyHelper、そして CLAUDE_CODE_DISABLE_ARTIFACT やコンテキストウィンドウのようなプロバイダー単位の互換オプションです。 permissions、hooks、enabledPlugins、statusLine、MCP 設定、コメント、その他追加したものはそのまま残ります。正確なリストは 設定ファイルのリファレンス にあります。 ツール設定の初回書き換えの前に、CC Switch は元のファイルを ~/.cc-switch/backups/live-first-write/ にバックアップします。JSON が壊れている場合は書き込みを拒否し、行と列を報告し、ファイルを変更しません。 モデルエイリアスを設定する ANTHROPIC_MODEL を設定すると、Claude Code のデフォルトは Sonnet 5.5 になります。/model のエイリアス(opus、sonnet、haiku、fable)は、AIHubMix のモデル ID に解決するために別途マッピングが必要です。env の中に次のキーを追加します。 | 役割 | 変数 | AIHubMix のモデル ID | |---|---|---| | デフォルト | ANTHROPIC_MODEL | claude-sonnet-5-5 | | Opus エイリアス | ANTHROPIC_DEFAULT_OPUS_MODEL | claude-opus-5-5 | | Sonnet エイリアス | ANTHROPIC_DEFAULT_SONNET_MODEL | claude-sonnet-5-5 | | Haiku エイリアス | ANTHROPIC_DEFAULT_HAIKU_MODEL | claude-haiku-5-5 | | Fable エイリアス | ANTHROPIC_DEFAULT_FABLE_MODEL | claude-fable-5-1 | プロバイダー設定の全体は次のようになります。 { "env": { "ANTHROPIC_API_KEY": "sk-your-key", "ANTHROPIC_BASE_URL": "https://aihubmix.com", "ANTHROPIC_MODEL": "claude-sonnet-5-5", "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5", "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5", "ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-fable-5-1" } } モデル選択の優先順位は、高い順に /model <name> → claude --model <name> → ANTHROPIC_MODEL → settings.json の model フィールドです。モデル ID は AIHubMix のモデル一覧 からコピーしてください。大文字と小文字は区別されます。 ハマりどころ カードは In use なのに、リクエストが古いエンドポイントへ行く 以前に手動セットアップのガイドに従い、export ANTHROPIC_BASE_URL=... や export ANTHROPIC_AUTH_TOKEN=... を ~/.zshrc や ~/.bash_profile に追加した場合、それらの変数が CC Switch が書き込んだ値を上書きすることがあります。カードを AIHubMix に切り替えても、リクエストは古いエンドポイントへ送られます。 CC Switch はこの競合を検出します。ウィンドウ上部の黄色いバナーが、環境変数が設定を上書きする可能性を警告し、詳細には変数名、値、ソースが表示されます。Delete Selected を押すとそれらが削除され、その前に ~/.cc-switch/backups/env-backup-<timestamp>.json へバックアップが書き込まれます。 手動で確認するには、次のコマンドを実行します。 grep -n "ANTHROPIC" ~/.zshrc ~/.bash_profile 2>/dev/null 古い export をコメントアウトし、source ~/.zshrc を実行するか新しいターミナルを開きます。AIHubMix のドキュメントも、CC Switch が設定を管理する場合はグローバルの ANTHROPIC_* 変数を削除することを推奨しています。競合のワークフロー全体は 環境変数のリファレンス にあります。 ベース URL に /v1 を付けてしまう https://aihubmix.com が正解です。https://aihubmix.com/v1 は他のクライアント向けの OpenAI 互換ベースで、Claude Code はそこに自身の /v1/messages を追加してしまいます。Claude Code は Anthropic Messages を話し、パスを自分で組み立てるため、OpenAI 互換のベースを渡す場所ではありません。 接続テストが通ってもリクエストが失敗する カードの接続テストは、エンドポイントに到達できるかだけを確認します。API キーやモデルは検証しません。テストが通っても、キーが無効だったりモデル ID が間違っていたりすれば、リクエストは失敗します。最終確認は claude -p のエンドツーエンド実行です。 モデル ID が設定されていない、または一致しない プリセットはモデルを設定しません。ANTHROPIC_MODEL を追加しないと、Claude Code は自身のデフォルトモデル ID を送ります。それが AIHubMix の提供するモデルとは限りません。400 Incorrect model ID が返る場合は、モデル一覧から完全な ID をコピーしてください。大文字と小文字は区別されます。 ログイン画面が出る、または Not logged in と表示される /status を確認します。Settings → App config → Claude Code の Skip Claude Code first-run confirmation を有効にし、再起動し、キーが入力されていることを確認します。 macOS で claude コマンドが見つからない 公式インストーラーは通常、claude を ~/.local/bin/claude に配置します。シェルプロファイルに export PATH="$HOME/.local/bin:$PATH" を追加し、新しいターミナルを開きます。 AIHubMix が返すエラー 次の文字列は AIHubMix の Claude Code ドキュメントからの引用です。 | エラー | 対処 | |---|---| | 401 no key provided | ベース URL を確認し、古い環境変数を消します | | 401 invalid key: AIHUBMIX_API_KEY | プレースホルダーではなく実際のキーを使います | | 401 this key is not enabled | コンソールでキーとクォータを確認します | | 400 Incorrect model ID | モデル一覧から完全な ID をコピーします | ルーティングとアグリゲーションが必要なとき AIHubMix では direct モードを使うのが基本です。エンドポイントはすでに Anthropic Messages を話すため、プロトコル変換は不要です。 ルーティングは、フェイルオーバーのキューが必要なとき、または OpenAI 形式のプロバイダーを Claude Code の背後に置きたいときに使います。Claude Code の接続先を http://127.0.0.1:15721 に向け、設定内のキーを PROXY_MANAGED に置き換え、実際のキーは CC Switch から注入します。アプリは動かし続ける必要があり、CC Switch を終了すると direct の設定が書き戻されます。公式の Claude サブスクリプションはルーティングを通りません。それらには direct モードを使ってください。 アグリゲーションは、複数プロバイダーのモデルを1つの /model リストにまとめたいときに使います。デフォルトプロバイダーがプレフィックスなしのリクエストを処理し、他のプロバイダーのモデルは ccs- プレフィックス付きで表示されます。フェイルオーバーは行いません。Claude Code と Codex のみで利用でき、Claude の公式サブスクリプションはサポートされません。ccs- のモデルリストには Claude Code 2.1.243以降が必要です。Claude Code はモデルリストの変更を即座に反映しますが、Codex は完全な再起動が必要です。 この記事で確認できないこと - CC Switch のビルド。 手順は v4.0.26(2026年11月)に基づきます。以降のリリースではボタン名が変わる可能性がありますが、設定の仕組みは安定しています。古いリリースに AiHubMix プリセットがない場合は Custom Configuration を使います。 - Claude Code が再読み込みしたか。 カードは設定が書き込まれたことを示します。リクエスト経路は /status とエンドツーエンドのコマンドで確認します。セッションが古いプロバイダーを保持する場合は再起動します。 - カードの接続確認。 到達性だけをテストし、API キーやモデルは検証しません。合格はエンドツーエンドの合格ではありません。 - アカウントの状態とモデル ID。 キーが有効でクォータがあるかは AIHubMix コンソールで確認します。モデル ID はモデル一覧からコピーし、大文字小文字を保ちます。カードの接続確認はモデル ID を検証しません。 - エラー文字列の出典。 AIHubMix の Claude Code ドキュメントからの引用で、読者の環境が生成したものではありません。 - 配布元の正当性。 ccswitch.io と GitHub Releases だけが公式の配布元です。支払いやアカウント情報を求めるサイトは公式ではありません。 まとめ - CC Switch の AiHubMix プリセットは、ベース URL と API キーの2つを設定します。モデルは自分で追加します - ベース URL は https://aihubmix.com です。/v1 は付けません - シェルに残った ANTHROPIC_* の export は、書き込まれた設定を上書きすることがあります - In use は書き込みの完了を示します。リクエスト経路は /status と claude -p で確認します - AIHubMix では direct モードで足ります。ルーティングとアグリゲーションは別の要件に答えます AIHubMix の Claude Code エンドポイントは https://aihubmix.com です。API キーを作成して AiHubMix カードに貼り付け、claude -p の確認で 2 が返るところまで進めてください。 参考 1. CC Switch repository(GitHub) 2. CC Switch ユーザーマニュアル: Add Provider(CC Switch) 3. CC Switch ユーザーマニュアル: Switch Provider(CC Switch) 4. CC Switch ユーザーマニュアル: Configuration Files(CC Switch) 5. AIHubMix ドキュメント: Claude Code(AIHubMix)
还在手动切换 Claude Code、Codex 和其他编码代理? 现在,一款桌面应用可以统一管理它们的账户与设置,让切换工具变得像切换标签一样简单 cc-switch 已获得 146k 颗星,背后原因很简单:开发者们早就厌倦了反复登录和手动配置 了解更多 farion1231/cc-switch
@lidangzzz 用简洁的 GUI 管理多个 Agent 应用的供应商、用量、会话历史、MCP、Skills,稳定、原生、低侵入 farion1231/cc-switch
5 popular Claude Code repos, ranked by GitHub stars #shorts Five popular Claude Code related repos by GitHub stars (checked 2026-10-22): anthropics/claude-code 152.9k, farion1231/cc-switch 147.6k, garrytan/gstack 137.3k, stablyai/orca 102.5k, thedotmack/claude-mem 102.3k. This is a hand-picked list, not a complete ranking of GitHub. anthropics/claude-code farion1231/cc-switch garrytan/gstack stablyai/orca thedotmack/claude-mem Independent tutorial channel. Not affiliated with or endorsed by Anthropic.
cc-switch: The Hottest Rust Repo on GitHub Right Now #Shorts In this video, we break down farion1231/cc-switch - one of the hottest open-source projects on GitHub right now. A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io. It has already earned 147,675 stars on GitHub and is written primarily in Rust. We look at what it does, why developers are paying attention to it right now, and who should try it. 📂 Repo: farion1231/cc-switch 🌐 Stars: 147,675 | Language: Rust | Forks: 9,726 🔔 Subscribe for daily picks of the hottest GitHub repos: / @reporadar #github #opensource #programming keywords: coding, developer tools, github, opensource, programming, software, tech #Shorts
cc-switch: The Hottest Rust Repo on GitHub Right Now In this video, we break down farion1231/cc-switch - one of the hottest open-source projects on GitHub right now. A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io. It has already earned 147,675 stars on GitHub and is written primarily in Rust. We look at what it does, why developers are paying attention to it right now, and who should try it. 📂 Repo: farion1231/cc-switch 🌐 Stars: 147,675 | Language: Rust | Forks: 9,726 🔔 Subscribe for daily picks of the hottest GitHub repos: / @reporadar #github #opensource #programming keywords: coding, developer tools, github, opensource, programming, software, tech
How to switch Claude Code between API providers in one click with CC Switch (and run GPT in it) If you use Claude Code with more than one API provider, you know the routine: open ~/.claude/settings.json, swap the base URL, swap the key, swap the model, hope you did not break the JSON, and do it again tomorrow when you hit a limit. Multiply that by Codex and Gemini CLI, which each keep their own config in their own format, and switching becomes a chore you avoid. CC Switch is a desktop app for Windows, macOS and Linux that does this in one click. Pick a preset, paste a key, press Enable. It manages Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes Agent, Pi, MiniMax Code, Kimi Code and Oh My Pi, and the README lists 90+ provider presets, including AWS Bedrock and NVIDIA NIM. This guide covers install, your first switch, running GPT or local models inside Claude Code through its routing mode, and the details that trip people up. Install macOS (Homebrew is the recommended route): brew install --cask cc-switch Update later with: brew upgrade --cask cc-switch The macOS build is universal (Apple Silicon and Intel) and is signed and notarized. On Arch Linux: paru -S cc-switch-bin Windows and other Linux users download the .msi, .deb, .rpm or .AppImage from the repo's Releases page. Requirements per the README: Windows 10+, macOS 12+, or Linux with glibc 2.35+ and WebKitGTK 4.1 (Ubuntu 22.04+, Debian 12+). Working on a server over SSH with no desktop? The README points to the community CC Switch CLI, which shares the same ~/.cc-switch data folder: brew install cc-switch-cli Nothing you already have gets lost On first launch, CC Switch imports your existing Claude Code, Codex, Gemini CLI and Grok Build config as a provider called default, and adds an official provider for each tool. Before it rewrites any config file for the first time, it backs up the original to ~/.cc-switch/backups/live-first-write/. It also only touches the key fields when you switch: endpoint, key, model and API protocol. Your plugins, hooks, permissions, MCP servers, your own environment variables and even comments in the file stay as they are. That is the main reason to use it over a shell script that overwrites the whole file. Your first switch 1. Pick the tool in the sidebar (say, Claude Code). 2. Click "+" in the top right and choose a preset, or create a custom config. 3. Paste your API key and save. 4. Select the provider and click "Enable". Claude Code picks up the change without a restart. Codex, Gemini CLI and Grok Build need you to restart the terminal or the CLI. Claude Desktop needs a full quit and reopen. You can also switch from the system tray, which shows one row per tool with its current mode, provider and quota. To go back to your subscription, switch to the built-in "Claude Official" provider and run /login in Claude Code. For Codex, use "OpenAI Official" and codex login. Use GPT, Gemini or a local model inside Claude Code Claude Code speaks the Anthropic Messages format. Many providers, and most local model servers, only offer an OpenAI-style Chat Completions endpoint. CC Switch handles this with Routing mode: it runs a local router on your machine that converts between Anthropic Messages, OpenAI Chat Completions, OpenAI Responses and Gemini's native format. To set it up: 1. Edit the provider and open "Advanced Options". 2. Set "Upstream Format" to match the provider: "OpenAI Chat Completions" for Chat Completions only services (many local servers), "OpenAI Responses API" for Responses endpoints, or "Gemini Native generateContent" for Gemini. 3. On the Claude Code page, open the "Routing" tab and click "Start routing". The README is direct about the failure mode: choosing the wrong format or forgetting to start routing usually gives you a 404 or 405. While routing is on, your Claude Code config points at http://127.0.0.1:15721 with a placeholder key PROXY_MANAGED. That is expected. The real address and key live in CC Switch, and "Usage" in the sidebar shows "requested model to actual model" for each request. Quitting CC Switch writes your direct config back first, so Claude Code keeps working without it. Routing also gives you auto-failover: set a queue of providers per tool, and when a request fails CC Switch moves to the next one. Note that official providers like Claude Official cannot go through routing. Aggregation: several providers in one model picker On the Claude Code and Codex pages there is also an "Aggregation" mode. Add a few providers and their models all appear in the tool's own model list, and each request goes to whichever provider owns the model you picked. Two caveats from the docs: aggregation does not do failover, and Claude Code needs version 2.1.243 or later. Switching models mid-session also rebuilds the prompt cache, so the first turn after a switch costs a bit more. Gotchas - The model resets after a switch. The model is a key field that belongs to the provider. If you change it with /model inside Claude Code, it lasts until your next switch. To keep it, edit the provider in CC Switch. - "Connectivity check" passing does not mean your key works. It only checks the address is reachable. If requests fail, check the key, model name and upstream format, and read the request log under "Usage". - WSL on Windows. Point the tool's config folder at the WSL path (for example \\wsl.localhost\Ubuntu\home\<user>\.claude) in "Settings, App config". For routing, switch WSL2 to mirrored networking, because 127.0.0.1 inside WSL cannot reach the router on Windows in the default NAT mode. Bonus: one place for MCP, skills and prompts CC Switch also has panels to add an MCP server or skill once and sync it to each tool, and a prompt library that writes to CLAUDE.md, AGENTS.md or GEMINI.md. Its usage dashboard tracks tokens, cache hit rate and spending per provider and model from each tool's local session logs, even with routing off. CC Switch or a gateway? CC Switch is for one developer on one machine who wants to flip providers without editing files. If you need a shared, server-side gateway for a team or an app, look at something like LiteLLM, which lets you call 100+ LLMs with one OpenAI-format API. We compare both kinds in the best AI repos for LLM gateways and routers. The short version of this guide, with the exact steps and a prompt, lives on the Deduped page for switching Claude Code providers in one click. --- Get one email every Monday with the week's hottest AI repos and exactly how to use them: subscribe free at dedupedai.com
现在一个桌面应用就能管理 Claude Code、Codex 和你跑的其他所有编程智能体的账号和设置 cc-switch 拿了 14.6 万颗星,就是因为大家不想再手动切来切去了 farion1231/cc-switch
3 Trending GitHub Repos: CC Switch, New API & LocalAI – Where Your AI Calls Go Three repositories trending on GitHub today, explained in plain language: what each one does, how it works, who should try it, how to get started, and where the caveats are. This edition is all about the plumbing between AI tools and AI models: a desktop app that switches providers for your coding agents in one click, a self-hosted gateway that puts one API in front of every model provider for a whole team, and an engine that runs models on your own hardware. ⏱ Chapters 0:00 Intro & this week in dev tools 1:39 CC Switch: one app for your coding agents 4:43 New API: a self-hosted AI gateway 8:03 LocalAI: run any model on your own hardware 11:11 Summary 📦 Repos 1. farion1231/cc-switch – CC Switch, by Jason Young (Rust · MIT)farion1231/cc-switch 2. QuantumNous/new-api – New API, by QuantumNous (Go · AGPL-3.0)QuantumNous/new-api Docs: docs.newapi.ai 3. mudler/LocalAI – LocalAI, by Ettore Di Giacinto and the LocalAI team (Go · MIT)mudler/LocalAI Docs: localai.io 📰 News mentioned • OpenCode Console breach exposes stored API keys (Oct 17): techcrunch.com • VS Code 1.142 adds agent Canvases (Oct 14): code.visualstudio.com • GitHub open source license compliance generally available (Oct 16): github.blog Star counts are as of 21 October 2026. Features and claims are as described in each project's README and release notes; try them in your own setup before relying on them. If you found this useful, like and subscribe for the next round of trending repos. #GitHub #OpenSource #AI #DeveloperTools #LLM