Claude Code is arguably the most powerful AI coding assistant available today. It runs directly in your terminal, understands entire codebases, and can execute multi-step development tasks autonomously. But if you are a developer based in China, actually getting it to work is a different story entirely.
This guide is the operational setup path: prerequisites, shell environment variables, a quick status check, payment notes, and the common China-specific errors you are most likely to hit.
The Three Barriers to Using Claude Code in China
1. Network Accessibility
Anthropic's API endpoints are not reliably accessible from mainland China networks. Whether you are on China Telecom, China Unicom, or China Mobile, direct connections to api.anthropic.com suffer from packet loss, timeouts, and outright blocks. VPN solutions add latency, drop connections during long coding sessions, and create a frustrating experience when Claude Code needs sustained, stable connectivity for multi-turn conversations.
2. Payment Methods
Anthropic requires a non-Chinese credit card to purchase API credits. This means you need a Visa or Mastercard issued outside mainland China. For most Chinese developers, this is a significant hurdle. Setting up an overseas bank account or finding a friend to help with payments is not a sustainable workflow.
3. Rate Limits and Availability
Even if you solve the network and payment problems, Anthropic applies aggressive rate limits on their API, especially during peak hours. Heavy Claude Code sessions that involve large codebases can hit these limits quickly, interrupting your flow right when you need it most.
How Router One Solves All Three
China-Accessible API Endpoint
Router One provides an Anthropic-compatible API endpoint at https://api.router.one that is directly reachable from major Chinese ISPs. No VPN or proxy configuration is required. The endpoint is optimized for Chinese network conditions with routing that avoids congested international links.
Based on the China latency benchmark last updated 2026-05-15, Router One measured 110-130ms p50 across Beijing, Shanghai, and Shenzhen; individual networks may vary. See the evidence page at China latency benchmark.
WeChat Pay and Alipay Support
Router One accepts WeChat Pay and Alipay for account top-ups. Open the Router One dashboard, click top-up, scan the QR code with your WeChat or Alipay app, and your balance is available instantly. No foreign credit card needed. The checkout page is the source of truth for the minimum amount. WeChat Pay, Alipay, and Stripe currently usually start at $5 USD equivalent; RMB amounts are converted and shown at checkout using the current FX rate. Stablecoin top-ups usually start at $50 USD equivalent.
Paid-Usage Headroom
No low fixed cap for normal paid usage. Abuse prevention, per-account protection limits, and upstream constraints may still apply; if a request returns 429, check Dashboard -> Logs or contact support to raise limits.
Quick Setup: 3 Environment Variables
If you have already installed Claude Code, connecting it to Router One takes under a minute. Export three environment variables:
export ANTHROPIC_BASE_URL=https://api.router.one
export ANTHROPIC_API_KEY=sk-your-router-one-api-key
export ANTHROPIC_AUTH_TOKEN=sk-your-router-one-api-key
Replace sk-your-router-one-api-key with your actual API key from the Router One dashboard.
For persistent configuration, add these lines to your ~/.zshrc or ~/.bashrc.
For a detailed step-by-step walkthrough with screenshots, see our Claude Code Setup Guide.
Verify the Setup
Open a new terminal after editing your shell profile, then run:
echo $ANTHROPIC_BASE_URL
claude /status
The base URL should print https://api.router.one. If claude /status still points at Anthropic directly, restart the terminal session and confirm there are no older Claude Code settings in ~/.claude.
Real-World Latency: Direct vs Router One from China
The table below is a snapshot from the published benchmark. Based on the China latency benchmark last updated 2026-05-15, Router One measured 110-130ms p50 across Beijing, Shanghai, and Shenzhen; individual networks may vary.
| City | Direct (via VPN) | Router One | Improvement |
|---|---|---|---|
| Shanghai | 620ms avg, 12% timeout rate | 120ms avg, 0% timeout | 5x faster |
| Beijing | 580ms avg, 8% timeout rate | 110ms avg, 0% timeout | 5x faster |
| Shenzhen | 700ms avg, 15% timeout rate | 130ms avg, 0% timeout | 5x faster |
VPN-based access can produce inconsistent latency with frequent timeouts that force Claude Code to retry. Router One publishes this benchmark so latency claims on the site have a single evidence source.
WeChat Pay and Alipay Top-Up Walkthrough
Funding your Router One account takes about 30 seconds:
- Log in to your account at router.one
- Navigate to the billing or top-up section in the dashboard
- Enter the amount you want to add. The checkout page is the source of truth for the minimum amount. WeChat Pay, Alipay, and Stripe currently usually start at $5 USD equivalent; RMB amounts are converted and shown at checkout using the current FX rate. Stablecoin top-ups usually start at $50 USD equivalent.
- Select WeChat Pay or Alipay as your payment method
- Scan the QR code with your WeChat or Alipay app
- Confirm payment — your balance updates instantly
Router One supports prepaid wallet billing and live subscription plans. You can pay per token from wallet balance, with per-token pricing visible on the Models page, or choose a plan on the pricing page for predictable monthly spend.
Troubleshooting China-Specific Issues
DNS resolution failures — Some Chinese ISPs have aggressive DNS caching or filtering. If api.router.one does not resolve, try switching to a public DNS like 223.5.5.5 (Alibaba DNS) or 119.29.29.29 (Tencent DNS).
Corporate firewall blocking — If you are on a corporate network that blocks outbound HTTPS to unfamiliar domains, ask your IT team to whitelist api.router.one and router.one. Router One uses standard HTTPS on port 443, so there is nothing unusual about the traffic pattern.
Claude Code not picking up environment variables — Make sure you open a new terminal session after adding the exports to your shell profile. Run echo $ANTHROPIC_BASE_URL to verify the variable is set correctly before launching claude.
429 rate limit exceeded — No low fixed cap for normal paid usage. Abuse prevention, per-account protection limits, and upstream constraints may still apply; if a request returns 429, check Dashboard -> Logs or contact support to raise limits.
Slow response during peak hours — China's international bandwidth gets congested during business hours (roughly 9 AM - 6 PM CST). Router One's optimized routing mitigates this, but if you notice any slowness, try again in a few minutes. Consistent slowness should be reported to our support.
Payment not reflecting — WeChat Pay and Alipay top-ups are usually instant. If your balance has not updated after 5 minutes, check your payment app to confirm the transaction completed, then contact support with the transaction ID.
Get Started
Claude Code is too good a tool to be blocked by network issues and payment friction. Router One removes these barriers so you can focus on what matters — writing code with the best AI assistant available.
- Sign up at router.one
- Top up with WeChat Pay or Alipay
- Configure your three environment variables
- Start coding with Claude Code
For detailed setup instructions, see our Claude Code Setup Guide. To explore all supported models and pricing, visit the Models page.
Related Canonical Pages
- Commercial page: Claude Code in China
- Setup docs: CLI setup guide
- Evidence: China latency benchmark
- Trust: Security and Data retention