Skip to content
Router One

Claude Code in China — Anthropic-compatible, no VPN

Router One runs Claude Code from Mainland China without a VPN: point ANTHROPIC_BASE_URL at the Anthropic-compatible endpoint https://api.router.one, use a Router One key, and pay per token from a wallet topped up by card or Alipay (or USDT/USDC on six chains) — no foreign credit card, and a cost trace on every request. Reaching Anthropic's own API from the mainland is slow and unreliable and bills to a foreign card; the gateway removes both blockers.

Direct access, no VPN

Claude Code uses the Anthropic-compatible endpoint at https://api.router.one. Review the published benchmark below before relying on any point-in-time network result.

Pay in RMB

Top up with a card or Alipay through one hosted checkout, or with USDT/USDC on six chains. No foreign credit card required.

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.

Review the China latency benchmark

This setup guide does not make a separate latency promise. The published snapshot, last updated 2026-05-15, covers Beijing, Shanghai, and Shenzhen on China Telecom, China Unicom, and China Mobile in a rolling 7-day window. It is not an SLA, and individual networks may vary; review the full method and caveats before judging fit for your workload.

Read the published benchmark

2-minute setup

If you have Claude Code installed, export two variables and relaunch. Persistent setup: add these lines to ~/.zshrc or ~/.bashrc. ANTHROPIC_API_KEY is not required — leave it unset.

  1. 1Create a Router One API keySign up at router.one and create an API key in the dashboard. Top up with a card or Alipay on the hosted checkout, or with USDT/USDC — no foreign credit card required.
  2. 2Point Claude Code at Router OneExport ANTHROPIC_BASE_URL=https://api.router.one and ANTHROPIC_AUTH_TOKEN set to your Router One key. ANTHROPIC_API_KEY is not required; unset it if you exported it earlier. Add the lines to ~/.zshrc or ~/.bashrc to persist them.
  3. 3Relaunch Claude CodeRestart Claude Code. Requests now route through Router One's China-reachable, Anthropic-compatible endpoint with no VPN.
terminal
# Point Claude Code at Router One
export ANTHROPIC_BASE_URL=https://api.router.one
export ANTHROPIC_AUTH_TOKEN=sk-your-router-one-key
unset ANTHROPIC_API_KEY
Read the complete guide

FAQ

Do I need a VPN?

No proxy or VPN is required for the Router One endpoint. The benchmark below documents the dated network snapshot and its caveats.

How does billing work?

Use prepaid wallet balance or a live subscription plan. Top up with a card or Alipay in one hosted checkout, or with USDT/USDC on six chains — usage outside plan coverage is still metered per token.

Is my data stored?

Router One does not retain prompt or model-response bodies from direct API calls. It records request metadata for billing, usage tracking, and troubleshooting. Playground saves conversation history so users can revisit and continue their chats.

What if the upstream Anthropic API goes down?

Claude Code traffic routes through Router One's infrastructure with automatic failover. When upstream issues occur, requests are retried or redirected transparently.

Can I run DeepSeek V4 inside Claude Code?

DeepSeek V4 Pro and Flash left Router One’s catalog on 2026-09-05, and V4 Pro remains unlisted. On 2026-09-10 deepseek-v4.1-flash was listed, with deepseek-v4-flash listed again alongside it; both are served on /v1/messages — the protocol Claude Code speaks — as well as on /v1/chat/completions and natively on /v1/responses. Check the endpoint list on the model page at /models before pointing Claude Code at a DeepSeek id; a delisted id is not callable regardless of historical protocol support.

Choose the next step for your Claude Code workflow

This page is the Claude Code setup path. Use the pages below for shared coding-tool controls, a specific 403 diagnosis, billing, or a different CLI.

Workflow hubRun all coding tools through one gatewayCreate a separate API key and spend cap for each coding tool while keeping one wallet and trace view.TroubleshootingFix a Claude Code 403Diagnose the base URL, token, stale session, key status, and Mainland China cases without repeating the setup guide.CostCut the per-token price of Claude callsPosted Claude rates run up to 90% off official prices on select models; the cheap Claude API page shows how the discount, per-key caps and traces fit together.PlansA Claude Max alternative on a flat monthly planRouter One's Pro, Max and Ultra plans ($20 / $48 / $149) meter monthly quotas across 30+ models with native Claude Code support — the page sets them against Claude Max's $100–$200.Setup guideOne-click Claude Code setupRun the install script or set ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN by hand — macOS, Windows, and Linux steps.Agent SDKRun the Claude Agent SDK on the gatewayPass the same two variables through ClaudeAgentOptions(env=…), pick a Claude-family ID served on /v1/messages, and bound a query with max_turns.API referenceConfirm the Messages API requestExact /v1/messages request fields, streaming, and the Anthropic error envelope Claude Code sees.Server-side toolsClaude web search and code execution through the APIweb_search and code_execution run on /v1/messages at the model's standard token rate; web_fetch and the MCP connector are rejected with 400.BillingFund the same wallet with AlipayAlipay credits the wallet used by Claude Code and every other Router One client.Alternative CLISet up OpenAI Codex CLI insteadCodex uses its native Responses provider configuration rather than Claude Code's Anthropic variables.ComparisonClaude Code vs Codex CLI, honestly comparedStill deciding between the two CLIs? A workflow-first comparison of what each is actually good at.

Start using Claude Code in China

Get your API key