Skip to content

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. Each key and each account runs under default request-per-minute and token-per-minute limits, and upstream constraints may still apply; if a request returns 429, back off and retry (honor Retry-After when it is sent), and if your traffic needs higher limits, email support@router.one to have the key or account limits raised.

Review the China latency benchmark

This page 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. On Claude Code 2.1.284 or later, also set ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5 and ANTHROPIC_DEFAULT_FABLE_MODEL=claude-fable-5, and optionally ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5: per Claude Code's changelog and model configuration docs (Claude Code 2.1.296, checked 2026-10-10), the sonnet alias now sends claude-sonnet-5-5, which Router One lists from 2026-09-29 but no plan tier covers as of the 2026-10-09 plan response, and the fable alias sends claude-fable-5-1, which Router One no longer lists as of the 2026-10-09 catalog, so the Fable line keeps it on Claude Fable 5 (in no plan tier as of the 2026-10-09 plan response); from 2.1.293 the haiku alias sends claude-haiku-5-5 (Claude Haiku 5.5), which Router One lists as of the 2026-10-10 catalog but no plan tier covers as of the 2026-10-10 plan response, so the optional Haiku line keeps it on Claude Haiku 4.5; the FAQ below explains when each line matters.

  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
# Claude Code 2.1.284+: pin the model aliases (see the FAQ below)
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5
export ANTHROPIC_DEFAULT_FABLE_MODEL=claude-fable-5
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.

Can I use Claude Opus 5.5, and does my plan cover it?

Yes, you can use it: Claude Code 2.1.280 and later defaults to Claude Opus 5.5 and, unless you pin a model, sends claude-opus-5-5, which Router One serves on /v1/messages. Plans do not cover it yet: as of the 2026-09-29 plan response no Pro, Max or Ultra tier lists Opus 5.5, so those requests bill per token to your wallet. To keep drawing plan quota, set ANTHROPIC_MODEL=claude-opus-5 and ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5 (the second keeps the opus alias and opus subagents on the plan too) — Claude Opus 5 stays in the Premium models tier. Model pinning, plans and the 1M window are covered in /blog/claude-code-opus-5-5-setup.

Claude Code 2.1.284 sends claude-sonnet-5-5 for the sonnet alias: does Router One serve it, and does my plan cover it?

Per its changelog and model-config docs (checked 2026-10-01), Claude Code 2.1.284 (2026-09-28) points the sonnet alias at Claude Sonnet 5.5 and sends claude-sonnet-5-5. Router One lists claude-sonnet-5-5 from 2026-09-29, but no Pro, Max or Ultra tier lists it in the 2026-09-29 plan response, so on a plan everything that goes through the sonnet alias — /model sonnet, subagents defined with model: sonnet, /statusline and the execution phase of opusplan — bills per token to the wallet. To keep those requests on plan quota, set ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5 (Mid-tier models tier of all three plans) and, optionally, ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5 for background tasks; if the one-click install wrote your setup, put them and the Fable line below in the env block of ~/.claude/settings.json. Per Claude Code's changelog, model configuration and subagents docs (Claude Code 2.1.296, checked 2026-10-10), from 2.1.293 the haiku alias resolves to Claude Haiku 5.5 (claude-haiku-5-5), which Router One lists as of the 2026-10-10 catalog but no plan tier lists in the 2026-10-10 plan response, so without the Haiku line /model haiku, subagents defined with model: haiku and the built-in claude-code-guide subagent (which the subagents docs list as running on Haiku) bill per token to the wallet; with it they run on Claude Haiku 4.5 (Standard models tier of all three plans). The fable alias resolves to Claude Fable 5.1 (claude-fable-5-1), which Router One no longer lists as of the 2026-10-09 catalog: also set ANTHROPIC_DEFAULT_FABLE_MODEL=claude-fable-5 so it reaches Claude Fable 5, which is in no plan tier as of the 2026-10-09 plan response and bills to the wallet. The model ID, both endpoints and what changes from Claude Sonnet 5 are covered in /blog/claude-sonnet-5-5-api-guide.

Claude Code's haiku alias now sends claude-haiku-5-5: does Router One serve it, and do I need the Haiku line?

Per Claude Code's changelog, model configuration and subagents docs (Claude Code 2.1.296, checked 2026-10-10), from 2.1.293 the haiku alias resolves to Claude Haiku 5.5 and sends claude-haiku-5-5 for /model haiku, subagents defined with model: haiku and the built-in claude-code-guide subagent. Router One lists it as of the 2026-10-10 catalog (catalog ID anthropic/claude-haiku-5.5; the gateway also accepts claude-haiku-5-5), but no Pro, Max or Ultra tier lists it in the 2026-10-10 plan response, so those requests bill per token to the wallet. The Haiku line stays optional for everyone: ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5 moves haiku-alias requests and background tasks (which otherwise follow the main model) to Claude Haiku 4.5, in the Standard models tier of all three plans; leave it unset and, on Claude Code 2.1.293 and later, haiku-alias requests run on Claude Haiku 5.5 while background tasks follow the main model. Model ids, billing and a first request are in /blog/claude-haiku-5-5-api-guide.

