Run AI coding tools through one LLM gateway
Router One is one LLM API gateway for every AI coding tool: Claude Code (Anthropic-compatible endpoint), OpenAI Codex CLI (native Responses API) and any OpenAI-compatible agent share one wallet, get their own spend-capped API keys, and leave a cost trace per request across 30+ models — reachable globally and from Mainland China. Without it, every tool wants its own key, billing account, and base URL, and each one can quietly burn a budget.
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, Zed, Continue, 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 and per-minute token limits run at platform defaults and can be raised on request. 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, API key, tokens, cost, total time (plus time to first token on streamed requests that produced output) and status. 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 route serving that same model. The dashboard records the model, request ID, and request metrics; upstream identities and routes stay private.
TRAE / TraeCode
Add a custom model in TRAE's model settings and leave the Full URL toggle off. With the OpenAI Chat Completions format, the base URL https://api.router.one/v1 works for every chat model; with the Anthropic Messages format, https://api.router.one serves Claude and DeepSeek V4 IDs.
Qoder
The Qoder desktop app (0.1.8 and later) takes your own Base URL for custom models: choose OpenAI Compatible, then Chat Completions for any chat model or Responses for GPT, DeepSeek V4 and Grok chat IDs, and enter https://api.router.one/v1.
CodeBuddy
CodeBuddy reads custom models from models.json; they currently support only the OpenAI API format, and the url field takes the full endpoint, https://api.router.one/v1/chat/completions.
Hermes Agent
Run hermes model, choose Custom endpoint and enter https://api.router.one/v1 with Chat Completions, or define Router One as a named provider in config.yaml; the guide explains setting context_length and compression.threshold_tokens for cost.
GitHub Copilot CLI
Set COPILOT_PROVIDER_BASE_URL to https://api.router.one/v1, COPILOT_PROVIDER_WIRE_API=completions and an exact catalog ID in COPILOT_MODEL; per GitHub, bring-your-own-key use needs no GitHub sign-in.
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
# Route Claude Code and Codex through one gateway $env:ROUTER_ONE_API_KEY = "sk-your-router-one-key"; irm https://router.one/install/claude-code.ps1 | iex $env:ROUTER_ONE_API_KEY = "sk-your-router-one-key"; irm https://router.one/install/codex.ps1 | iex
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, Aider, Hermes Agent, GitHub Copilot CLI (bring your own key), TRAE (TraeCode), the Qoder desktop app and CodeBuddy (CLI and IDE) through their custom-model or provider settings. 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 on each; rate and per-minute token limits run at platform defaults and can be raised on request. A tool whose key hits its cap stops spending from the wallet; 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 route serving that same model. Added latency depends on the failure and retry; there is no fixed latency guarantee. Dashboard traces show the model, request ID, and request metrics. Supplier identities, upstream channel names, and internal retry routes stay private; the only channel a trace shows is the sales-channel prefix of the model ID you called (azure/, aws/ or vertex/).
Where do I see what each tool is spending?
Dashboard → API Keys shows what each capped key has spent against its cap, so a key per tool with a spend cap means a spend line per tool. Dashboard → Usage ranks your API keys by spend, tokens and requests for the chosen range, and each key links to its own logs. Dashboard → Logs filters by model, API key, status and date range, names the key that sent each request, and exports the current filters to CSV. Rolling the tools out to a whole team? The team rollout guide (/blog/claude-code-codex-team-rollout) applies the same per-key setup to one key per developer, including how a plan's shared quota interacts with key caps and what to do when someone leaves.
Choose the setup page for your coding tool
Open the setup guide for your exact tool — each client connects to the gateway differently, so one tool's settings won't carry over to another.
Give every coding agent one gateway and one budget.
Get your API key