Connecting Claude Code to Chinese LLMs: A Practical Guide to CC Switch Configuration and Model Switching
Connecting Claude Code to Chinese LLMs…
A practical guide to connecting Claude Code with Chinese LLMs using CC Switch for flexible model switching.
This guide explains how to use CC Switch to replace Claude Code's backend with Chinese LLMs like DeepSeek, Xiaomi Mimo, and MiniMax. It covers the complete workflow from obtaining API Keys and configuring Base URLs to model mapping and connectivity testing, along with common error troubleshooting tips for seamless multi-model switching.
Why Connect Chinese LLMs to Claude Code?
Claude Code is an AI programming tool developed by Anthropic that has gained widespread popularity among developers thanks to its excellent code comprehension and generation capabilities. Unlike traditional code completion tools, Claude Code runs as an Agent in the terminal, built on Claude's large language model series using advanced training methods like RLHF (Reinforcement Learning from Human Feedback) and Constitutional AI. It can understand project context, perform file operations, run commands, and achieve a complete loop from requirement understanding to code generation. This Agent-based programming paradigm represents a new direction in AI-assisted development.
However, when using it in China, several practical issues are hard to avoid:
- High registration barriers: Requires overseas phone number verification, blocking many users at the first step
- Unstable network: Intermittent connections seriously disrupt development workflow
- Usage limits: Once monthly Token quotas are exhausted, you can only wait
- Scenario-specific needs: Writing business logic, doing code reviews, generating test cases — different tasks suit different models
To address these pain points, CC Switch is a tool worth noting. Designed specifically for Claude Code, it supports replacing the underlying model with Chinese LLMs like DeepSeek, Xiaomi Mimo, GLM, Qwen, and MiniMax, allowing developers to switch flexibly based on actual needs.
These Chinese models each have their own technical strengths: DeepSeek uses a MoE (Mixture of Experts) architecture, achieving efficient inference at large parameter scales through sparse activation; Xiaomi Mimo has specialized optimizations for code generation tasks; the GLM series employs an autoregressive blank-filling training objective; and the Qwen series has unique designs for long-context processing. You can choose based on specific task characteristics to leverage each model's advantages.
What Is CC Switch? Core Features Overview
Feature Overview
CC Switch is essentially a model switching management tool that solves one core problem: keeping Claude Code's frontend interaction experience unchanged while letting you choose the backend model.
Its core technical principle is the API Compatibility Layer. Claude Code originally communicates with Claude models through Anthropic's proprietary API protocol. CC Switch acts as a protocol converter in between, transforming Anthropic-format requests into the OpenAI API format compatible with various model providers. This pattern is known in the industry as an API Gateway or API Proxy pattern, similar to the gateway layer in microservice architectures, achieving decoupling between the frontend application and backend models.
Its main capabilities include:
- Centralized multi-model management: Configure and manage all model providers in a single interface
- One-click model switching: No need to manually edit config files — just click to switch
- Built-in preset templates: Configurations for mainstream providers like DeepSeek and Xiaomi Mimo are pre-configured
- Custom provider support: Providers not in the presets can be manually configured with Base URL and API Key
- Connectivity testing: Verify model availability directly after configuration
Beyond Claude Code, CC Switch is also compatible with other mainstream AI Agent tools, giving it broad applicability.
Installation
CC Switch provides installation packages for all major systems. The installation process is straightforward — download the appropriate version from the official page and follow the prompts to install and launch.
Practical Configuration 1: Connecting DeepSeek
Step 1: Obtain a DeepSeek API Key
- Go to the DeepSeek official website and navigate to the API Open Platform
- First-time users need to bind a phone number and complete identity verification
- Top up your account with some credit (pay-as-you-go billing)
- Go to the API Key management page and click "Create API Key"
- Enter an easily identifiable name, copy the generated Key and store it securely
A note on pay-as-you-go billing: APIs use a Token-based pricing system. Tokens are the basic units that large language models use to process text — Chinese averages about 1.5-2 Tokens per character, while English averages about 1-1.5 Tokens per word. Token consumption in programming scenarios is typically high because complete code context needs to be passed in. DeepSeek's API pricing distinguishes between input Tokens and output Tokens, with input prices usually lower than output prices. When planning budgets, developers should consider the different consumption patterns of code review (high input, low output) versus code generation (low input, high output).
Step 2: Complete Configuration in CC Switch
- Open CC Switch and select Claude Code mode
- Click the "+" button to add a new model configuration
- Select DeepSeek from the preset provider list
- Paste the API Key you just copied
- Click "Get Model List" — the system will automatically fetch available models (e.g., DeepSeek V4 Pro, Flash, etc.)
- Select the target model and map it to Claude Code's official models (Sonnet, Opus, etc.)
- Enable the "Follow Context" option and click "Add"
About Step 6 — model mapping: This redirects the model identifiers that Claude Code calls internally (such as claude-sonnet-4-20250514, claude-opus, etc.) to the corresponding identifiers of Chinese models. Claude Code automatically selects different model tiers based on task complexity — lightweight models for simple tasks (corresponding to Haiku) and high-performance models for complex tasks (corresponding to Opus). A sound mapping strategy should consider each model's capability tier, matching Chinese models by performance level to the appropriate positions. For example, map DeepSeek V4 Pro to the Opus position and Flash series to the Haiku position.
Step 3: Test Connectivity
After configuration, click the "Test Model" button. If it shows running normally, the configuration is successful and ready for use.
Note: Base URL Must Be Accurate
Here's a common pitfall: The Base URL must be strictly correct. The Base URL in CC Switch uses an Anthropic-compatible format — even an extra slash or a missing path segment will cause a 404 error during testing. If you encounter this, carefully verify and correct the URL.
Practical Configuration 2: Connecting Xiaomi Mimo
Obtain a Xiaomi Mimo API Key
- Go to the Xiaomi Model Open Platform official website
- Log in and complete identity verification
- Top up your account, then click "Create New API Key"
- Confirm creation and copy the API Key
Configure Xiaomi Mimo in CC Switch
- Click the "+" button and select Xiaomi MIMO from the preset providers
- Enter the API Key
- Click "Get Model List" to view all available models
- Select the target model (e.g., v2.5 version)
- Click Add to complete the configuration
- Test the model to confirm connectivity
The entire process is identical to the DeepSeek configuration. Other model providers (MiniMax, GLM, Qwen, etc.) follow the same logic — master one and you can handle them all.
Verifying and Switching Models in Claude Code
Launch and Verification Process
After configuration, actual usage involves three steps:
- In CC Switch, select the model configuration you want to use and click "Enable"
- Open the terminal and launch Claude Code
- Use the
/modelcommand to check the current model and confirm it has switched to the target model
Flexible Switching Between Multiple Models
When you need to switch to a different model, the process is simple:
- Exit the current Claude Code session
- Return to CC Switch and click the "Enable" button for another model
- Restart Claude Code to use the new model
In testing, DeepSeek, Xiaomi Mimo, MiniMax, and other models all connected successfully, with response speed and quality within acceptable ranges.
Configuration Notes and Common Error Troubleshooting
Key Configuration Points
| Configuration Item | Description |
|---|---|
| API Key | Must be accurate — directly affects authentication |
| Base URL | URLs may differ between subscription types (API/Coding Plan/Talking Plan) — pay attention to the distinction |
| Model Mapping | Chinese models need to be mapped one-to-one with Claude Code's official models |
Common Error Codes and Solutions
- 401 Error: API Key is incorrect or unauthorized — recheck that the Key is complete
- 402 Error: Insufficient account balance — top up on the provider's platform
- 404 Error: Base URL is misconfigured — verify the URL character by character
- 429 Error: Request rate limit exceeded — wait a moment and retry
- 400 Error: Request parameter error — check whether model mapping is correct
Skipping Anthropic Official Login
When first installing Claude Code, it prompts you to log in to an Anthropic account. By configuring specific environment variables, you can skip the official login verification and directly use third-party models configured through CC Switch — no Anthropic account needed.
The technical principle: Claude Code checks local environment variables at startup to determine the authentication method. By setting specific environment variables (such as ANTHROPIC_API_KEY and related BASE_URL variables), you can make Claude Code skip the OAuth login flow and instead communicate using the API endpoint specified in the environment variables. This is a common authentication mechanism design in CLI tools — environment variables are read first, with interactive login as a fallback. CC Switch is essentially a graphical tool that automates the management of these environment variables.
Summary
CC Switch provides a pragmatic path for Chinese developers to use Claude Code. With this tool, you can:
- Bypass registration and network restrictions — no longer dependent on overseas phone numbers or stable international networks
- Choose models on demand — Chinese LLMs like DeepSeek, Xiaomi Mimo, and MiniMax are available anytime
- Flexibly handle quota issues — quickly switch to alternatives when your primary model's quota runs out
- Match different development scenarios — select the most suitable model for different tasks
The entire configuration process boils down to three core steps: Obtain API Key → Configure in CC Switch → Enable and Verify. The process is clear, the learning curve is low, and it's worth trying for developers who need it.
Related articles

Claude Code for Test Development in Practice: An AI Programming Workflow That Doubles Your Efficiency
A practical guide to Claude Code for test development: auto-generating test scripts, Plan Mode workflows, MCP + Playwright integration, and Subagent parallel tasks to build systematic AI-assisted workflows.

Hermes Agent Hands-On Review: An AI Efficiency Revolution for Indie Game Developers
Indie game developer reviews Hermes Agent vs OpenClaude: intelligent context compression, real-time Memory, remote control via Telegram, and practical use cases in game dev, social media, and email.

Vibe Coding Beginner's Guide: Tool Selection Across Three Categories with Practical Examples
A comprehensive guide to Vibe Coding's three tool categories: Agent frameworks, CLI Coding, and IDE tools, with practical examples including Snake game and data analysis workbench.