Does Codex work in China? 4 ways to use it, and how DeepSeek codes (2026)

Codex and Claude Code from mainland China and Hong Kong: why you can't use them directly, the four routes people take (compared on setup, stability, ban risk, privacy and cost), and DeepSeek's coding benchmarks if you switch the model.

Start free →

Verify your email and get $0.35 of balance

Codex and Claude Code both work from mainland China, but neither OpenAI nor Anthropic lets you sign up or pay from there. So the real question is which obstacle you route around: the card, the network, or the account itself. There are four routes people actually use. Here is each one: how it works, what it costs, how stable it is, the ban risk, privacy, and who it suits.

Every route gets the same five checks: setup effort, long-term stability, ban risk, privacy (who can see your prompts and key), and cost.

Why you can't just use it

What Codex is: four ways in, one config

Codex is OpenAI's coding agent: you describe a task in plain words, and it reads the code, edits files and runs commands. It comes as the open-source Codex CLI (Apache-2.0), desktop apps for macOS and Windows, extensions for VS Code and other editors, and Codex on the web. The first three read the same config file, ~/.codex/config.toml, so the model behind them can be someone else's; the web version only runs OpenAI's models.

You sign in either with a ChatGPT account (every ChatGPT plan includes some Codex use) or with an API key billed by usage. Switching the model uses the second: put another provider's address and key in the config, and Codex no longer needs an OpenAI account. One catch: since February 2026, Codex only speaks the Responses API, so providers that only offer the older Chat Completions API no longer work. DeepSeek's own API and HaryAI both support the Responses API.

The short version

Route 1: the official subscription (foreign card + your own network)

Sign up at openai.com or anthropic.com, add a card that their payment system accepts, keep a stable connection, and subscribe: a paid ChatGPT plan for Codex, a paid Claude plan for Claude Code. The CLIs then sign in with that account, or with an API key from it.

The hard part is getting in. Chinese dual-currency cards are often declined, so most people end up with a virtual or overseas card, and the connection is yours to maintain.

Route 2: region-switched app stores and gift cards

Instead of a credit card on the vendor's website, you pay through an in-app purchase in the ChatGPT or Claude mobile app. The money comes out of your App Store or Google Play balance, which you top up with gift cards bought for RMB on Taobao or Xianyu. Prices vary by store region, so guides pick cheaper regions such as Nigeria or Turkey: switch your Apple ID to that region, buy that region's gift cards, then subscribe in the app.

Route 3: resellers and shared accounts

A third party sells you a relay key and endpoint, a ready-made account, or top-ups. It's cheap, instant and paid in RMB. It's also where most of the horror stories come from: substituted models (a cheaper model answering as Claude or Codex, hard to spot), and shared accounts banned in bulk, taking everyone on them offline at once. Your requests pass through the reseller, who can read and log them.

Route 4: keep the tools, switch the model to DeepSeek

Codex and Claude Code are tools, and you can change the model behind them. Codex calls models through the Responses API, Claude Code speaks Anthropic's API format, and DeepSeek supports both natively. So route 4 doesn't go after GPT or Claude at all. It points the two tools at DeepSeek instead. The OpenAI and Anthropic signup, the foreign card and the foreign-region account that routes 1 to 3 work around don't come up. The trade-off is just as plain: the work is done by DeepSeek V4.1 Flash or V4 Pro, not by GPT or Claude.

There are two ways to get DeepSeek. One is DeepSeek's own API: you can sign up from mainland China and pay in RMB. The other is HaryAI: the same DeepSeek models at 55% off the official price. The key is yours alone, top-ups start at $10 and take Alipay and WeChat Pay, and if you use it every day there's a monthly Coding Plan from $20, card only.

With HaryAI, import your key into CC Switch from your account page, once for Codex and once for Claude Code, or edit ~/.codex/config.toml and ~/.claude/settings.json yourself. Every step is in DeepSeek in Codex and Claude Code.

Can DeepSeek actually code?

In the model card for its October update of V4.1 Flash, DeepSeek published coding and agent benchmarks against OpenAI's GPT-5.6 Sol and Anthropic's Claude Opus 5:

These are DeepSeek's own numbers on tests it chose, so read them as a rough guide. What they suggest: for everyday writing and fixing of code, DeepSeek V4.1 Flash is in the same league as GPT and ahead on some tests, while Claude Opus 5 still leads on the hardest, longest tasks. The other model, DeepSeek V4 Pro, is stronger at reasoning and planning but can't read images. The best test is your own project: run a few tasks on each, which the smallest top-up covers.

One more thing

Hitting the official limits doesn't mean switching routes. When the 5-hour or weekly limit runs out, you can wait for the reset, or switch to DeepSeek in CC Switch until it resets and then switch back. When OpenAI has reset limits early, and how often, is tracked in the Codex reset tracker and the Claude reset tracker.

DeepSeek at 55% off the official price

Verify your email and get $0.35 of balance