Claude Code in China: Model Selection & Cost-Saving Configuration Guide

A practical guide for Chinese developers to access Claude Code cheaply using DeepSeek V4 Pro and proxy services.
This guide helps Chinese developers use Claude Code cost-effectively by recommending DeepSeek V4 Pro (MoE architecture, currently at 25% off) over risky direct Anthropic connections. It explains token billing, compares proxy services vs. direct access, covers monthly Coding Plan subscriptions for high-frequency users, and provides simple environment variable configuration steps.
Introduction: Why Claude Code Deserves Attention from Chinese Developers
Claude Code is a command-line AI programming tool developed by Anthropic. Thanks to its impressive code comprehension and generation capabilities, it's becoming a daily staple for a growing number of developers. Unlike IDE plugin-based tools such as GitHub Copilot or Cursor, Claude Code runs directly in the terminal, capable of reading entire code repositories, executing shell commands, and completing multi-step Agentic Coding tasks.
Agentic Coding has been the defining direction in AI programming tool evolution over the past two years. Traditional code completion tools (like early Copilot) could only generate a line or two at the cursor position — a purely "reactive" mode. Agentic Coding gives AI the ability to actively plan, decompose tasks, and invoke tools. It can read the README and directory structure, open relevant files step by step, run test commands to verify results, and autonomously fix errors — all without requiring human intervention at every step. This capability relies on the Tool Use / Function Calling interface, which allows the model to invoke external capabilities like file I/O, terminal commands, and web search during inference. This paradigm gives Claude Code much stronger autonomous problem-solving ability, but it also means each task processes far more context than a typical chat session. For developers in China, accessing it affordably and reliably is a very real practical challenge.
This article draws on hands-on experience shared by a Bilibili content creator to walk through a complete framework — from model selection and cost control to environment configuration — so you can avoid the common pitfalls.
There are really only two core questions: which model to use, and how to configure access. These two factors directly determine both your experience and your spending.
Model Capability vs. Cost: Two Conversations Could Cost You ¥37
In Claude Code, you can freely configure different large models as the backend. The most capable flagship models (such as Claude Sonnet and Opus series) offer context windows of up to one million tokens, but the price tag is steep — input costs $3–5 per million tokens, while output can run $15–25 per million, with a potential 5× gap between input and output pricing.
Understanding token billing: A token is the basic unit that large language models use to process text. Roughly speaking, one English word equals about 1.3 tokens, and one Chinese character equals about 1.5–2 tokens. Output tokens are generally priced 3–5× higher than input tokens, because generating text requires more compute than processing it. In a coding context, the model needs to "read" the entire codebase, conversation history, and current instructions with every turn — easily accumulating tens of thousands or even hundreds of thousands of tokens, far exceeding the hundred-or-so tokens typical of a casual Q&A.
These numbers can feel abstract until you see a real-world example. The Bilibili creator shared a firsthand warning: he initially configured Alibaba Cloud's Qianwen Coder model, with about ¥37 in account balance. The result? After just two conversations on a moderately large project, the entire ¥37 vanished instantly, triggering an insufficient-balance disconnect.

