# CC Switch with QCode: Windows & macOS Walkthrough


**Short answer**: In CC Switch v4.0.38 on Windows or macOS, click `+ 添加供应商` (+ Add provider) at the top right and select `自定义配置` (Custom configuration); enter `https://api.qcode.cc/api` for Claude Code's `请求地址` (Endpoint URL) and `https://api.qcode.cc/openai` for Codex's `API 请求地址` (API Endpoint URL), paste your `cr_` key, and click `添加` (Add) to activate it immediately.

| Item | Fill in |
|---|---|
| Claude Code endpoint URL | `https://api.qcode.cc/api` |
| Codex API endpoint URL | `https://api.qcode.cc/openai` |
| API key format | `cr_xxxxxxxx` |
| Save button | `添加` (Add) |

Checked on 2026-11-22 · CC Switch v4.0.38 · Windows 11


Follow the screenshots below one step at a time and about fifteen minutes later you will be managing both Claude Code and Codex from CC Switch's graphical interface: both tools will route through QCode without hand-editing `settings.json` or `config.toml`, and switching providers later takes just one click in CC Switch.


- **Applies to**: Windows 10 / 11 (64-bit); see the separate section near the end for macOS / Linux
- **Software version**: CC Switch v4.0.38 (released 2026-11-21)
- **Screenshots updated**: 2026-11
- **Time needed**: 15 minutes (allow a bit longer if the download is slow)
- **You will need**: a QCode API key starting with `cr_`; Claude Code CLI or Codex CLI already installed


> **On a Mac?** Follow the same steps. The screenshots were taken on Windows 11, and CC Switch on macOS has the same screens and settings. Download the macOS version from the same official page, press ⌘ Cmd wherever a step says Ctrl, and find the app's menus in the menu bar at the top of the screen. The **Installing on other operating systems** section of this page has the commands that differ.


