Router One
Back to Blog

How to Use Claude Code in China: No VPN, Alipay Payment, No Rate Limits

|Router One Team
claude-codechinaalipaywechat-payguide

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 covers the real barriers Chinese developers face when trying to use Claude Code, and how Router One eliminates every single one of them.

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 API endpoint at api.router.one that is directly reachable from all major Chinese ISPs. No VPN required. No proxy configuration. No packet loss. The endpoint is optimized for Chinese network conditions with routing that avoids congested international links.

From our testing across multiple cities, typical latency from mainland China to Router One is 80-150ms — compared to 300-800ms+ (with frequent timeouts) when trying to reach Anthropic directly through a VPN.

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. No currency conversion fees.

No Artificial Rate Limits

Router One does not impose the same restrictive rate limits as direct API access. Your requests are managed through intelligent routing that distributes load efficiently. As long as you have balance in your account, you can use Claude Code without worrying about hitting rate ceilings during intensive coding sessions.

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.

Real-World Latency: Direct vs Router One from China

We tested Claude Code from three Chinese cities using both direct access (through a commercial VPN) and Router One. Each test involved a typical coding task — analyzing a 500-line TypeScript file and suggesting refactoring improvements.

CityDirect (via VPN)Router OneImprovement
Shanghai620ms avg, 12% timeout rate120ms avg, 0% timeout5x faster
Beijing580ms avg, 8% timeout rate110ms avg, 0% timeout5x faster
Shenzhen700ms avg, 15% timeout rate130ms avg, 0% timeout5x faster

The difference is not subtle. VPN-based access produces inconsistent latency with frequent timeouts that force Claude Code to retry, breaking your development flow. Router One delivers stable, low-latency connections that let Claude Code work the way it was designed to.

WeChat Pay and Alipay Top-Up Walkthrough

Funding your Router One account takes about 30 seconds:

  1. Log in to your account at router.one
  2. Navigate to the billing or top-up section in the dashboard
  3. Enter the amount you want to add (minimum 10 CNY)
  4. Select WeChat Pay or Alipay as your payment method
  5. Scan the QR code with your WeChat or Alipay app
  6. Confirm payment — your balance updates instantly

Router One uses a prepaid credit model. You only pay for what you use, with per-token pricing visible on the Models page. No monthly subscriptions, no minimum commitments.

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.

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.

  1. Sign up at router.one
  2. Top up with WeChat Pay or Alipay
  3. Configure your three environment variables
  4. 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. And if you want to understand how Router One compares to other options, check out our Claude Code use case page.