Claude Code China Complete Guide
As of 2026-11-05, using Claude Code from China takes three steps: register at qcode.cc; top up with Alipay or WeChat Pay (no overseas credit card needed) and buy a plan from the balance, which creates your key starting with cr_; then set ANTHROPIC_BASE_URL to https://api.qcode.cc/api and put the key in ANTHROPIC_AUTH_TOKEN. On mainland China networks the docs recommend switching the domain to asia.qcode.cc. As of 2026-10-15, developers in China can run Claude Code by pointing ANTHROPIC_BASE_URL at QCode (for mainland China the docs recommend the asia.qcode.cc Asian node) and topping up with Alipay or WeChat Pay. claude-opus-5-5, claude-sonnet-5-5 and other models are available, and the same key also works with Codex.
Point this tool at the QCode endpoint — one key for Claude, GPT and Chinese models.
- Billed per token — live rates on /models
- Pay by card (Visa / Mastercard), Apple Pay, Google Pay or crypto
- Self-service: top up and activate instantly
Why Can't You Use Claude Code Directly in China?
Chinese developers face three barriers
Network Restrictions
api.anthropic.com cannot be reached directly from mainland China
Payment Incompatibility
Anthropic only accepts Visa/MasterCard and other international cards; Alipay, WeChat Pay, and UnionPay are not supported
Supported regions
As of 2026-10-15, mainland China is not on Anthropic's Supported Regions Policy list
Three Solutions Compared
Official subscription, official API or a QCode key
| Solution | Availability | Setup Difficulty | Payment | Overall Cost | Recommended |
|---|---|---|---|---|---|
| Claude subscription (Pro $20 / Max $100 / Ultra $200 monthly; no 5-hour limit on verified Ultra accounts) | Supported regions only | Official account required | Int'l Card | Low | ⚠️ |
| Official API key (Console) | Supported regions only | Console account required | Int'l Card | High | ⚠️ |
| QCode.cc Relay | Multiple switchable domains | 5 Minutes | Alipay / WeChat / Cards | Low | ✅ |
QCode.cc Setup Tutorial
5-minute setup, start using Claude Code immediately
Create a QCode.cc Account
Register at qcode.cc. QCode is prepaid: top up first (Alipay or WeChat Pay for CNY), then buy a Personal Plan or a Pay-as-you-go Pack from your balance.
Sign Up Now →Get Your API Key
After signing in, create your API key in the dashboard (it starts with cr_). This is your credential for Claude Code and Codex.
Configure Environment Variables
Set two environment variables in your terminal: ANTHROPIC_BASE_URL to https://api.qcode.cc/api (no trailing slash) and your key in ANTHROPIC_AUTH_TOKEN; if a tool only reads ANTHROPIC_API_KEY, the same cr_ key works there. For mainland China, the docs recommend the asia.qcode.cc domain.
Verify the Connection
Run the following command to verify the connection works:
Claude Code Feature Compatibility
Local CLI features (chat, file edits, Bash, MCP, Skills, Plugins, subagents) work as usual; features that rely on Anthropic account-side hosted services, such as cloud sessions and Remote Control, are not available with a third-party API key
Claude Code Agent Teams
Multi-agent work in parallel — Agent Teams runs over the same Messages API path
MCP Protocol Integration
Model Context Protocol fully proxied, third-party tools connect seamlessly
Claude Hooks
Automated Hooks workflows and event-triggered scripts work normally
Official Agent SDK
Official Agent SDK (Python / TypeScript) on the same key — just point ANTHROPIC_BASE_URL here
Codex CLI
Codex CLI uses the OpenAI Responses protocol: set base_url to https://api.qcode.cc/openai and call GPT models such as gpt-6.1-sol
Streaming Responses (SSE)
Server-sent event streaming, so replies appear as they are generated
Flexible Plans with Alipay Support
Choose your plan, scale anytime, no international card needed; daily limits reset at 00:00 Beijing time
Starter
¥63/mo
Daily limit $5
Great for individual developers
Daily 35
¥375/mo
Daily limit $35
Ideal for heavy use and small teams
Daily 85
¥860/mo
Daily limit $85
For high-frequency use and enterprise
Frequently Asked Questions
QCode also powers OpenAI Codex / GPT-5.6
Your QCode quota works across Claude Code and OpenAI Codex CLI — one shared balance, zero duplicate spend.
In depth: four things to know about Claude Code in China
Can you use Claude in China? Anthropic's supported-regions list
As of 2026-10-15, Anthropic's Supported Regions Policy (effective 2026-05-12) lists the countries and regions where its products and services are offered, and mainland China is not on that list.
The Supported Regions Policy is published by Anthropic; the version cited above took effect on 2026-05-12, and where Anthropic's own products and services are offered is governed by the latest version of that page.
Claude Pro/Max/Ultra subscription or a QCode key?
QCode.cc is an independent API access service, not affiliated with or endorsed by Anthropic. Developers in China use a QCode cr_ key: point Claude Code's ANTHROPIC_BASE_URL at QCode, put the key in ANTHROPIC_AUTH_TOKEN, and top up with Alipay or WeChat Pay. QCode gives you claude-sonnet-5 through a single API with no separate Anthropic account to manage. The same key also calls other Claude models such as claude-opus-5-5 and claude-sonnet-5-5; /models lists every model you can call.
Claude Code can run in two ways: signed in with a Claude subscription, or connected to a gateway with an API credential. The official docs say that while a gateway credential variable is active, requests carry that credential in place of the claude.ai subscription login and the subscription's usage limits do not apply. If you set only ANTHROPIC_BASE_URL without a credential variable, the saved claude.ai login stays the active credential. That is why a QCode setup needs both ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.
The QCode docs state that an Anthropic or OpenAI subscription cannot be used on QCode and is never drawn down by it; the two are parallel systems. QCode's own plans are prepaid: you top up first, then buy a plan that is paid from your balance. Usage is billed per token; per-model rates are listed on /models. Personal plans have no 4-hour window, and the daily limit resets at 00:00 Beijing time.
- Claude subscription (Pro / Max / Ultra): membership for Anthropic's own apps, billed monthly. On 2026-10-30 Anthropic renamed Max 5x to Max and Max 20x to Ultra; prices did not change.
- Official API key: a developer key from the Anthropic Console, billed per token and topped up on Anthropic's platform.
- QCode key (starts with cr_): one key for Claude, GPT and leading Chinese models, topped up with Alipay or WeChat Pay.
Paying from China: from top-up to your first key
The QCode dashboard lays out three steps: top up, buy a Personal Plan or a Pay-as-you-go Pack, start using it. In CNY you can pay with Alipay or WeChat Pay (no fee on either), CNY top-ups start at ¥30, Pay-as-you-go Packs start at $4, and the balance left after buying can be used to renew a pack or to buy a Personal Plan. In USD you can pay with Visa / Mastercard, Apple Pay, Google Pay or crypto across many coins and networks. CNY and USD balances are kept separately, and each top-up goes to the balance in its own currency.
Once the balance arrives, open qcode.cc/subscribe and pick a recommended plan or a custom configuration; this step is paid from your balance, not charged to a card again. The confirmation page reads 'Subscription Activated — Your API Key is created and ready to use', and your cr_ key is ready to copy. If you are unsure which tier to buy, start small and upgrade any time without losing value: buy the higher plan, email hi@qcode.cc, and the unused time on the old plan is credited back to your QCode balance pro rata.
- Alipay and WeChat Pay: credited to your CNY balance.
- Cards, Apple Pay and Google Pay: the balance is credited as soon as payment completes.
- Crypto: 0% platform fee, manual review in about a day.
- Ran out of today's allowance: buy a booster pack in the dashboard; it resets separately at 02:00 Beijing time the next day.
Setup details for China: install, persistent config and common errors
Install: the official npm package needs Node.js 22 or later, and the QCode docs give a mirror for mainland networks: npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com. You can also run the one-line setup script from the docs, curl -fsSL https://qcode.cc/install/claude-code.sh | bash (on Windows: irm https://qcode.cc/install/claude-code.ps1 | iex), which does the whole configuration in one command.
Persistence: the official docs recommend putting ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in the env block of ~/.claude/settings.json so background sessions pick them up too; when a shell export and the settings file set the same variable, the settings file wins. Do not put the key in a project's .claude/settings.json, because that file is committed with the repository. Then run /status in Claude Code: if the Anthropic base URL line shows your QCode address and the Auth token line names ANTHROPIC_AUTH_TOKEN, the setup is active.
- 401: the key is invalid or was not passed correctly; check that the full cr_ prefix is there. A key starting with sk-ant- is an official Anthropic key, not a QCode key.
- 404: usually a wrong path prefix or an extra trailing slash. Set ANTHROPIC_BASE_URL to https://asia.qcode.cc/api or https://api.qcode.cc/api, without /v1/messages.
- model_not_available_on_endpoint: a Claude model was sent to an OpenAI-protocol address; Claude models only work over the Anthropic protocol.
- Daily cost limit reached: the daily limit resets at 00:00 Beijing time, and a booster pack covers the rest of the day.
- ETIMEDOUT during install: switch to the mirror shown above.
More questions
Can I use Claude Code directly in China? Does Claude work in China?
As of 2026-11-05, not through Anthropic's own services: its Supported Regions Policy (the page is marked effective 2026-11-12) says its products and services are available only in the listed countries and regions, and mainland China is not on the list. As of 2026-10-15, mainland China is not among the countries and regions listed in Anthropic's Supported Regions Policy. Developers in China can use a QCode cr_ key to call Claude models from Claude Code, top up with Alipay or WeChat Pay, and connect through asia.qcode.cc as the docs recommend.
I already have Claude Pro, Max or Ultra. Can I use it on QCode?
No. A subscription is a membership for Anthropic's apps and includes no API allowance that can be used elsewhere; QCode bills per token, and the two are independent and can coexist. The same Claude Code install can sign in with the subscription or point at QCode with ANTHROPIC_BASE_URL and a cr_ key, depending on which credential is active.
How do I pay from mainland China?
Top up your CNY balance with Alipay or WeChat Pay; neither charges a fee, and CNY top-ups start at ¥30, with Pay-as-you-go Packs from $4 — the balance left after buying can be used to renew a pack or to buy a Personal Plan. You can also fund a USD balance with Visa / Mastercard, Apple Pay, Google Pay or crypto across many coins and networks.
Do I still need an Anthropic account to use Claude Code through QCode?
QCode gives you claude-sonnet-5 through a single API with no separate Anthropic account to manage. What you need is a QCode account and a key starting with cr_; the same key also calls claude-opus-5-5, claude-sonnet-5-5, claude-haiku-5-5 and more, with the full list on /models.
Which models can I pick in Claude Code?
Claude Code speaks the Anthropic protocol, so you can use Claude models such as claude-opus-5-5, claude-sonnet-5-5, claude-sonnet-5 and claude-haiku-5-5 and switch with the /model command; Chinese models such as deepseek-v4-pro and glm-5.3 also support the Anthropic protocol. For GPT models such as gpt-6.1-sol and gpt-6-sol, use Codex with base_url set to https://asia.qcode.cc/openai or https://api.qcode.cc/openai. The full list is on /models.
How soon can I start after topping up?
Card, Apple Pay and Google Pay payments are credited as soon as they complete; WeChat Pay confirmation can take a few minutes and the page updates on its own; crypto is reviewed manually in about a day. Once the balance is in, buy a plan and your key is created on the spot, so you are up and running in minutes.
How do I check that Claude Code is really using QCode?
Run /status in Claude Code. The Anthropic base URL line should show the QCode address you set and the Auth token line should name ANTHROPIC_AUTH_TOKEN; a Login method line naming a claude.ai account means the credential variable did not take effect. You can also look up the model, context length and usage of each request at probe.qcode.cc with your own key.
Start Using Claude Code Today
5-minute setup, top up with Alipay or WeChat Pay; for mainland China the docs recommend asia.qcode.cc
Further reading
Crypto payment guide
Nine coins, 56 networks, zero platform fee for AI coding API credits.
Buy Claude Code credits with USDT
18 USDT networks, zero platform fee, with per-chain cost notes and the USDT0 pitfall explained.
Pay-as-you-go Packs
One-time quota packs valid for 7 days, no subscription; extra packs add to the same key