The reason is that coding tools consume far more context than regular chat — every conversation requires the model to process large amounts of code context. Qianwen Coder uses tiered pricing at around ¥24 per million tokens, which is on the expensive side. Burning through ¥37 in two large-project conversations isn't surprising at all.
The Key to Saving Money: Prioritize a Monthly Coding Plan
For high-frequency coding use cases, the creator's first recommendation is: don't pay per token — find a monthly Coding Plan subscription. Taking Qianwen as an example, a ¥200/month coding plan allows 6,000 calls per 5-hour window, with the quota automatically refreshing every 5 hours once exhausted. For developers writing code every day, a monthly subscription is far more economical than pay-as-you-go — fixed monthly fee, zero psychological cost every time you use it.
Access Methods Compared: Direct Connection, Proxy, and Domestic Models
The second challenge in configuring Claude Code is network access. The creator explicitly warns that directly connecting to Anthropic's servers carries extremely high risk.
Why Direct Connection Is Not Recommended
Anthropic currently restricts service to mainland China and certain other regions. Its risk control system cross-checks multiple signals: the geographic location and ISP of your IP address, device fingerprints from account registration, the issuing country of your payment method, and how frequently your IP address changes during usage. The creator learned this the hard way: he had four accounts purchased through overseas friends, and all four were banned. Even after completing real-name verification or facial recognition, if the system detects frequent IP jumps or a restricted region, it will immediately ban the account — and the balance you've loaded is typically non-refundable. For Chinese users, the direct-registration-and-top-up route is essentially a money pit.
Proxy Services: The More Stable Practical Choice
API proxy services are commercially applied implementations of a reverse proxy architecture. Proxy providers typically use Nginx, Caddy, or custom gateways on overseas VPS instances to build a proxy layer that forwards requests to Anthropic's original API endpoints, while exposing an interface compatible with the original format. Users need almost no code changes — just swap out the Base URL and key. Since Anthropic always sees the proxy provider's fixed overseas IP as the request source, it both bypasses regional blocks and avoids triggering risk controls from frequent IP changes.
That said, there are risks to be aware of when using proxy services: first, the stability of the provider — some smaller operators may shut down without warning; second, data security — all request content technically passes through the proxy provider's servers, so be cautious when handling proprietary or sensitive code; third, latency — the additional network hop typically adds 50–200ms of response delay. It's advisable to choose providers with a solid reputation and avoid sending highly sensitive code through them.
Compared to direct connection, the creator recommends using a proxy service. While proxy connections are slightly slower than direct connections in speed and responsiveness, as long as you pick a reliable provider, the practical experience is more than sufficient.

From a cost perspective, proxies are actually more affordable. The creator's real-world experience using a proxy to access the Sonnet model: each coding session costs roughly ¥1 to ¥1.5 RMB, and simple questions with minimal context can cost just a few cents. Compared to direct connection — which is both expensive and ban-prone — proxies win on both stability and value.
Top Recommendation: DeepSeek V4 Pro
If everything above has been about trade-offs, the creator's final recommendation is refreshingly clear — DeepSeek V4 Pro.

Why DeepSeek Can Be Both Good and Cheap
DeepSeek V4 uses a Mixture of Experts (MoE) architecture. This approach traces its roots to a 1991 academic paper and has been widely adopted in recent years by Mistral, DeepSeek, Google (Gemini 1.5), and others. The core mechanism: the model is split into multiple "expert" sub-networks, and during each inference pass, a lightweight "router" (Gating Network) dynamically selects a small subset of experts to participate in computation based on the input, while the rest remain silent. Taking DeepSeek V3 as an example — with a total parameter count of roughly 671B, each inference only activates about 37B active parameters, bringing compute consumption close to a medium-sized dense model while retaining the knowledge capacity and generalization ability of a much larger model. This allows for deploying models with far larger total parameter counts on the same GPU budget, striking a better balance between inference cost and model capability — and this is the underlying reason it can deliver high-quality service at low prices.
DeepSeek's performance in code generation has been validated across multiple public benchmarks. Among them, SWE-bench is currently the most realistic engineering-scenario evaluation — its dataset is drawn from real GitHub Issues and corresponding Pull Requests, requiring the model to locate bugs within a full repository context and generate patches that pass unit tests, verifying end-to-end engineering repair capability. DeepSeek's scores on SWE-bench are on par with GPT-4o and Claude Sonnet, making it one of the key references for distinguishing top-tier coding models. Combined with zero network barriers for direct access from China, its overall value proposition is exceptional.
Price Advantage: Extremely Competitive During the Discount Period
DeepSeek V4 is currently in a promotional period, with the Pro version at 25% of standard pricing: output drops from ¥24 to ¥6 per million tokens, and input is just ¥3 per million, with cache hits bringing the price even lower. The creator puts it bluntly — writing code at this price "feels really good." Topping up ¥12 is roughly enough to complete two projects, and sometimes multiple conversations cumulate to just a few cents total.
Note that this discount only runs until the end of this month, and whether prices will revert afterward is uncertain. If it returns to the full ¥24 price, the cost impact will be noticeably higher. Developers who are interested should take advantage of the discount window and top up while it lasts.
Coding Capability: Impressive Real-World Performance
Beyond the pricing, the creator gives DeepSeek V4 Pro's coding capability extremely high marks. Based on real-world usage with AI writing the code and human oversight guiding direction, he describes its programming output as "incredibly powerful" and "highly accurate," with overall performance surpassing GLM, MiniMax, and even Claude Sonnet.

