Beginner tutorial: CC Switch
Point Claude Code / Codex at SoleAPI with a GUI — no config files, no environment variables.
If you're not comfortable editing config files, use the open-source desktop app CC Switch: it gives Claude Code, Codex, Gemini CLI and other AI coding tools a visual "provider" manager. Enter the base URL and key once, then switch between the official API and SoleAPI with one click — no manual configuration anywhere.
Before you start: get your API key
Sign up for SoleAPI and create a key (it looks like sk-sole-…) on the console's "API Keys" page — see the Quickstart.
The full key is shown only once at creation — copy and save it before moving on.
Step 1: Install CC Switch
- macOS: run the command below, or download the
.dmgfrom Releases.
brew install --cask cc-switch- Windows: download the MSI installer (or the portable ZIP) from Releases.
- Linux: Releases provide
.deb/.rpm/ AppImage packages. - Official download page: ccswitch.io/download (latest builds for every platform)
Step 2: Import SoleAPI with one click
The console's API Key page has an Import to CC Switch button — in the dialog shown right after creating a key, and inline on every existing key. Clicking it launches your local CC Switch with a configuration preview; confirm and the provider is added with the base URL and key filled in automatically.
One-click import requires CC Switch v3.16 or later (with ccswitch:// deeplink support). If nothing happens on click, make sure CC Switch is installed and has been launched at least once.
Imported providers have CC Switch usage display enabled automatically: the list shows your balance and total spend, fetched from GET https://api.soleapi.com/v1/usage (authenticated with your API key; returns remaining / used / total / unit, in Credits). When adding manually, you can enable it by entering that URL in the provider's usage settings.
Add manually (fallback)
If one-click import isn't an option, fill it in by hand:
- Open CC Switch and pick the tool tab you want to configure (e.g. Claude Code).
- Click "Add Provider", choose a custom configuration, and fill in:
| Tool | Base URL | API Key |
|---|---|---|
| Claude Code | https://api.soleapi.com | sk-sole-… |
| Codex | https://api.soleapi.com/v1 | sk-sole-… |
- Name it anything you like (e.g.
SoleAPI) and save.
No trailing slash in the base URL: https://api.soleapi.com/ makes the tool build paths with a double slash and fail.
Step 3: Enable and verify
- Select the SoleAPI entry and click "Enable" — CC Switch writes the configuration into the tool's config file for you.
- Restart your terminal (or the CLI tool) so the change takes effect; Claude Code supports hot-switching and usually needs no restart.
- Open Claude Code and send any message — a normal reply means you're connected. You can also verify the key directly:
curl https://api.soleapi.com/v1/models \
-H "Authorization: Bearer sk-sole-your-key"To switch back to the official API (or any other provider) later, just click that entry in the CC Switch list or its system-tray menu — you can switch back and forth any time.
Troubleshooting
- 401 errors: the key was copied incompletely or is disabled — check it in the console; see Errors for details.
- Double slash (
//v1) in error messages: remove the trailing/from the base URL and enable again. - Switch doesn't take effect: restart the terminal and confirm the provider shows as enabled in CC Switch.
- Nothing happens when clicking “Import to CC Switch”: CC Switch isn't installed, is older than v3.16, or has never been launched (so the protocol isn't registered); install/launch it and click again.
CC Switch is a third-party open-source tool, unaffiliated with SoleAPI. Prefer not to install a desktop app? Manual setup is just as simple — see the Quickstart.