CC Switch
CC Switch is an open-source desktop application for centrally managing provider configurations for multiple AI coding tools (Claude Code, Codex, Gemini CLI, etc.). Add your CloudBase provider configuration once in CC Switch, and it becomes available across multiple tools — no separate configuration needed for each.
Prerequisites
- You have activated a TCB environment and obtained the environment ID
cloudBaseEnvID - Enable the required model in the AI console
- Obtain the
Base URLandAPI Keyin the AI console
Configuration Steps
We use CC Switch v3.16.1 as an example.
1. Install CC Switch
- macOS
- Windows
- Linux
Recommended via Homebrew:
brew install --cask cc-switch
Or download CC-Switch-*-macOS.dmg from the Releases page.
Download CC-Switch-*-Windows.msi from the Releases page.
Download from the Releases page:
CC-Switch-*-Linux.deb— Debian/UbuntuCC-Switch-*-Linux.rpm— Fedora/RHEL/openSUSECC-Switch-*-Linux.AppImage— Universal format
2. Add CloudBase as a Provider
- Open the CC Switch desktop app
- Click the + button in the top-right corner and select Add Provider
- Choose Custom Configuration from the presets
- Fill in the following information:
| Field | Description |
|---|---|
| Provider Name | Enter "CloudBase" or a custom name |
| API Key | The API key obtained from the AI console |
| Base URL | Request address: https://{{cloudBaseEnvID}}.api.tcloudbasegateway.com/v1/ai/cloudbase |
- Select the API Format based on the AI tool you are using
Choosing the API Format
CloudBase AI supports the following protocols:
- Anthropic Messages: The native interface protocol for Claude models
- Chat Completions: OpenAI-compatible general-purpose chat protocol
- Responses API: OpenAI's next-generation API, currently only supported by some models
Select the API format based on the AI tool:
| AI Tool | Recommended API Format | Notes |
|---|---|---|
| Claude Code | Anthropic Messages | Native format, no additional setup needed |
| Claude Desktop | Anthropic Messages | Native format, no additional setup needed |
| Codex | Chat Completions | Requires local routing to be enabled |
| Gemini CLI | Chat Completions | General format |
| OpenCode | Chat Completions | General format |
| OpenClaw | Chat Completions | General format |
| Hermes | Chat Completions | General format |
Configuring for Claude Code / Claude Desktop (Anthropic Messages):
Select the Anthropic Messages format (default), paste your CloudBase API Key and Base URL. No advanced options changes needed.
Configuring for Codex (Chat Completions):
-
In the advanced options, switch the API format to Chat Completions
-
Check Needs Local Route Mapping
-
In the model mapping table, enter the model ID (copy an enabled model identifier from the AI console model list)
-
Save the configuration and enable the CloudBase provider
After switching providers, most AI tools require a restart of the terminal or CLI tool. Claude Code supports hot-switching and does not need a restart.
Usage with AI Tools
Once configured, the following AI tools can directly use CloudBase AI models:
- Claude Code — Uses Anthropic Messages protocol (native), run
claudein the terminal - Claude Desktop — Uses Anthropic Messages protocol (native)
- Codex — Uses Chat Completions protocol (requires local routing enabled), run
codexin the terminal - Gemini CLI — Uses Chat Completions protocol, run
geminiin the terminal - OpenCode — Uses Chat Completions protocol
- OpenClaw — Uses Chat Completions protocol
- Hermes — Uses Chat Completions protocol
Common Error Troubleshooting
| Error Message | Solution |
|---|---|
401 Credentials are invalid | The API Key is incorrect or may have been deleted. Go to the AI console to obtain a new one. |
404 Model not found | The Base URL or model name is incorrect. Make sure the model is enabled in the AI console. |
429 Token usage exceeded quota limit | Token quota exhausted or the model is not enabled in the AI console. |
| Codex connection failed | Make sure the local routing service (proxy mode) is enabled and the API format is set to Chat Completions. |
| Connection refused | Check your network connectivity to the CloudBase API and verify the environment ID in the Base URL is correct. |