Run AI coding tools through one LLM gateway
Every AI coding tool wants its own API key, billing account, and base URL — and each one can quietly burn a budget. Routing them through one gateway changes that: Claude Code, OpenAI Codex CLI, and any OpenAI-compatible agent share one wallet, get their own scoped keys, and leave a cost trace for every request. One integration covers 40+ models, reachable globally and from Mainland China.
What the gateway gives your coding stack
Claude Code, natively
Point ANTHROPIC_BASE_URL at https://api.router.one and Claude Code runs through the gateway — same workflow, plus traces, budgets, and failover behind it.
Codex CLI, natively
OpenAI Codex CLI registers Router One as a model provider (base_url https://api.router.one/v1) — one command sets it up, and every Codex request is metered, traced, and budget-capped like the rest of your stack.
Any OpenAI-compatible agent
Cline, Aider, and other tools that accept a custom OpenAI-compatible base URL work the same way — change the URL and key, keep the workflow.
A key per tool, a budget per key
Give each tool its own API key with its own maxSpend cap, rate limit, and per-minute token ceiling. An agent stuck in a retry loop hits its cap — it cannot drain the shared wallet.
A cost trace per request
Every tool call lands in the dashboard with model, tokens, cost, latency, and route. You can finally answer which tool — and which kind of task — your spend goes to.
Failover during incidents
When a named-model request hits a retryable upstream error, the gateway may try another healthy provider serving that same model. The dashboard records the final provider and request metrics.
One wallet for every coding agent
Coding agents are the easiest workloads to lose track of: they run long sessions, retry on failure, and multiply across a team. Putting them behind one gateway gives you a single prepaid wallet with per-key attribution — every tool spends from the same balance, every request is priced at the posted model rate, and per-key caps decide how much any one agent may use. Top up by card or Alipay through one hosted checkout, or with USDT/USDC on six chains.
One command per tool
Claude Code uses the Anthropic-compatible endpoint; Codex CLI registers Router One as a model provider. Each one-click command installs the CLI, writes the config, and verifies your key — other OpenAI-compatible tools just point their base URL at the gateway.
# Route Claude Code and Codex through one gateway curl -fsSL https://router.one/install/claude-code.sh | bash -s -- sk-your-router-one-key curl -fsSL https://router.one/install/codex.sh | bash -s -- sk-your-router-one-key
FAQ
Which AI coding tools work with Router One?
Claude Code (via the Anthropic-compatible endpoint), OpenAI Codex CLI, and any tool that accepts an OpenAI-compatible base URL — including Cline and Aider. If the tool lets you set a base URL and API key, it can route through the gateway.
How do I set up Claude Code?
Set ANTHROPIC_BASE_URL to the Anthropic-compatible endpoint and use your Router One key. The Claude Code in China page documents the full walkthrough, including verification and troubleshooting.
How do I set up Codex CLI?
Run the one-click command from the CLI setup guide — it registers Router One as a model provider in ~/.codex/config.toml and reads your key from the ROUTER_ONE_API_KEY environment variable. The Codex CLI in China page has the complete guide.
Can I give each tool its own budget?
Yes. Create one API key per tool and set a maxSpend cap, rate limit, and per-minute token ceiling on each. A tool that hits its cap stops spending; the others keep working.
What happens if a provider has an outage mid-session?
A named-model request that hits a retryable upstream error may try the next healthy provider serving that same model. Added latency depends on the failure and next provider; there is no fixed latency guarantee. Dashboard traces show the final provider and request metrics, not each internal failed attempt.
Where do I see what each tool is spending?
Dashboard -> Usage breaks down requests, tokens, and spend per API key — so a key per tool means a spend line per tool. Dashboard -> Logs shows the individual request traces.
Related
Give every coding agent one gateway and one budget.
Get your API key