Desktop appsAnthropic + OpenAI compatible

How to add CCSub to CC Switch (preset or custom provider)

CC Switch ships a CCSub preset: pick it, paste your API key and switch. Also covers the manual custom provider form and where CC Switch writes config files.

Last updated:CC Switch Official site

Copy-paste configuration

These are the three values the tool needs. Create the API key on the API Keys page of your CCSub dashboard.

Preset
CCSub(pick it from the preset list)
API Key
sk-your-ccsub-key
Base URL (manual setup)
https://www.ccsub.net(leave “Full URL” off)

For model, use an ID such as claude-sonnet-5 — the full list of model IDs is on the models page. No key yet? Create an account first.

Steps at a glance

  1. 1

    Install CC Switch

    Download it from GitHub Releases: .msi for Windows, .dmg or brew install --cask cc-switch for macOS, .deb / .rpm / .AppImage for Linux.

  2. 2

    Choose the tool to configure

    Open CC Switch, select Claude Code (or Codex, OpenCode, etc.) in the sidebar and click + to add a provider.

  3. 3

    Pick the CCSub preset and paste your key

    Search for or select CCSub in the preset list, paste the sk- key from your CCSub dashboard into API Key, and click Add.

  4. 4

    Switch to CCSub

    Click Switch (labelled Enable in older builds) on the CCSub card; the card is marked as in use once the tool's config has been written.

  5. 5

    Verify

    Start a new Claude Code session (Codex needs a full restart), send a message, and check the Usage page in the CCSub dashboard.

CC Switch is an open-source desktop app for people who use more than one API provider. Instead of editing environment variables or config files by hand, you keep a card per provider and click Switch; CC Switch writes the endpoint and key into the tool's configuration for you. It manages Claude Code, Codex, OpenCode and a handful of other agents.

CCSub ships as a built-in preset, so for most people setup is three clicks: choose the tool, choose CCSub, paste the key.

Install

Grab a build from the CC Switch releases page:

Downloads
Windows 10+
.msiA portable build is also available, for x64 and arm64.
macOS 12+
brew install --cask cc-switchOr download the universal .dmg.
Linux
.deb / .rpm / .AppImageArch users: paru -S cc-switch-bin
  1. Open CC Switch and pick the tool in the sidebar — for example Claude Code.
  2. Click + to add a provider.
  3. Search for or select CCSub in the preset list. The endpoint is pre-filled; for Claude Code it is https://www.ccsub.net.
  4. Paste the key you created on the API Keys page of the CCSub dashboard (it starts with sk-) into API Key and click Add.
  5. Click Switch on the CCSub card (older builds label it Enable). Once the card is marked as in use, you are done.

Codex and OpenCode work the same way: select the tool in the sidebar, then add CCSub from its presets. The Codex preset points at https://www.ccsub.net/v1 with the Responses wire format; that is the same endpoint as the https://www.ccsub.net/api/v1 used in our docs, so leave it as is.

Option 2: a custom configuration

If your build predates the preset or you want to control every field, add the provider by hand:

  1. Click + and choose the custom configuration option.
  2. Fill in:
Custom provider for Claude Code
Provider name
CCSubAny label you like.
Base URL
https://www.ccsub.netNo /v1. Leave the Full URL toggle off.
API Key
sk-your-ccsub-key
Main model (optional)
claude-sonnet-5Sonnet / Opus / Haiku defaults can be set separately.
  1. Click Add, then Switch on the new card.

The model field takes IDs such as claude-sonnet-5; all available IDs are on the models page. The Full URL toggle only takes effect when CC Switch's local routing is on, so leave it off when connecting directly to CCSub.

Checking that it worked

  • The card's connectivity check only tests whether the address answers. It does not validate the key or the model.
  • The endpoint management panel includes a speed test that shows latency to the endpoint.
  • The definitive test is a real message. Claude Code picks up the switch in a new session; Codex has to be quit and relaunched. Then look for the request on the Usage page of your CCSub dashboard.

What CC Switch changes on disk

Knowing where it writes makes troubleshooting much easier:

  • Claude Code: the env block of ~/.claude/settings.json (ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN).
  • Codex: ~/.codex/config.toml. Your existing ~/.codex/auth.json is stashed to ~/.cc-switch/codex-login-stash.json first.

A model you pick with /model inside a tool is rewritten from the card when you next switch providers. Put the model you actually want in the card's main model field.

Prefer not to install another app? Configure the tools directly with the Claude Code guide and the Codex CLI guide.

Common errors and fixes

401 after switching to CCSub in Claude Code

Cause:The pasted key has stray whitespace, or an old ANTHROPIC_AUTH_TOKEN in your shell is confusing the picture.

Fix:Edit the CCSub card and paste the key again; run /status in Claude Code to see which base URL and credential source are active.

The model I chose with /model reverts after switching

Cause:Switching providers rewrites the model fields from the card's settings.

Fix:Put your preferred model in the card's main model field instead of only changing it inside the tool.

An old card has a different endpoint than the preset

Cause:Cards saved from older presets are not updated when CC Switch upgrades.

Fix:Delete the old card and add CCSub again from the preset list.

For more error messages and what they mean, see the error troubleshooting index. Installation and network issues are covered in the troubleshooting docs (Chinese).

FAQ

Is CCSub a built-in preset in CC Switch?

Yes. CCSub is in the preset lists for Claude Code, Codex, OpenCode and several other tools, with the endpoint already filled in; you only add your API key. There is currently no CCSub preset for Gemini CLI.

What base URL do I enter in a custom configuration?

For Claude Code, https://www.ccsub.net — no /v1, and leave the Full URL toggle off. That toggle only matters when local routing is enabled.

The connectivity check passes but requests still fail. Why?

The connectivity check only tests whether the address is reachable. It does not validate your key or model, so a wrong key or empty balance only shows up when you send a real message.

I switched providers but Codex did not change.

Claude Code picks up switches on the fly. Codex reads its config at startup, so quit and relaunch it.

Which files does CC Switch edit?

For Claude Code, the env block of ~/.claude/settings.json. For Codex, ~/.codex/config.toml; your existing auth.json is stashed to ~/.cc-switch/codex-login-stash.json before switching.

See all integration guides

Need a CCSub API key?

Sign up, create a key in the dashboard, and paste the values above into your tool. Pay-as-you-go balance does not expire — you only pay for the tokens you use.