Claude Code 2.1.285 runs a 1M context window behind a gateway: can a long session use more plan quota?

It can. Per the Claude Code changelog and model-config docs (checked 2026-10-01), from 2.1.285 a session behind a custom ANTHROPIC_BASE_URL gives Sonnet 5 and later, Opus 4.7 and later, and the Fable models the same 1M context window they have on the Anthropic API, and compacts the conversation at about 967K tokens by default. Every turn resends the conversation, and on a Pro, Max or Ultra plan a claude-sonnet-5 or claude-opus-5 request whose input is above 256,000 tokens counts as 2 plan requests, and one above 512,000 as 4 (the quota bands both models carry in the 2026-10-01 catalog; /pricing shows the live bands). To compact before the first band, add CLAUDE_CODE_AUTO_COMPACT_WINDOW=240000 (a plain integer) to the env block of ~/.claude/settings.json; it applies to every model. Running /autocompact 240k in a session also works, but per the model-config docs (checked 2026-10-03) Claude Code 2.1.288 and later save that value for the current model only, so run it on each model you switch to; when both are set, the variable wins. One turn that adds a large file or tool result can still cross the band. CLAUDE_CODE_DISABLE_1M_CONTEXT=1 holds these models to a 200K window instead. Wallet-billed requests draw no plan requests, but a longer history still means more input tokens per turn. The 1M window and these settings are covered in /blog/claude-code-opus-5-5-setup.

Claude Code says this session isn't eligible for auto mode's uncharged classifier requests: what does that mean?

Per Claude Code's auto mode classifier billing docs (checked 2026-10-01), the notice “We're changing auto mode to no longer charge for classifier requests in Claude Code. However, this session isn't eligible.” means auto mode's server-side checks aren't reaching this session, so Claude Code makes its own classifier requests instead, billed as they were before: nothing is broken, and auto mode keeps working. When Claude Code can identify a gateway in the path, the notice names it. When the notice appears, Claude Code holds the first action it would check until you answer: Enter continues, with the held action and the rest of the session on Claude Code's own classifier requests, and when the notice named a gateway it doesn't reappear on that machine for 24 hours; Esc or Ctrl+C cancels the held action and the turn. To stop the notice, set CLAUDE_CODE_AUTO_MODE_SERVER=0 before you start the session, in your shell or the env block of ~/.claude/settings.json: classifier requests are then always Claude Code's own, billed the same way. The docs call the variable a temporary setting that may be removed in a later release. Interactive sessions start in auto mode when no permission mode is configured; Shift+Tab switches permission modes.

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?

For a retryable upstream error (429, an eligible 5xx or a timeout), Router One retries the request on another route serving the same Claude model when one is available; it never swaps in a different model. Routes with a sustained upstream-error rate are automatically moved to the back of the order until they recover. It is not a zero-downtime guarantee: if no healthy route is available, or the failure happens after a streamed response has started, Claude Code receives the error. Request logs show the final status; active incidents are posted on /status.

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. Anthropic's LLM gateway docs (checked 2026-10-01) add that Anthropic doesn't support routing Claude Code to non-Claude models through any gateway, and Claude Code assumes a 200K context window for a model ID it doesn't recognize.

Choose the next step for your Claude Code workflow

Next steps for Claude Code: run your other coding tools through the same gateway, fix a 403, top up, or set up 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 callsClaude rates are posted per model on /models; the site-wide "up to 90% off official prices" is a ceiling reached on select models across the catalog, not a Claude-specific rate — the cheap Claude API page shows how posted rates, per-key caps and traces fit together.PlansA Claude Max alternative on a flat monthly planRouter One's Pro, Max and Ultra plans ($20.19 / $47.99 / $149) meter monthly quotas by model tier across listed GPT, Claude, Gemini and Grok 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.Desktop appSet up with CC Switch (no env vars)A free desktop app that writes the Claude Code connection for you — no environment variables or config files to edit.Model choicePin the model now that Claude Code defaults to Opus 5.5Claude Code 2.1.280+ sends claude-opus-5-5 unless you pin a model; no plan tier lists it as of 2026-09-24, so pin claude-opus-5 to keep drawing plan quota.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.Model pageDeepSeek V4.1 Flash endpoints and ratesdeepseek-v4.1-flash is served on /v1/messages, /v1/responses and Chat Completions; per Anthropic's gateway docs (checked 2026-10-01), routing Claude Code to non-Claude models isn't supported.New modelCall Claude Opus 5.5 through the APIThe claude-opus-5-5 id, the 1M context window, always-on adaptive thinking, and a first call on /v1/messages or Chat Completions.MigrationMove Opus 5 code to Opus 5.5The four breaking changes Anthropic lists against Opus 5, the exact 400 error strings, and the request changes that fix them.Server-side toolsClaude web search and code execution through the APIweb_search and code_execution run on /v1/messages at the model's posted token rates; 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