# OpenAI Codex CLI — Accessible from China, Pay-Per-Token

> Markdown mirror of https://router.one/codex-china for AI assistants and crawlers. Router One is an OpenAI-compatible LLM API gateway.
> Last updated: 2026-08-26

Router One runs OpenAI Codex CLI from Mainland China without a VPN or ChatGPT Plus: add it as a model provider in ~/.codex/config.toml (base_url https://api.router.one/v1, wire_api = "responses"), pay per token from a wallet topped up by card or Alipay, and see the cost of every request in the dashboard. Per-key spend caps and smart routing with automatic failover come with the same endpoint.

## Stable from China

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.

## Pay-per-token, no ChatGPT Plus

Use wallet billing or live Router One subscription plans. Top up with a card or Alipay through one hosted checkout, or with USDT/USDC on six chains — usage outside plan coverage is metered by what Codex actually consumes.

## Smart routing failover

EWMA-based latency routing with automatic failover when upstream providers degrade and a healthy alternate route is available. Request traces show the route used.

## Configure Codex CLI

Run the one-click command, or register Router One as a model provider in ~/.codex/config.toml.

### Create a Router One API key

Sign up at router.one and create an API key. Top up with a card or Alipay on the hosted checkout, or with USDT/USDC — no ChatGPT Plus or foreign credit card required.

### Point Codex CLI at Router One

Run the one-click command with your key — it installs Codex CLI if missing, writes ~/.codex/config.toml with the Router One provider (env_key = ROUTER_ONE_API_KEY), persists the key in your shell profile, and verifies it.

### Launch Codex CLI

Run Codex CLI as usual. Requests route through Router One's China-reachable, OpenAI-compatible endpoint, billed per token from your wallet.

`terminal`

```bash
# Use Codex CLI through Router One
curl -fsSL https://router.one/install/codex.sh | bash -s -- sk-your-router-one-key
```

## FAQ

### Do I still need ChatGPT Plus?

No ChatGPT Plus is required. Router One supports pay-per-token wallet billing and live subscription plans. Usage outside plan coverage is metered by what Codex actually consumes per request.

### Will my existing Codex configuration work?

Yes — Router One is added as a standard model provider in ~/.codex/config.toml (base_url https://api.router.one/v1, wire_api "responses", key via the ROUTER_ONE_API_KEY environment variable). All existing Codex CLI flags and behaviors remain unchanged.

### What about latency from China?

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.

### Can I set budget caps?

Yes. Give each project or tool a separate API key, then set that key's maxSpend cap in the dashboard. Request traces show token counts and cost in real time.

## See also

- Give each coding tool its own budget: https://router.one/use-cases/ai-coding-tools
- Understand Codex Responses API errors: https://router.one/codex-responses-api
- Cut the per-token price of GPT calls: https://router.one/cheap-gpt-api
- Confirm the Responses API request: https://router.one/docs/chat/createResponse
- Fund the Codex wallet with Alipay: https://router.one/alipay-llm-api
- Set up Claude Code instead: https://router.one/claude-code-china
- Claude Code vs Codex CLI, honestly compared: https://router.one/blog/claude-code-vs-codex-cli
- Canonical page: https://router.one/codex-china
- Models and per-model token rates: https://router.one/models (markdown: https://router.one/models.md)
- Pricing: https://router.one/pricing
- API docs (markdown): https://router.one/docs.md
- Company facts: https://router.one/facts/company.md
