CC Switch
CC Switch is a cross-platform desktop GUI (Tauri 2 + React) for one-click switching between API providers across multiple AI coding CLIs, sparing you from hand-editing ~/.claude/settings.json, ~/.codex/auth.json, and ~/.codex/config.toml. It is not a command-line tool itself — it manages those CLIs' config files and offers quick switching from the system tray.
- Repository: https://github.com/farion1231/cc-switch
- Website: https://ccswitch.io
- License: MIT
Supported CLIs (relevant to this doc):
- Claude Code (Anthropic)
- Codex (OpenAI)
Prerequisites
- Claude Code or Codex CLI installed (per their official documentation).
- An API Key created in the Sakrylle Console.
- CC Switch installed (see below).
Installing CC Switch
Download the latest build from the Releases page, or use a package manager:
- macOS:
brew install --cask cc-switch - Windows: download the
CC-Switch-*-Windows.msiinstaller, or the portableWindows-Portable.zip - Arch Linux (AUR):
paru -S cc-switch-bin - Debian / Ubuntu: download and install
CC-Switch-*-Linux.deb - Fedora / RHEL / openSUSE: download and install
CC-Switch-*-Linux.rpm - Other Linux: download
CC-Switch-*-Linux.AppImage,chmod +x, then run
Windows requires the Microsoft Edge WebView2 runtime; it ships with Win 10/11 by default.
Clear conflicts
CC Switch switches providers by rewriting the CLI's config file, but environment variables take precedence over the config file. If your shell already exports variables like ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, OPENAI_API_KEY, or OPENAI_BASE_URL, the provider you switch to in CC Switch won't actually take effect.
When CC Switch detects a conflict, it shows a yellow banner with a "Backup and remove" button (backups go to ~/.cc-switch/env-backups/). Either follow the prompt, or remove the offending lines yourself from ~/.zshrc, ~/.bashrc, or ~/.bash_profile.
One-click import
The Sakrylle Console integrates with CC Switch's deep-link import. Easiest path:
- Create a key on the API Keys page
- In that key's action row, click Import to CCS
- Confirm the "Open CC Switch?" prompt in your browser
- CC Switch reads the key's group (for example, Claude-AWSQ / GPT-Pro / GPT-Image) and adds the matching provider automatically — go back to the main window and click Enable
Prerequisite: CC Switch is installed and has been launched at least once on this machine, so it registers the
cc-switch://URL scheme. If your browser doesn't recognize the scheme, open CC Switch once and try again.
If you'd rather configure manually, or need to debug a failed import, read on.
Add Claude provider
- Open the CC Switch main window and switch to the Claude Code tab
- Click + in the top right to add a provider
- In the preset dropdown, pick Custom (or pick a template and edit it)
- Fill in as follows:
| Field | Value |
|---|---|
| Name | Sakrylle (any label you like) |
| API format | Anthropic Messages |
| Config JSON | see below |
Config JSON:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
"ANTHROPIC_BASE_URL": "https://api.sakrylle.com",
"ANTHROPIC_MODEL": "claude-sonnet-4-6"
}
}Field notes:
ANTHROPIC_BASE_URL: the root domain, no/v1. Claude Code appends/v1/messagesitself; doubling it leads to a 404.ANTHROPIC_AUTH_TOKEN: put your Sakrylle key here, and the CLI sendsAuthorization: Bearer .... Do not useANTHROPIC_API_KEY— it switches to theX-Api-Keyheader and overrides Pro/Team subscriptions, which is inconsistent with Sakrylle's authentication.ANTHROPIC_MODEL: default model name, optional. For the available model list see Models and Pricing.
- Save, then click Enable on the provider card. CC Switch writes the JSON above to
~/.claude/settings.json. - Claude Code supports hot reload, so no restart needed — the next command picks it up.
Add Codex provider
- Switch to the Codex tab
- Click + to add, pick Custom
- Fill in:
| Field | Value |
|---|---|
| Name | Sakrylle |
auth.json | see below |
config.toml | see below |
auth.json:
{
"OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx"
}config.toml:
model = "gpt-5.6-sol"
model_provider = "sakrylle"
[model_providers.sakrylle]
name = "Sakrylle API"
base_url = "https://api.sakrylle.com/v1"
wire_api = "responses"
requires_openai_auth = trueField notes:
model_providermust match the name in[model_providers.X]below; reserved names likeopenai,ollama,lmstudiowon't work.base_url: Sakrylle's OpenAI-compatible endpoint, with/v1.wire_api:responsesuses the Responses API; if a model only supports Chat Completions, change it to"chat".requires_openai_auth = truemakes Codex injectOPENAI_API_KEYfromauth.jsoninto the request headers.
- Save, then click Enable. CC Switch atomically writes
~/.codex/auth.jsonand~/.codex/config.toml. - Codex CLI does not hot-reload config — after switching, you must close and reopen the terminal window (not just restart the
codexprocess).
Switching
- Switch: click Enable on another provider card in the main window, or pick a provider directly from the system tray menu.
- Tray menu: right-click the tray icon → choose a provider under the Claude or Codex submenu. Fastest path.
- Back to official login: use the preset Claude Official Login or Codex Official Login provider, enable it, and follow the CLI's own OAuth flow. Codex still needs a terminal restart.
Where data lives
- CC Switch itself:
~/.cc-switch/(SQLite database + backups + settings) - Claude Code:
~/.claude/settings.json - Codex:
~/.codex/auth.json,~/.codex/config.toml
CC Switch atomically backs up before every write and supports pointing these directories at iCloud / Dropbox / OneDrive / WebDAV for multi-machine sync (change the path in Settings).
FAQ
- Switch had no effect: first check for conflicting environment variables (see above); then confirm you switched the provider for the right CLI (the Claude and Codex tabs are independent).
- Codex still on the old provider after switching: Codex doesn't hot-reload — you must close all terminal windows and reopen, not just kill the
codexprocess. - Claude Code returns 404:
ANTHROPIC_BASE_URLwas set tohttps://api.sakrylle.com/v1. Drop the/v1. - Claude Code returns 401: you used
ANTHROPIC_API_KEYinstead ofANTHROPIC_AUTH_TOKEN. Change the field name. - Will manual edits to the config file be lost?: when you edit the currently enabled provider, CC Switch first reads the CLI's config file back into its database, so manual edits aren't lost. But if you edit a file belonging to an inactive provider, it will be overwritten next time you enable that provider.
- Can't delete a provider: CC Switch requires every CLI to have at least one enabled provider. Switch to a different one first, then delete.
- 402 insufficient balance: top up in the Console.
