One API key.Every major LLM.One bill.
Drop-in replacement for the OpenAI SDK. One key for every model with transparent per-token billing — you set the preference, we deterministically pick the model and transparently handle context overflow and provider failures. Built for AI agents (Claude Code, Codex, OpenClaw…) to wire in with three commands.
agent — tokenroute
Three things we handle for you.
OpenAI-compatible
Same SDK, same shape. Point base_url and swap the key.
5 providers, one key
OpenAI, Anthropic, Gemini, DeepSeek, Mistral — single bill, single dashboard.
Prepaid, per-token
No subscriptions, no minimums. Top up, watch cost in real time.
What model: "auto" actually does
No difficulty guessing — you set the preference, we pick deterministically and handle the rest. Pick a preference to see the model:
tokenroute /v1
model: "auto"
Cost
Cheapest · low latency
Balanced
Best speed / intelligence balance
claude-sonnet-4-6
$3.00 / $15.00 / 1M
Quality
Top-tier reasoning / agentic
Long input ↑
🛡 guardrail
Input > 180k auto-escalates to a large-context model
Five lines of Python.
quickstart.py
from openai import OpenAIclient = OpenAI(api_key="sk-tr-…", # from /dashboard/keysbase_url="https://api.tokenroute.io/v1",)response = client.chat.completions.create(model="claude-sonnet-4-5", # or gpt-4o, gemini-2.5-pro, deepseek-chat…messages=[{"role": "user", "content": "Summarize this commit log."}],)print(response.choices[0].message.content)
Any OpenAI-compatible client works — Node.js, Go, Ruby, curl. Streaming, tool calls, JSON mode, vision — all passed through unchanged.
Your agent ships LLM apps in five commands.
tokenroute exposes a CLI and (soon) a remote MCP server so Claude Code, Codex, OpenClaw, Hermes and other coding agents can install, configure, test, and even request top-up — without any web dashboard clicks. Every command supports `--json` and respects `TOKENROUTE_API_KEY` env var for non-interactive sub-agent runs.
agent.sh
# install + login (one-time per user)$ uvx tokenroute login # opens browser# wire up a project$ TOKENROUTE_JSON=1 uvx tokenroute keys create --name myapp # raw key returned once$ uvx tokenroute env >> .env # OPENAI_API_KEY + BASE_URL$ uvx tokenroute test # verify it works# need credit? agent surfaces the URL — does NOT auto-pay$ TOKENROUTE_JSON=1 uvx tokenroute topup --amount 5{"checkout_url":"https://checkout.stripe.com/c/pay/..."}
Hard constraint
Agents must NOT auto-pay. `topup` returns a Stripe Checkout URL — the agent hands it to the user. This is a KYC red line we won't cross.
Pay per token. No subscriptions.
We bill upstream provider list price + 30% routing fee. No monthly fee, no minimums. Balance never expires. Per-token prices below in USD per million input / output tokens:
| Model | Provider list | Tokenroute |
|---|---|---|
| GPT-4o | $2.50 / $10.00 | $3.25 / $13.00 |
| Claude Sonnet 4.5 | $3.00 / $15.00 | $3.90 / $19.50 |
| Gemini 2.5 Pro | $1.25 / $10.00 | $1.63 / $13.00 |
| DeepSeek-V3 | $0.27 / $1.10 | $0.35 / $1.43 |