Complete Guide to CC Switch: Seamlessly Switch Any Model for AI Coding Tools
This guide explains how the open‑source CC Switch tool intercepts local AI API calls, converts protocols, and forwards requests so that AI coding assistants like Claude Code can use any free or low‑cost model such as Xfyun Qwen 3.6 without code changes.
Core Functionality
CC Switch runs locally and acts as a translator and scheduler between an AI client and a model service. It intercepts outgoing HTTP requests, converts the request to the target model’s API protocol, replaces the original API key and endpoint with a configured free key and address, forwards the request, and returns the model’s reply in a format the client understands. This enables a client such as Claude Code to think it is calling Anthropic’s cloud model while the request is actually processed by Xfyun’s Qwen 3.6.
Installation (Windows)
1. Download
Visit https://ccswitch.io/zh/ and download the Windows (.exe) installer.
2. Install
Run the downloaded .exe and follow the wizard.
Allow network access when prompted by the firewall.
After installation a desktop shortcut and a tray icon appear.
3. Launch & Interface
Open the main window via the desktop shortcut.
Left pane: list of Configurations (initially empty).
Right pane: real‑time logs and status.
Top‑right “Create” button: add a new model configuration.
Right‑click the tray icon to enable/disable the proxy, view version, or exit.
Core Concepts
Provider specifies the protocol type of a model service, e.g., Anthropic for Claude‑series models or OpenAI for OpenAI‑compatible services. Selecting the correct Provider determines which API format the request will be converted to.
Config stores concrete connection details: Provider, API key, endpoint URL, model ID, etc. Multiple Configs can be created for the same Provider and switched with a single click.
Example Configs: 讯飞 Qwen 3.6 – Anthropic protocol, used by Claude Code. 本地 Ollama – OpenAI protocol, used by other clients.
Configuration Example: Xfyun MaaS Free Model
Prerequisites
Registered Xfyun MaaS account with an application created.
Obtained modelId (e.g., xfyun-qwen3.6-35b-a3b) and an HTTP‑protocol APIKey.
Step‑by‑Step
Open CC Switch and click the “Create” button in the top‑right corner.
Select “Custom Config” (or equivalent) to manually fill all parameters.
Enter the following fields:
Config Name : any identifier, e.g., 讯飞 Qwen3.6 (used only for recognition).
Provider : Anthropic (required for Claude Code compatibility).
API Key : the HTTP‑protocol APIKey copied from Xfyun (not the Spark‑type key).
Endpoint URL : https://maas-api.cn-huabei-1.xf-yun.com/anthropic (Anthropic‑compatible endpoint).
Model ID : the exact xfyun-qwen3.6-35b-a3b string from the platform.
If the client uses the OpenAI protocol (e.g., Codex, OpenClaw), set Provider to OpenAI and Endpoint URL to https://maas-api.cn-huabei-1.xf-yun.com/v2.
Click “Test Model”. A “connection successful” message or a valid response confirms the configuration.
Click “Save” and toggle the switch to On to enable the Config.
CC Switch is now ready to forward requests to Xfyun.
Using CC Switch with Claude Code
Ensure CC Switch is running and the desired Config is enabled.
Open a command prompt or PowerShell in the project directory.
Run claude to start Claude Code.
Claude Code’s request is intercepted and forwarded to Xfyun. Example interaction:
> 用 Python 写一个带重试机制的网络请求函数。Claude Code returns the generated code, completing the workflow at zero cost.
Note: Claude Code may still display “Claude” as the model name, but the inference is performed by Qwen; this is expected.
Additional Features
Fast Multi‑Model Switching
Create multiple Configs and toggle them on/off from the main window without restarting the client. Example use cases: free Qwen 3.6 for code generation, local Ollama for confidential projects.
Real‑Time Request Log
The right‑hand pane logs each forwarded request with timestamp, target model, HTTP method, and status code, aiding debugging.
Global Proxy & Smart Routing
CC Switch automatically adjusts the system proxy to capture AI tool traffic. Proxy rules can be modified in settings to avoid affecting other software.
Client Compatibility
Beyond Claude Code, CC Switch supports any client compatible with OpenAI or Anthropic protocols, including Codex, OpenClaw, Hermes, and other terminal tools.
Common Issues & Troubleshooting
Claude Code shows “cannot connect API” : Verify CC Switch is running, the Config is enabled, and the model test succeeds. Ensure the environment variable ANTHROPIC_API_KEY is not set.
Test model fails : Re‑check API Key and Endpoint URL (distinguish /anthropic vs /v2) and confirm network access to Xfyun domains.
Poor response quality or errors : Confirm the Model ID matches the platform exactly; try the /compact command to trim overly long context.
After disabling CC Switch Claude Code stops working : This is expected because request forwarding stops. Restart CC Switch or point Claude Code back to the original service.
Other software experiences network issues : Adjust proxy mode in CC Switch settings or temporarily exit the program.
Uninstall & Cleanup
Use Windows “Add or Remove Programs” to uninstall CC Switch.
The system proxy settings revert automatically, leaving no residual configuration.
Summary
CC Switch decouples AI tools from specific model services, allowing developers to combine any free or paid model with any client. With low resource usage, simple operations, and broad protocol compatibility, it turns a “free model + paid client” setup into a practical, cost‑free AI coding workflow. Following the steps above, users can connect high‑performance models such as Xfyun Qwen 3.6 to Claude Code within minutes and enjoy efficient, controllable AI programming.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
The Dominant Programmer
Resources and tutorials for programmers' advanced learning journey. Advanced tracks in Java, Python, and C#. Blog: https://blog.csdn.net/badao_liumang_qizhi
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
