CC Switch
Use CC Switch to set up SipToken in Claude Code and Codex.
Before you start
- A SipToken key in the Official group. If you don't have one yet, see Quickstart.
- CC Switch edits each tool's config files for you. Each tool needs a different address:
| Tool | Endpoint URL | /v1? |
|---|---|---|
| Claude Code | https://api.siptoken.ai | No |
| Codex | https://api.siptoken.ai/v1 | Yes |
| Gemini CLI | https://api.siptoken.ai | No |
The Tokens page in the console can import a key into CC Switch in one click. See below.
Install
System requirements: Windows 10 or later, macOS 12 or later. Linux needs glibc 2.35 or later and WebKitGTK 4.1.
Download it from GitHub Releases. The project site is ccswitch.io.
- Windows: the
.msiinstaller, or the portable zip. - macOS: install with Homebrew, or download the
.dmg. - Linux: there are
.deb,.rpmand.AppImagepackages.
# macOS
brew install --cask cc-switch
# Arch Linux
paru -S cc-switch-bin
Open it once after installing. On first launch, CC Switch imports your existing config as a provider named default and backs up the original config files.
Configure
CC Switch looks the same on every system, so these steps work everywhere. These are the files it edits:
| Tool | macOS / Linux | Windows |
|---|---|---|
| Claude Code | ~/.claude/settings.json | %USERPROFILE%\.claude\settings.json |
| Codex | ~/.codex/config.toml | %USERPROFILE%\.codex\config.toml |
| Gemini CLI | ~/.gemini/.env and ~/.gemini/settings.json | The same files under %USERPROFILE%\.gemini\ |
When switching, it only changes the key fields: address, key and model. Your other settings stay as they are.
Each app page has three tabs at the top: Direct, Routing and Aggregation. For SipToken, Direct is all you need. You don't have to turn on routing.
One-click import from the console
- Make sure CC Switch is installed and has been opened at least once.
- Open the Tokens page in the console.
- In the row for the key you want, open the Chat dropdown and choose CC Switch.
- When the browser asks whether to open CC Switch, allow it.
- CC Switch shows an import confirmation. Check the name, address and key, then click "Confirm Import".
- Find SipToken in the provider list and click "Switch" on its card.
Add it to Claude Code by hand
- Select Claude Code in the left sidebar and make sure the Direct tab is active.
- Click "Add Provider" (the + button) on the right of the page header.
- Choose "Custom Configuration".
- Set the name to
SipToken, the API key to your key, and the endpoint URL tohttps://api.siptoken.ai. - For models, click "Fetch Models" next to the model field to pick from a list, or type an ID such as
claude-sonnet-5-5. - Under advanced options, leave the upstream format at the default, "Anthropic Messages (Native)".
- Click "Add" in the footer, then click "Switch" on the SipToken card.
The JSON editor below the form shows what will be written to settings.json. It looks roughly like this:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.siptoken.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxx",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
}
}
We suggest ANTHROPIC_AUTH_TOKEN as the key field. If the editor shows ANTHROPIC_API_KEY, that works too, but Claude Code will ask you to approve it once on first launch.
Claude Code picks up the switch right away. No restart needed. For details, see Claude Code.
Add it to Codex by hand
- Select Codex in the left sidebar and make sure the Direct tab is active.
- Click "Add Provider" and choose "Custom Configuration".
- Set the name to
SipToken, the API key to your key, and the endpoint URL tohttps://api.siptoken.ai/v1. - Under advanced options, leave the upstream format at "Responses (native)".
- Add a row to the model mapping table with
gpt-6.2-astraas the actual request model. Addgpt-6.1-solandgpt-6-lunatoo if you want them. Fill in the context window from Models. - In the
config.tomleditor, check thatbase_urlishttps://api.siptoken.ai/v1andwire_apiis"responses". - Click "Add", then click "Switch" on the card.
Restart Codex after switching: for the CLI, quit and run codex again. For the desktop app, quit it fully and reopen it.
CC Switch writes the key straight into config.toml, so you don't need the SIPTOKEN_API_KEY environment variable when CC Switch manages Codex. For details, see Codex.
Add it to Gemini CLI by hand
Select Gemini CLI in the left sidebar and add a custom configuration:
{
"env": {
"GEMINI_API_KEY": "sk-xxxxxxxx",
"GOOGLE_GEMINI_BASE_URL": "https://api.siptoken.ai",
"GEMINI_MODEL": "gemini-4-neon"
}
}
Restart Gemini CLI after switching. For details, see Gemini CLI.
Conflicts with environment variables
If you've set variables like ANTHROPIC_*, OPENAI_* or GEMINI_* in your system or shell profile, they may override what CC Switch writes.
When CC Switch detects a conflict, a yellow banner appears at the top. Click "View Details", tick the variables to remove, delete them and confirm. CC Switch backs them up to ~/.cc-switch/backups/ first. Reopen your terminal afterwards.
To try a key temporarily, set it in the current terminal with export (or $env: in PowerShell). It goes away when you close the terminal and doesn't touch CC Switch's config. The variable names are in each tool's guide.
Verify
First check the SipToken card in CC Switch. If it shows "In use", the switch went through.
Claude Code: run the commands below. If it returns ok, you're connected.
claude --version
claude -p "Reply with exactly: ok"
Codex: after restarting, run the commands below. If it returns gateway-ok, you're connected.
codex --version
codex exec "Reply with exactly: gateway-ok"
Running /status in an interactive Claude Code or Codex session shows the current address or provider.
If it still fails, test the key itself with the curl commands in Quickstart.
Common errors
| Error | Cause and fix |
|---|---|
| Switched, but Claude Code still uses the old config | Usually an environment variable overrides it. See "Conflicts with environment variables" above. |
| Switched, but nothing changed in Codex | Codex needs a restart. Quit it fully and reopen it. |
| The one-click import link does nothing | Usually CC Switch isn't installed or hasn't been opened yet. Install it, open it once and try again, or add the provider by hand. |
| Switching fails because the config file is in use | Usually the tool is still running. Close it and switch again. |
| "Fetch Models" returns 401 or 403 | Usually the API key is wrong. Copy it again from the Tokens page. |
| "Fetch Models" returns 404 | Usually the endpoint URL is wrong. Claude Code uses https://api.siptoken.ai, Codex uses https://api.siptoken.ai/v1. |
| The card shows "Needs Routing" | Usually the upstream format was changed to one that needs conversion. Set it back to the native format. |
| The tool reports 401, 403, 429 or 503 | Same causes as with direct API calls. See the error table in API basics. |
FAQ
Do I need to turn on routing?
No. SipToken natively supports the formats Claude Code and Codex use, so Direct is enough.
Where is my key stored?
In CC Switch's data folder on your computer, ~/.cc-switch/. After switching, it's also written to each tool's config file. Don't share these files or commit them to Git.
Can I switch from the tray?
Yes. Right-click the CC Switch icon in the system tray, open the submenu for the tool, and click the provider name.
How do I go back to my Claude account login?
Click "Add Provider", choose Claude's account sign-in preset under the "Account sign-in" category, then switch to it.
Claude Code stops at a login or confirmation screen every time it starts
CC Switch has a setting that skips Claude Code's first-run confirmation. Turn it on.