Combining low cost with strong coding performance, DeepSeek V4 Pro has become the top cost-effective choice for Chinese developers accessing Claude Code.
Environment Configuration: Three Steps to Get Up and Running
The configuration itself isn't complicated. The core is setting the following two environment variables in your system:
ANTHROPIC_AUTH_TOKEN: your authentication tokenANTHROPIC_BASE_URL: the service endpoint URL
A quick note on environment variables: Environment variables are a global configuration mechanism provided by the operating system. Any process running on the system can read them, making them a common way to pass sensitive configuration like API keys without hardcoding them in your source code. Claude Code reads these two variables to determine its authentication method and request target — by replacing
ANTHROPIC_BASE_URLwith the endpoint of a proxy service or domestic model, you can switch models without modifying any source code. Windows users can set permanent environment variables through the System Properties panel; macOS/Linux users typically add them to~/.zshrcor~/.bashrc.
When using a proxy service, both the token and Base URL are provided by your proxy provider — just ask them directly. Don't trust so-called "shared account" schemes; those carry a real risk of being scammed.
When using a domestic model (such as DeepSeek V4 Pro), simply fill in the corresponding domestic API endpoint and your API key.
Once configured, launch Claude Code and you're good to go. The creator specifically emphasizes: do not register an Anthropic official account or top it up directly — the ban rate is extremely high, and you'll most likely end up with nothing to show for it.
Summary: The Optimal Path to Accessing Claude Code from China
Drawing on the creator's hands-on experience, the optimal approach for using Claude Code in China can be summarized as follows:
- Avoid direct connection to the official site: Ban rates are extremely high — real-name verification won't save you;
- Start with DeepSeek V4 Pro: MoE architecture ensures performance, the discount makes it exceptional value right now, and its coding ability is top-notch;
- High-frequency users should choose a Coding Plan: Monthly subscriptions save far more than per-token billing;
- If you need an overseas model, use a proxy: Choose a reputable provider and keep costs to around ¥1 per conversation.
Understanding how token consumption works, picking the right model, and choosing the right access method — that's what it really means to "avoid the pitfalls." Rather than repeatedly burning money on direct-connection ban risks and inflated costs, go straight to a high-performance domestic model or a stable proxy, save time and money, and focus on writing code.
Related articles

From Chat to Agent: Automating Your Entire Business Workflow with AI Agents
Veteran AI practitioner Remy breaks down the leap from chat models to AI agents: how agents work, the three pillars of context, tools, and skills, MCP connections, and hands-on architecture to make you a 100x employee.

Understand Anything: The AI Skill That Turns Code into Interactive Knowledge Graphs
Understand Anything is a high-star open-source GitHub skill that runs static analysis on any codebase and generates interactive knowledge graphs. It supports Claude Code, Cursor, Copilot and other agents, letting engineers ask questions in natural language with path references.

Kimi K3 Released: How a 2.8 Trillion Parameter Open Model Reshapes AI Cost-Effectiveness
Moonshot AI unveils Kimi K3: a 2.8 trillion parameter, 1M context, natively multimodal open model. With KDA architecture and ultra-low cost, it rivals GPT-5.6 and Fable 5, redefining AI cost-effectiveness.