Skip to content

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.

Anthropic-compatibleConfigure Claude CodeSet ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, persist them, verify the connection, and cap spend per key.Responses APIConfigure OpenAI Codex CLIUse Codex's native provider entry in config.toml with the Responses wire API, and see why endpoints without /v1/responses return 404.Editor integrationConfigure CursorOverride Cursor's OpenAI base URL and select a model from the live catalog.From Mainland ChinaClaude Code from Mainland ChinaReach the Anthropic-compatible endpoint without a VPN and top up the wallet by card or Alipay.From Mainland ChinaCodex CLI from Mainland ChinaRun Codex against the Responses endpoint without a VPN or ChatGPT Plus, billed per token from the wallet.From Mainland ChinaCursor from Mainland ChinaPoint Cursor's model calls at a China-reachable endpoint and pay without a foreign credit card.Editor integrationConfigure ZedRegister an openai_compatible provider in Zed's settings.json, list exact catalog IDs with their context windows, and keep the key in the keychain or ROUTER_ONE_API_KEY.IDE extensionContinue (no longer maintained)Its final 2.x release still reaches the gateway through one config.yaml block per model; the guide also lists maintained alternatives.VS Code, JetBrains and CLIConfigure ClineChoose the OpenAI Compatible provider, pick a tool-calling chat ID, and set the context window and image support per model.JetBrains IDEsConfigure JetBrains AI AssistantPoint AI Assistant's OpenAI-compatible BYOK provider at the /v1 URL, assign chat models, and check which features still need JetBrains AI.Terminal agentConfigure OpenCodeRegister the gateway as an OpenAI-compatible provider in opencode.json and pick models from the live catalog.Terminal coding agentConfigure Pi AgentRegister Router One in models.json, choose the API protocol and exact model ID, then select the provider explicitly.Terminal agentConfigure CrushAdd Router One to Crush as a crushrc openai-compat provider and pin both model slots so session titles bill the same key.Desktop and CLI agentConfigure GoosePoint the built-in OpenAI provider at the host root with OPENAI_HOST, keep the default request path, and pick a catalog model with GOOSE_MODEL.Terminal agentConfigure Qwen CodeSet OPENAI_BASE_URL, OPENAI_API_KEY and OPENAI_MODEL in .qwen/.env, or register the gateway under modelProviders for the /model picker.Terminal pair programmerConfigure AiderSet OPENAI_API_BASE, put openai/ in front of each exact catalog ID, and tell Aider how to treat IDs it doesn't know.Xcode 26 and 27Configure an Xcode chat providerAdd an Internet Hosted chat provider with the host-root URL; Xcode appends /v1/models and /v1/chat/completions itself.AI IDEConfigure TRAE (TraeCode)Add a custom model with the OpenAI Chat Completions format and the /v1 base URL, or the Anthropic Messages format and the host root for Claude and DeepSeek V4 IDs.Desktop appConfigure QoderAdd an OpenAI Compatible custom model with the /v1 Base URL and choose Chat Completions, or Responses for GPT, DeepSeek V4 and Grok chat IDs.CLI and IDEConfigure CodeBuddyDefine Router One models in models.json with the full /v1/chat/completions url, your own token limits and a cheaper lite model.Terminal agentConfigure Hermes AgentAdd a custom endpoint with hermes model or a named provider in config.yaml, pick a transport per model ID, and set the context length yourself.Terminal agentConfigure GitHub Copilot CLI (BYOK)Set COPILOT_PROVIDER_BASE_URL to the /v1 base URL with the completions wire API and an exact catalog ID in COPILOT_MODEL.Agent harness Web UIConfigure DeepSeek HarnessAdd a Custom model API provider per protocol in Settings → Models: the /v1 base URL for Chat Completions or Responses, the host root for Anthropic Messages.VS Code extensionConfigure Kilo CodePoint the Kilo Code agent extension at the gateway with your Router One key.VS Code extensionConfigure GitHub Copilot (BYOK)Add the gateway as a Custom Endpoint provider in Copilot Chat and pick exact catalog model IDs.ComparisonGitHub Copilot BYOK vs Continue vs ClineWhich VS Code extension runs on your own key, how each is configured, and one key for all three.Other clientsBrowse SDK and client setup guidesEvery supported coding agent, SDK, chat client, and LLM app platform has its own step-by-step guide on the same endpoint.

Give every coding agent one gateway and one budget.

Get your API key