- Your computer runs Windows 10 / 11 (64-bit) or macOS and can open a browser and a command line (Windows PowerShell on Windows)
- You have already signed up for QCode.cc and copied an API key starting with `cr_` from the [Dashboard](https://qcode.cc/en/dashboard). No account yet? [Sign up for QCode](https://qcode.cc/en/auth/sign-up?utm_source=docs.qcode.cc&utm_medium=tut_before&utm_campaign=knowledge_base&src=docs-ide-cc-switch-before) first, pick a plan on the [pricing page](https://qcode.cc/en/pricing?utm_source=docs.qcode.cc&utm_medium=tut_before&utm_campaign=knowledge_base&src=docs-ide-cc-switch-before), then create a key in the [Dashboard](https://qcode.cc/en/dashboard).
- Claude Code CLI or Codex CLI is already installed, and running `claude --version` or `codex --version` in PowerShell prints a version number
- You can reach `ccswitch.io` and `github.com`; if either will not open, check the region notes under Download and install below
- Set aside 15 uninterrupted minutes and do not close the setup wizard while it is installing


Having only one of the two CLIs installed is fine: this guide configures Claude Code and Codex separately, so you can set up only the one you need. CC Switch only writes config files and is not an inference endpoint itself.

## Download and install

The Windows build of CC Switch is an `.msi` installer. Download only from two official sources: the official website **ccswitch.io** and GitHub Releases. The website links straight to GitHub's Assets list, so both deliver the exact same file.

The main difference between regions is **which download channel opens cleanly**. Pick your region first:

**Europe / Japan**

- Open **[ccswitch.io/zh/](https://ccswitch.io/zh/)** or the English download page, click the primary download button, then click `下载 Windows 版 · 19.6 MB` (Download for Windows · 19.6 MB).
- If the website link does not open, use the v4.0.38 page on **[GitHub Releases](https://github.com/farion1231/cc-switch/releases/tag/v4.0.38)** and pick `CC-Switch-v4.0.38-Windows.msi` under Assets.
- You can also install via winget: `winget install farion1231.CC-Switch`.
- Standard PCs use the x64 installer; Windows on ARM devices use the file whose name includes `arm64`.


**Mainland China**

- Open **[ccswitch.io/zh/](https://ccswitch.io/zh/)**, click the primary download button above the fold, then click `下载 Windows 版 · 19.6 MB` (Download for Windows · 19.6 MB).
- If the website will not open or the download stalls, go straight to the v4.0.38 page on **[GitHub Releases](https://github.com/farion1231/cc-switch/releases/tag/v4.0.38)** and pick `CC-Switch-v4.0.38-Windows.msi` under Assets. GitHub access can be intermittent, so retrying later usually finishes; you can also download [CC-Switch-v4.0.38-Windows.msi](https://github.com/farion1231/cc-switch/releases/download/v4.0.38/CC-Switch-v4.0.38-Windows.msi) directly.
- You can also try winget first: `winget install farion1231.CC-Switch`. If winget is unavailable, fall back to the two official entry points above.
- Standard Intel / AMD PCs use the x64 installer (the file name without `arm64`); only Windows on ARM machines need the `arm64` build.


**Russia / Iran / Arab countries**

- Try the v4.0.38 page on **[GitHub Releases](https://github.com/farion1231/cc-switch/releases/tag/v4.0.38)** first and pick `CC-Switch-v4.0.38-Windows.msi` under Assets; it is the official release page and carries the same file as the website.
- If GitHub will not open, go back to **[ccswitch.io/zh/](https://ccswitch.io/zh/)** and click the primary download button; if neither route works, try winget: `winget install farion1231.CC-Switch`.
- Download only from these two official sources. Any "CC Switch" website or client asking for payment, top-ups, or login credentials is fake.
- Standard PCs use the x64 installer; Windows on ARM devices use the file whose name includes `arm64`.


Once downloaded, the installer is about 19.6 MB. The setup wizard is in English, with only 5 screens and three buttons: `Next`, `Install`, and `Finish`. It installs per-user, so it **does not need administrator privileges and will not trigger a User Account Control prompt**.

## Follow the screenshots: Windows, one step at a time

The 20 steps below each do one thing. The orange numbers on the screenshots (①, ②…) match the numbers in the text one to one — when you see a number, look at the same spot in the image.



### Open the CC Switch website

Enter `ccswitch.io/zh/` in your browser address bar to open the [Chinese homepage](https://ccswitch.io/zh/). Click the primary download button pointed to by ①.

![CC Switch official Chinese homepage highlighting the primary download button above the fold](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/01-site-home.webp)


Done right you will see: the page scrolls to the download section and displays the `下载 Windows 版 · 19.6 MB` (Download for Windows · 19.6 MB) button.




### Download the Windows installer

The download page shows the latest version v4.0.38 (2026-11-21). Click ① `下载 Windows 版 · 19.6 MB` (Download for Windows · 19.6 MB) — this defaults to the x64 installer for standard Intel / AMD PCs; lower on the page you can switch to the portable `.zip` or the ARM64 build.

![CC Switch download page showing v4.0.38, with the Download for Windows 19.6 MB button highlighted](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/02-site-download.webp)


Done right you will see: the browser starts downloading a file whose name begins with `CC-Switch-v4.0.38-Windows`.


**Stuck? Clicking the download button on the website does nothing**

The website forwards the download to GitHub. Open the v4.0.38 page on [GitHub Releases](https://github.com/farion1231/cc-switch/releases/tag/v4.0.38) directly, find `CC-Switch-v4.0.38-Windows.msi` in the Assets list at the bottom, and click it there — see the next step.




### If the website will not open, download from GitHub

In the Assets list at the bottom of the [GitHub Releases](https://github.com/farion1231/cc-switch/releases/tag/v4.0.38) page, click the x64 file `CC-Switch-v4.0.38-Windows.msi` (19.6 MB) at ①. It is normal that the filename does not include `x64`; the `arm64` file is for Windows on ARM, and `Portable.zip` is the no-install archive.

![GitHub Releases Assets list highlighting x64 CC-Switch-v4.0.38-Windows.msi alongside arm64 and Portable.zip](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/03-github-assets.webp)


Done right you will see: the browser starts downloading `CC-Switch-v4.0.38-Windows.msi`, about 19.6 MB in size.


**Stuck? Not sure which file to download**

Most PCs (Intel and AMD) should pick `CC-Switch-v4.0.38-Windows.msi` — the one **without** `arm64` in its name. Only Windows on ARM devices need the `arm64` build.




### Click Keep in Edge

Edge holds uncommon `.msi` downloads at first with the warning `通常不会下载` (isn't commonly downloaded). Click ① `保留` (Keep) so the download proceeds. This is neither a malware alert nor a corrupted file.

![Edge download bar showing the uncommon download warning with the Keep button highlighted](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/04-edge-keep.webp)


Done right you will see: the warning disappears and the `.msi` file appears as downloading in the downloads list.




### Confirm the download finished

Open your Downloads folder and check that the file at ① has finished downloading and is 19.6 MB. Its filename should match the one you clicked.

![Completed download card in Edge showing the CC-Switch MSI installer at 19.6 MB](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/05-download-done.webp)


Done right you will see: an installer icon, a filename ending in `.msi`, and a size of 19.6 MB.




### Open the setup wizard

Double-click the downloaded `.msi`. The first screen of the setup wizard is an English welcome page; click `Next` at ①.

![CC Switch MSI setup wizard welcome screen with the Next button highlighted](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/06-installer-welcome.webp)


Done right you will see: the window title is the CC Switch setup wizard, with a `Next` button at the bottom.




### Keep the default install folder

This screen selects the destination folder. The default path is under your user profile (`AppData\Local\Programs\CC Switch`) — leave it as is; no administrator privileges are required. Confirm that `Create a desktop shortcut` at ① is checked, then click `Next`.

![Destination folder screen showing the per-user install path and the checked Create a desktop shortcut box highlighted](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/07-installer-destination.webp)


Done right you will see: the path field shows `...\AppData\Local\Programs\CC Switch`, and `Create a desktop shortcut` below it is checked.




### Click Install to begin

The confirmation screen summarizes the install folder and shortcut. Click `Install` at ① to start installing.

![Setup wizard Ready to install screen with the Install button highlighted](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/08-installer-ready.webp)


Done right you will see: the button becomes disabled and a progress bar appears.




### Wait for the progress bar to finish

Installation takes only a few seconds. Wait for the progress bar to complete and do not close the window while it runs.

![Setup wizard installation progress bar screen](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/09-installer-installing.webp)


Done right you will see: the progress bar fills completely and advances automatically to the completion screen.




### Finish installing and launch the app

On the completion screen, `Launch CC Switch` at ① is checked by default. Keep it checked and click `Finish` at ② so the app opens right away.

![Setup completion screen highlighting the checked Launch CC Switch box and the Finish button](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/10-installer-finish.webp)


Done right you will see: the setup wizard closes and the main CC Switch window opens.




### Dismiss the first-launch notice

The first launch shows a notice explaining that any existing Claude / Codex config is backed up automatically as a `default` provider, while the official providers remain in the list. Click ① `我知道了` (Got it).

![CC Switch first-launch notice dialog with the Got it button highlighted](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/11-first-launch.webp)


Done right you will see: the dialog closes and the main CC Switch interface appears.




### Check the tool list in the left sidebar

The left sidebar lists the tools CC Switch can manage. This guide uses only ① `Claude Code` and ② `Codex`. Click ① first to open the Claude Code page.

![CC Switch main sidebar highlighting Claude Code and Codex](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/12-main-sidebar.webp)


Done right you will see: the heading on the right changes to `Claude Code`, displaying the provider card list.




### Add a Claude Code provider

On the Claude Code page, click `+ 添加供应商` (+ Add provider) at the top right. A full page of preset cards opens (not a dropdown); click ① `自定义配置` (Custom configuration, subtitled `手动填写请求地址和 API Key` — Manually enter endpoint URL and API key).

![Add provider preset picker page highlighting the first Custom configuration card](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/13-claude-preset-picker.webp)


Done right you will see: the page heading changes to `添加供应商 Claude Code` (Add provider Claude Code), with input fields for Name, API Key, and Endpoint URL below.


**Stuck? Cannot find the Custom configuration card**

It is the very first card in the preset list, labeled `自定义配置` with the subtitle `手动填写请求地址和 API Key` (Manually enter endpoint URL and API key). If another card is at the top of the viewport, scroll back up to the top of the list.




### Fill in the three Claude Code fields

For ① `名称` (Name), enter `QCode.cc`; for ② `API Key`, paste your `cr_` key (the input masks it as dots); for ③ `请求地址` (Endpoint URL), enter `https://api.qcode.cc/api` — do **not** add a trailing `/` or `/v1`.

![Claude Code custom configuration form: Name QCode.cc, masked API Key, and Endpoint URL https://api.qcode.cc/api](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/14-claude-custom-form.webp)


Done right you will see: Name reads `QCode.cc`, the API Key box shows a row of dots, and the Endpoint URL displays `https://api.qcode.cc/api` in full.


**Need an API key?**

If you do not have a QCode account yet, [Sign up](https://qcode.cc/en/auth/sign-up?utm_source=docs.qcode.cc&utm_medium=tut_key_step&utm_campaign=knowledge_base&src=docs-ide-cc-switch-key) first. If you prefer not to subscribe monthly, start with a [Pay-as-you-go Pack](https://qcode.cc/en/pay-as-you-go?utm_source=docs.qcode.cc&utm_medium=tut_key_step&utm_campaign=knowledge_base&src=docs-ide-cc-switch-key), then create a key in the [Dashboard](https://qcode.cc/en/dashboard) and copy the string starting with `cr_` back here. You can pay by credit/debit card (Visa / Mastercard), Apple Pay / Google Pay, or cryptocurrency — see [Payment methods](/docs/reference/payment-methods).




### Click Add and confirm it is active

The button at the bottom right of the form is `添加` (Add). Click it to save — there is no separate `启用` (Enable) button to look for: on the ① `QCode.cc` card, ② immediately shows `使用中` (In use), and the title bar updates to `直连 · QCode.cc` (Direct · QCode.cc). Your endpoint URL and key are now written to `~/.claude/settings.json`.

![Claude Code page after saving: QCode.cc card showing In use status and title bar reading Direct · QCode.cc](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/15-claude-enabled.webp)


Done right you will see: the `QCode.cc` card displays `使用中` (In use), and the top title reads `直连 · QCode.cc` (Direct · QCode.cc).




### Fill in the Codex provider

Click `Codex` in the left sidebar, click `+ 添加供应商` (+ Add provider) at the top right, and choose `自定义配置` (Custom configuration) again. Enter `qcode` for Name; for ① `API 请求地址` (API Endpoint URL), enter `https://api.qcode.cc/openai` (stop at `/openai`, no `/v1`); for ② `默认模型` (Default model), enter `gpt-6.2-sol`; paste the same `cr_` key into `API Key`.

![Codex custom configuration form: Name qcode, masked API Key, API Endpoint URL https://api.qcode.cc/openai, and Default model gpt-6.2-sol](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/16-codex-custom-form.webp)


Done right you will see: the API Endpoint URL ends with `/openai`, the Default model is `gpt-6.2-sol`, and the key box shows a row of dots.


**Stuck? Not sure whether to append /v1**

Do not add it for Codex. In CC Switch's Codex form, QCode's OpenAI-compatible endpoint ends at `https://api.qcode.cc/openai`; appending `/v1` causes Codex to build an invalid request path.




### Check the upstream format under Advanced options

Scroll down to `高级选项` (Advanced options) and expand it. Confirm that ① `上游格式` (Upstream format) stays on the default `Responses（原生）` (Responses (Native)). Leave both toggles below — ② `保留官方 Fast 档` (Keep official Fast tier) and `完整 URL` (Full URL) — turned off.

Local routing is **not** needed here: QCode supports the Responses protocol natively, so keep the top mode on `直连` (Direct) and do not switch to `路由` (Routing).

![Codex form Advanced options: Upstream format kept on Responses (Native), with Keep official Fast tier and Full URL both off](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/17-codex-upstream-format.webp)


Done right you will see: Upstream format shows `Responses（原生）` (Responses (Native)) and both toggles are off.




### Click Add and confirm Codex is active

Click `添加` (Add) at the bottom right to save. ① at the top of the page remains `直连` (Direct) — no mode switch is needed — and on the ② `qcode` card below, ③ immediately shows `使用中` (In use).

CC Switch has now written `~/.codex/config.toml`. Note that the provider key written into the file is `[model_providers.custom]` (`model_provider = "custom"`), not the card display name `qcode`; check under that key when inspecting the file.

![Codex page after saving: qcode card showing In use while the top mode remains Direct](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/18-codex-enabled.webp)


Done right you will see: the `qcode` card displays `使用中` (In use) and the top tab stays on `直连` (Direct) rather than switching to `路由` (Routing).


**Stuck? Accidentally switched the top mode to Routing**

Click back to `直连` (Direct). QCode does not need local routing; `路由` (Routing) exists to translate endpoints that only speak Chat Completions and requires a local proxy to stay running.




### Verify Claude Code routes through QCode

Open a **new** Windows PowerShell window (an existing window will not pick up the newly written config), enter the command at ①, and press Enter:

```powershell
claude -p "Say hello in one short sentence"
```

When a normal reply appears at ②, Claude Code is routing through QCode without prompting you to sign in to an Anthropic account.

![Running claude -p in PowerShell, highlighting the command and the short reply returned](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/19-claude-verify.webp)


Done right you will see: a short English greeting below the command, with no 401, no 404, and no endless spinner.


**Stuck? An old terminal window still hits the previous provider**

Claude Code reads `~/.claude/settings.json` only when a process starts. Close the running session and open a new PowerShell window to try again; clicking a card in CC Switch does not change sessions that are already running.




### Verify Codex routes through QCode

In the same PowerShell window, enter the command at ① and press Enter:

```powershell
codex exec --skip-git-repo-check "Say hello in one short sentence"
```

When a normal reply appears at ② and the output shows `model: gpt-6.2-sol` and `provider: custom`, Codex is also routing through QCode.

`--skip-git-repo-check` is needed when running outside a git repository; if you run it inside a project folder, you can omit that flag.

![Running codex exec in PowerShell, highlighting the command, model gpt-6.2-sol, provider custom, and the normal reply](https://docs.qcode.cc/static/images/tut/cc-switch/202611/zh/20-codex-verify.webp)


Done right you will see: `model: gpt-6.2-sol` and `provider: custom` in the output, followed by a normal reply.


**Stuck? It says you are not inside a trusted directory**

Running `codex exec` directly in a non-git folder is rejected. First `cd` into your project directory, or pass `--skip-git-repo-check` as shown above.




## Verify it works

Setup is complete when all three of these match:

- On the Claude Code page, the `QCode.cc` card shows `使用中` (In use) and the title bar reads `直连 · QCode.cc` (Direct · QCode.cc);
- On the Codex page, the `qcode` card shows `使用中` (In use), the top mode stays on `直连` (Direct), and `~/.codex/config.toml` contains `[model_providers.custom]`, `base_url = "https://api.qcode.cc/openai"`, and `wire_api = "responses"`;
- In a fresh PowerShell window, both `claude -p "Say hello"` and `codex exec --skip-git-repo-check "Say hello"` return normal replies.

Hitting an endpoint URL path directly and getting `401` is expected: it confirms the route is right and only authentication is missing.


### All done

Both Claude Code and Codex are now connected to QCode in CC Switch. From now on you can open PowerShell and use either tool right away, and switching providers later takes just a click on the card. From here you can:

- [Claude Code full tutorial](/docs/getting-started/claude-code-tutorial)
- [Codex full tutorial](/docs/ide/codex)
- [Endpoints and API formats](/docs/getting-started/endpoints-and-api-paths)
- [Troubleshooting](/docs/reference/troubleshooting)
- Next: compare plans on the [pricing page](https://qcode.cc/en/pricing?utm_source=docs.qcode.cc&utm_medium=tut_done&utm_campaign=knowledge_base&src=docs-ide-cc-switch-done) and pick the one that fits long-term use
- Go back to your [Dashboard](https://qcode.cc/en/dashboard) to check usage and balance


## Common errors

| Error message | Why | What to do |
|---|---|---|
| `通常不会下载` | Edge pauses uncommon `.msi` downloads by default; this is not a malware warning | Click `保留` (Keep) on the download bar, wait for the download to finish, then double-click to install |
| `Not inside a trusted directory and --skip-git-repo-check was not specified.` | `codex exec` was run in a directory that is not a git repository | First `cd` into your project directory, or add `--skip-git-repo-check` to the command |
| `Not Found: Route /api/messages not found.` | Claude Code's `请求地址` (Endpoint URL) is not QCode's Anthropic entry point, so requests hit a non-existent route | Change `请求地址` to `https://api.qcode.cc/api` with no trailing `/` or `/v1`, click `添加` (Add) to save, then open a new terminal |
| `401 invalid_request_error: You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth` | The request carried no key: the key was left blank, not saved, or an older session is still using the previous config | Go back to CC Switch, check that `API Key` holds the complete `cr_` key, click `添加` (Add) to save, then open a new PowerShell window |

## FAQ

### Is it normal that there is no Enable button after saving?

Yes. In v4.0.38, clicking `添加` (Add) saves and activates the provider immediately: the card displays `使用中` (In use) and the title bar changes to `直连 · <provider name>` (Direct · provider name). Not seeing an `启用` (Enable) button does not mean anything went wrong.

### The terminal did not change after switching providers

First check whether the config file has updated to the new provider: look at `ANTHROPIC_BASE_URL` in `~/.claude/settings.json` for Claude Code, or `base_url` in `~/.codex/config.toml` for Codex. If the file changed but the terminal did not, that is because the CLI reads its config only when the process starts; close the running session and open a new terminal.

### Codex keeps spinning on startup

Check three things: whether `API 请求地址` (API Endpoint URL) stops at `https://api.qcode.cc/openai` (not `/openai/v1`); whether `wire_api = "responses"` is still in `~/.codex/config.toml`; and whether the top-level `model_provider` matches the `[model_providers.custom]` table name. When those do not match, Codex falls back to the official endpoint.

### Can I use Claude and Codex at the same time?

Yes. Claude Code writes its config to `~/.claude/` and Codex writes to `~/.codex/`, so the two do not interfere with each other; run `claude` and `codex` in your terminal as needed. Only one provider is active at a time per tool in CC Switch, but Claude and Codex can each have their own active provider.

### How do I switch back to official Anthropic login?

Select the built-in official provider in CC Switch (`Claude Official` / `OpenAI Official`; if you removed it, add it back from the presets) so the config reverts to the official endpoint, then reopen the CLI and go through its own Log out / Log in flow. Do not hand-edit `settings.json` to merge official OAuth with a QCode key.

### Will switching overwrite my manual edits in settings.json?

Starting in v4.0, switching replaces only the key connection fields — endpoint, key, model name, protocol — while plugins, hooks, permissions, and custom environment variables generally stay intact. Older versions had reports of whole-file overwrites that dropped `enabledPlugins` / `hooks`, so back up before upgrading; if something goes missing, restore from `~/.cc-switch/backups/` (including `live-first-write/`) or an exported `.sql` file.

### What happens when my key expires?

There are two cases: a **personal plan** key cannot be renewed after it expires — you need to subscribe again and switch to a new key; a **pay-as-you-go pack** key automatically resumes working on the same `cr_` key once you buy another pack. After rotating to a new key, update `API Key` for both Claude Code and Codex in CC Switch, save, and open a new terminal.

### Does this work with the Codex desktop app?

Per official docs, the Codex desktop app reads the same `~/.codex/config.toml` (`%USERPROFILE%\.codex\config.toml` on Windows). After configuring the Codex provider above, quit the desktop app completely and reopen it. How ChatGPT account sign-in and a custom provider coexist in the desktop app depends on what the app shows on your build.

## Why use CC Switch

- **No hand-editing config files**: visual forms replace `settings.json` and `config.toml`
- **One-click provider switching**: flip quickly between QCode, official Anthropic, and local proxies
- **Claude + Codex together**: manage both Claude Code and Codex CLI from one app
- **Multi-account / multi-plan management**: keep multiple profiles for the same provider (such as a work key and a personal key)
- **System tray quick switch**: switch providers without opening the main window

At its core, CC Switch is a configuration profile switcher: each provider entry is one profile, and switching replaces only the key fields in the target CLI's config file (endpoint, key, model name, protocol, and so on) while keeping the rest. Only one provider is active at a time per tool — keeping that in mind avoids assuming several providers run simultaneously.

## Connection overview

| Item | Details |
|---|---|
| Available models | Depends on the managed CLI: Claude Code (Claude), Codex (GPT), and more. CC Switch is not an inference endpoint itself and only writes each CLI's config files |
| Protocol and endpoint URL | Per tool's native protocol: `https://api.qcode.cc/api` for Claude Code, `https://api.qcode.cc/openai` for Codex |
| Config location | Managed in-app, written to `~/.claude/settings.json`, `~/.codex/config.toml`, etc. |
| Official docs | [Website](https://ccswitch.io) · [GitHub repo](https://github.com/farion1231/cc-switch) · [User manual](https://github.com/farion1231/cc-switch/tree/main/docs/user-manual) |

CC Switch is a cross-platform desktop application (Windows / macOS / Linux). Alongside Claude Code and Codex, the left sidebar also lists Claude Desktop, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes, Pi, MiniMax Code, Kimi Code, DeepSeek Harness, Antigravity, Oh My Pi, Copilot CLI, WorkBuddy, and more. Each tool reads its own config; this guide covers Claude Code and Codex. Antigravity CLI (added in v4.0.18) takes effect only when `agy` is started from a terminal launched by CC Switch; it targets Gemini API-compatible services, and QCode does not offer Gemini models at present.

## Installing on other operating systems

System requirements (from the official README):

- **Windows**: Windows 10 and above
- **macOS**: macOS 12 (Monterey) and above
- **Linux**: x86_64 or ARM64, glibc 2.35+ with WebKitGTK 4.1 (e.g., Ubuntu 22.04+, Debian 12+, recent Fedora; RHEL / Rocky / Alma 8–9 are not supported yet)

In the filenames below, replace `{version}` with the latest version on the Releases page (currently 4.0.38):

| OS | Download and install |
|---|---|
| Windows | Installer `CC-Switch-v{version}-Windows.msi`, or portable `CC-Switch-v{version}-Windows-Portable.zip`; on Windows on ARM use the corresponding file with `arm64` in the name |
| macOS | Homebrew recommended: `brew install --cask cc-switch` (update with `brew upgrade --cask cc-switch`); or download `CC-Switch-v{version}-macOS.dmg` or `.zip` manually. It is a Universal build that runs natively on Apple Silicon and Intel |
| Linux | `.deb` (Debian / Ubuntu), `.rpm` (Fedora and other distros with WebKitGTK 4.1), `.AppImage` (any distro meeting the requirements above), available in both x86_64 and arm64 |
| Arch Linux | `paru -S cc-switch-bin` |

Flatpak is not included in official releases; the official docs note you can build it yourself from the `.deb` (see `flatpak/README.md` in the repository). Once installed on macOS or Linux, start from `+ 添加供应商` (+ Add provider) → `自定义配置` (Custom configuration) with the exact same Claude Code and Codex fields shown above.

The official release notes include a counterfeit warning: any "CC Switch" website or client that charges money, asks for top-ups, or requests login credentials is fake. Download only from ccswitch.io and GitHub Releases.

## Field reference and config.toml

Claude Code custom configuration needs only three fields:

| Field | Value |
|---|---|
| Name (`名称`) | `QCode.cc` |
| API Key | `cr_xxxxxxxx` (full key starting with `cr_`) |
| Endpoint URL (`请求地址`) | `https://api.qcode.cc/api` |

Codex custom configuration adds two more:

| Field | Value |
|---|---|
| Name (`名称`) | `qcode` |
| API Key | Same `cr_` key used for Claude Code |
| API Endpoint URL (`API 请求地址`) | `https://api.qcode.cc/openai` |
| Default model (`默认模型`) | `gpt-6.2-sol` |
| Advanced options → Upstream format (`高级选项` → `上游格式`) | `Responses（原生）` (Responses (Native) — default, leave unchanged) |

After saving, the corresponding entries in `~/.codex/config.toml` look like this. Note that the provider key is `custom`, not the `qcode` label shown on the card:

```toml
model_provider = "custom"
model = "gpt-6.2-sol"
model_reasoning_effort = "high"

[model_providers.custom]
name = "custom"
base_url = "https://api.qcode.cc/openai"
wire_api = "responses"
```

For Claude Code, CC Switch writes `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` into `~/.claude/settings.json`; you do not need to open or edit the file yourself.

Each row in the Codex provider's model list has a drag handle on the left, and that order defines the `/model` menu order in Codex; dragging a model to the top row makes it the default model. The `打开终端` (Open Terminal) button on a card is an icon button to the left of `编辑` (Edit); exact placement can vary slightly by version, so go by what your UI displays.

## Choosing a default model

QCode offers models ranging from flagship to lightweight. Switch inside Claude Code with `/model`, or enter one directly in CC Switch's `默认模型` (Default model) field:

| Model | Best for |
|---|---|
| `claude-opus-5-5` | Daily default, balanced tier |
| `claude-sonnet-4-6` | Previous generation, useful for comparison |
| `claude-opus-4-8` | Previous-generation flagship |
| `claude-haiku-5-5` | Fast Q&A and small batch tasks |

Check live pricing and context lengths on [qcode.cc/models](https://qcode.cc/en/models). The Claude provider editor also includes a per-role model mapping panel (Sonnet / Opus / Fable / Haiku / subagent) that can apply settings across all roles at once.

For Codex, available GPT models include `gpt-6.2-sol` / `gpt-6.2-astra`. Note that `gpt-6.2-*` rejects `model_reasoning_effort = "none"`; check your local Codex CLI version with `codex --version`.

## Codex desktop app

Per official docs, the Codex desktop app reads the same `~/.codex/config.toml` written by CC Switch, so setting QCode up as a Codex provider configures both the desktop app and the CLI together.

To route the desktop app through QCode:

1. On CC Switch's Codex page, add and save the QCode provider as shown above (`API 请求地址` set to `https://api.qcode.cc/openai`, `wire_api = "responses"`).
2. Quit the Codex desktop app completely, then reopen it. Simply closing the window is not a full quit; on macOS, press ⌘Q.
3. Inside the app, confirm the selected model is a GPT model available on QCode (such as `gpt-6.2-sol`, `gpt-6.2-astra`, or `gpt-6.2-sol`).

Two reminders:

- Environment variables set in a terminal are not always visible to apps launched from the desktop. If you skip CC Switch and hand-write `config.toml` with an environment variable for the key, make sure the app process can read that variable.
- OpenAI's docs refer to the desktop app collectively as the "ChatGPT desktop app", where you choose between ChatGPT and Codex. How ChatGPT account sign-in and a custom provider coexist depends on what your build displays in-app.

## Switching between multiple providers and accounts

The core strength of CC Switch is switching. Common workflow:

1. Save multiple providers on the Claude Code page, such as `QCode.cc` (primary), `QCode.cc (asia)` (Asia node), and `Anthropic Official` (for comparison).
2. To switch, make the target provider card active; CC Switch rewrites the corresponding `ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` into `~/.claude/settings.json`.
3. Apply the new config: close the running session and open a new terminal before running `claude`. Both the official FAQ and issue #3057 document cases where the file on disk has updated while an already-running session still hits the previous provider. Do the same ("reopen the terminal") for Codex and other CLIs.
4. Codex works the same way: switching the active provider on the Codex page rewrites `~/.codex/config.toml`.

You can save multiple profiles for QCode itself using different keys to separate billing:

| Provider name | Endpoint URL | API Key | Purpose |
|---|---|---|---|
| `QCode.cc (work)` | `https://api.qcode.cc/api` | Work key | Team / reimbursable account |
| `QCode.cc (personal)` | `https://api.qcode.cc/api` | Personal key | Personal projects |

Only one provider is active at a time — CC Switch will not write two configs into `~/.claude/settings.json` simultaneously. To compare official Anthropic with QCode, switch back and forth rather than expecting both to run at once.

## Use cases

- **Network fluctuations from Mainland China**: use `asia.qcode.cc` as primary and switch to the global `api.qcode.cc` endpoint in one click if latency spikes.
- **Side-by-side provider comparison**: run the same task on QCode and official Anthropic to compare responses and cost.
- **Work / personal billing separation**: keep separate keys for work and personal usage for clean accounting.
- **Claude + Codex together**: manage Claude Code and Codex CLI in one app, pointing at the Anthropic-protocol and OpenAI-protocol endpoints respectively.

## Advanced Claude Code features (also work via QCode)

CC Switch only switches providers, leaving Claude Code's own capabilities untouched. After connecting to QCode, the features below work normally on whichever model is configured.

### Vision input: understand requirements from screenshots and diagrams

Claude Code can pass images to vision-capable models: paste with Ctrl+V, drag and drop an image, or reference an image file path in your prompt. Common uses include rebuilding UI from mockups or screenshots, debugging from error screenshots, and reading architecture diagrams or charts.

Vision-capable models available through QCode include `claude-fable-5-2` / `claude-opus-5-5`, as well as still-available `claude-opus-4-8` / `claude-sonnet-4-6` and the GPT family (`gpt-6.2-sol`, `gpt-6.2-astra`). Check live capability flags on [qcode.cc/models](https://qcode.cc/en/models).

This covers image **input** (understanding), not image **generation**. To generate images with a model, use `gpt-image-2` — see [gpt-image-2 image generation](/docs/usage/image-2).

### Dynamic workflows (background sub-agent orchestration)

Include the keyword **ultracode** in your prompt (or simply ask to "run a workflow") to trigger Claude Code's dynamic workflows: it orchestrates dozens to hundreds of background sub-agents in parallel, suited to repository-wide reviews, migrations, and research. You can keep working while sub-agents run in the background and check status with `/workflows`. Further reading: [Subagents](/docs/advanced/subagents).

### Headless mode and automation output

In scripts and CI, run a one-shot prompt with `-p` and choose an output format:

```bash
# Structured JSON (includes result / total_cost_usd / usage / session_id), parsed with jq
claude -p "Summarize test coverage in this repo" --output-format json | jq '.result'

# Newline-delimited streaming JSON events, suited to real-time pipes
claude -p "Review src/ for security risks" --output-format stream-json
```

See [Automation & CI/CD](/docs/advanced/headless) for more pipeline and CI patterns.

## About Gemini and Antigravity

CC Switch includes Gemini CLI in its sidebar, but QCode does not offer Gemini models at present, so you do not need to configure a Gemini entry for QCode in CC Switch. Use Claude, GPT, or Chinese-family models instead — see available models on [qcode.cc/models](https://qcode.cc/en/models).

Google has retired Gemini CLI (EOL 2026-06-18 for Pro and non-enterprise tiers; enterprise paid keys are unaffected), succeeded by Google Antigravity CLI (available since 2026-05-19). CC Switch still maintains Gemini CLI as a managed app with the same setup flow as Claude / Codex; that pertains only to your own Google account or another source and is unrelated to QCode.

## Choosing an endpoint for your network

All three endpoints share the same API key — pick the one that performs best on your network, and switch the endpoint URL to another if one becomes slow or unreliable.

| Endpoint | Claude Code endpoint URL | Codex API endpoint URL |
|---|---|---|
| Default (International) | `https://api.qcode.cc/api` | `https://api.qcode.cc/openai` |
| Asia (recommended for Mainland China) | `https://asia.qcode.cc/api` | `https://asia.qcode.cc/openai` |
| North America / Europe | `https://us.qcode.cc/api` | `https://us.qcode.cc/openai` |

Self-check: requesting an endpoint path directly and receiving `401` is expected — it confirms the path is valid and only authentication is missing.

## One key for both Claude and Codex

The Claude Code and Codex providers in CC Switch can share the same QCode API key. QCode bills per token (see per-model rates on [qcode.cc/models](https://qcode.cc/en/models) and rules in [Billing](/docs/reference/billing)); adding two providers does not double-bill you. If you set up multiple providers with different keys, each key is billed independently.

## After you are connected: switch, coexist, recover

### Managing multiple plans and keys

One provider = one endpoint URL + one key + (for Codex) one model. You can save several entries for QCode — for example `QCode.cc` (international domain, primary), `QCode.cc (asia)` (Asia node for network jitter), and `QCode.cc (work)` / `QCode.cc (personal)` (two separate `cr_` keys for split billing).

### The CLI is still hitting the old provider after switching

Check in this order before suspecting your key:

1. Open `~/.claude/settings.json` (or `~/.codex/config.toml` for Codex) and confirm that `ANTHROPIC_BASE_URL` / `base_url` reflects the provider you just switched to.
2. File updated, session did not: Claude Code loads the `env` block from `settings.json` into environment variables at process start, so running sessions do not re-read it. Close the running `claude` / `codex` session and open a new terminal.
3. The official README states that Claude Code supports hot-switching; if a running session still hits the old node, restarting the session is still the reliable fix.

### Coexisting with official Anthropic / ChatGPT accounts

1. Switch to the built-in official provider in the list (`Claude Official` / `OpenAI Official`; add it back from presets if deleted).
2. Let CC Switch write the config back to the official endpoint.
3. Reopen the matching CLI and run its own Log out / Log in (or OAuth) flow.
4. From then on you can switch back and forth between the official login and your `QCode.cc` custom provider.

Do not hand-edit `settings.json` to "merge" official OAuth with QCode's `ANTHROPIC_AUTH_TOKEN` — CC Switch rewrites the fields it manages whenever you switch.

### System tray switching pitfalls

- **Missing tray icon**: on macOS check menu bar settings; on Windows check the taskbar overflow area; on Linux you may need `libappindicator`.
- **Lightweight mode**: closes (destroys rather than hides) the main window and leaves only the tray icon; since v4.0.21 this mode persists across restarts; the first `ccswitch://` deep link that wakes it rebuilds the window and takes a moment longer.
- **Clicked in the tray, CLI unchanged**: tray switching writes the exact same live config files as the main window and does not terminate a running `claude` process. You still need to open a new session.
- Add suffixes like `(asia)` or `(work)` to provider names so you can tell them apart in the tray menu.

### Recovering an overwritten config

On switch or takeover, CC Switch writes provider fields into the CLI's live config file. Several issues (#2992, #4274, plus feature request #1656 asking for merge-write behavior) document cases where unmanaged keys in `~/.claude/settings.json` (`enabledPlugins`, `hooks`, `statusLine`, `permissions`, etc.) were lost to a whole-file overwrite. Plugin files often remain on disk and simply stop loading because `enabledPlugins` was removed.

Verifiable recovery paths:

1. **App backups**: `~/.cc-switch/backups/` (automatically rotated, keeping the last 10).
2. **Your own exports**: exports created from Settings are named like `cc-switch-export-{timestamp}.sql`; importing overwrites the current database, so export once more before importing an older backup.
3. **Automatic first-write backup**: before CC Switch modifies a tool's config file for the first time, it backs up the original to `~/.cc-switch/backups/live-first-write/`.
4. **Manual edits to Claude**: from v4.0 onward, switching generally preserves them; on older versions where you only edited `~/.claude/settings.json`, restore from your own backup, Time Machine, or editor local history.

CC Switch's own database is `~/.cc-switch/cc-switch.db`, and device-level UI settings live in `~/.cc-switch/settings.json`. Deleting the latter only resets the UI and will not restore Claude hooks.

## Practical tips

- **Add suffixes to names**: label providers with `(asia)` / `(work)` so tray switching is unambiguous at a glance.
- **Check the file, then open a new session**: treat `~/.claude/settings.json` and `~/.codex/config.toml` as the source of truth.
- **No trailing slash**: QCode requires endpoint URLs without a trailing `/`, or clients may construct broken paths like `//v1/...`.
- **Keys are stored per provider**: CC Switch saves each provider's key independently, so update each entry when rotating keys.
- **Back up your config**: from v4.0 onward, switching replaces only key connection fields and generally preserves your own additions; on older versions, back up first.

## Command-line version (CLI)

CC Switch has no official CLI — it ships only as a graphical desktop app. For servers, SSH sessions, and headless environments, the official README recommends the community-maintained [CC Switch CLI](https://github.com/SaladDay/cc-switch-cli), a separate CLI fork released independently by another author and not an official product.

Install (refer to that project's README):

```bash
# macOS / Linux: Homebrew
brew install cc-switch-cli

# Or install script (installs to ~/.local/bin; read the script before running)
curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash
```

On Windows, download `cc-switch-cli-windows-x64.zip` from its Releases page, extract it, and place `cc-switch.exe` in a directory on your PATH.

Basic usage:

```bash
cc-switch                             # Launch full-screen terminal UI (TUI)
cc-switch provider list               # List providers
cc-switch provider add                # Add a provider
cc-switch provider switch <id>        # Switch provider
cc-switch use <id>                    # Shorthand for the line above
cc-switch --app codex provider list   # Use --app to pick the tool (default: claude)
cc-switch start claude <id>           # Launch Claude with this provider for this run only, without changing global config
```

`--app` accepts `claude` (default), `codex`, as well as `opencode`, `hermes`, `openclaw`, `pi`, and more. By default the CLI shares the `~/.cc-switch` data directory with the desktop app; its supported database schema occasionally lags behind the desktop release — if you see "database version is too new", upgrade the CLI or wait for it to catch up.

If you would rather not install the CLI either, editing the config files by hand works just as well: see the [Claude Code full tutorial](/docs/getting-started/claude-code-tutorial) for Claude Code and the [Codex full tutorial](/docs/ide/codex) for Codex — the endpoint URLs and key values are identical to those on this page.

## v4.0 Aggregation mode and ccswitch:// deep links

### Aggregation mode

Starting in v4.0.0, each app page has three tabs across the top: Direct / Routing / Aggregation (shown in Chinese UI as `直连 / 路由 / 聚合`). Clicking a tab changes only what you are viewing and never alters your config.

Aggregation mode combines models from multiple providers into a single model picker: whichever model you select, requests go straight to that provider without leaving the client. Official docs note that this feature is opt-in, currently supports Claude Code and Codex, dispatches requests by the chosen model, and does not provide failover. Cards offer Add and Remove actions, plus selecting one default provider to handle requests that do not specify an aggregated model.

Two details matter for per-token billing: you can switch models mid-session, but each switch forces the new model to rebuild its prompt cache, making the first turn after switching noticeably more expensive; when the model list changes, the app prompts you to restart the client, and Codex CLI users can restart the background service in one click from that banner.

### `ccswitch://` deep-link import

v4.0.10 focused on fixing `ccswitch://` one-click import links: clicking a link while the app is closed now brings up the import confirmation dialog, links are no longer dropped in lightweight mode, and macOS no longer opens the dialog twice. The confirmation dialog includes an option to switch immediately after import, which is off by default; turning it on displays a warning that client requests will be sent to the address in the link.

On API formats, non-native formats (such as `openai_chat` in Claude Code) require local routing to be enabled beforehand; combinations an app does not support are rejected at parse time. When importing QCode endpoints via deep link, use `https://api.qcode.cc/api` for Claude Code and `https://api.qcode.cc/openai` for Codex.

## Next steps

- [magpie setup](/docs/ide/magpie) — switch models for Claude Code / Codex through a local gateway
- [WorkBuddy integration](/docs/ide/workbuddy) — use the same key as a custom model in Tencent WorkBuddy
- [Claude Code full tutorial](/docs/getting-started/claude-code-tutorial) — master the core Claude Code workflow
- [Codex full tutorial](/docs/ide/codex) — dive deeper into Codex CLI
- [VS Code integration](/docs/ide/vscode) — use Claude Code directly inside your editor
- [Subagents](/docs/advanced/subagents) — orchestrate background agents with dynamic workflows
- [Automation & CI/CD](/docs/advanced/headless) — headless mode and script integration
- [Billing](/docs/reference/billing) — understand plans and quota rules