Overview
One API key for many model providers.
RouterPlus is an LLM gateway. One API key and one prepaid balance give you models from many providers, over an OpenAI-compatible API and an Anthropic-compatible API.
Every chat model works on both APIs. RouterPlus translates requests, streams and errors between them. You pay the listed per-token prices, and each billed response states its cost in usage.cost.
Get a key
- 01Open Sign up. Complete Clerk authentication and email verification.
- 02Save the first API key shown after sign-in.
- 03Buy credits in Billing. Signup does not add free credit.
If you have an account, sign in and create another key at API keys.
If purchase matching is offered for your account, Billing shows the cap and remaining matching credit.
Make a call
export TM_API_KEY=tm_vk_...
curl -N https://dev2-api.routerplus.com/v1/chat/completions \
-H "Authorization: Bearer $TM_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"claude-haiku-4-5","stream":true,"max_tokens":60,"messages":[{"role":"user","content":"hello"}]}'The last usage chunk of the stream has the token counts and cost: the USD amount this request debited.
With an SDK, change only the base URL and the key:
import os
from openai import OpenAI
client = OpenAI(base_url="https://demo-api.routerplus.com/v1", api_key=os.environ["TM_API_KEY"])
r = client.chat.completions.create(
model="claude-haiku-4-5", # a Claude model over the OpenAI format
max_tokens=60,
messages=[{"role": "user", "content": "hello"}],
)
print(r.model_dump()["usage"]["cost"]) # USD debit for this requestimport os
import anthropic
client = anthropic.Anthropic(base_url="https://demo-api.routerplus.com", api_key=os.environ["TM_API_KEY"])
msg = client.messages.create(
model="gpt-4o-mini", # a GPT model over the Anthropic format
max_tokens=60,
messages=[{"role": "user", "content": "hello"}],
)Two APIs, one key
| API | Base URL | Endpoint | Works with |
|---|---|---|---|
| OpenAI-compatible | https://demo-api.routerplus.com/v1 | POST /v1/chat/completions, and POST /v1/responses for OpenAI's models | OpenAI SDKs, Codex, Cursor, Cline, Kilo Code, OpenCode, any OpenAI-format client |
| Anthropic-compatible | https://demo-api.routerplus.com | POST /v1/messages | Anthropic SDKs, Claude Code |
The key works on both APIs, as Authorization: Bearer or x-api-key. The API you use does not limit the model: OpenAI-format code can call Claude models, and Anthropic-format code can call GPT models. See Authentication.
How requests behave
- Cost. Every billed response has
usage.costin USD. It covers the full debit, including attempts that failed over before your answer started. See Pricing & billing. - Failover. Before any output reaches you, RouterPlus fails over to another provider. After output starts, the request stays with that provider. A failure then ends the stream with one error event. See Routing & failover.
- Keep-alives. During a silence, the stream sends a keep-alive every 15 seconds. See Streaming.
- No substitution. An unknown model id returns a 404 that names the id you sent. RouterPlus does not pick another model.
- Strict requests.
n>1returns a 400. Content or a parameter that cannot be translated returns a typed 400 that names the field. RouterPlus drops unknown top-level parameters and names each one in thex-tm-dropped-paramsheader. See Wire compatibility. - Metadata only. Metering and logs record token counts, timings, outcomes and cost. See Data policy.
Gateway endpoints
All gateway endpoints at https://demo-api.routerplus.com take your API key.
| Endpoint | What it does |
|---|---|
POST /v1/chat/completions | OpenAI-compatible completions, streamed or not |
POST /v1/messages | Anthropic-compatible messages, streamed or not |
POST /v1/messages/count_tokens | Anthropic token counting, not billed. Only models with an Anthropic-format deployment |
POST /v1/responses | OpenAI Responses API. See POST /v1/responses |
POST /v1/embeddings | Text to vectors. See POST /v1/embeddings |
POST /v1/audio/transcriptions, POST /v1/audio/speech | Speech to text and text to speech. See POST /v1/audio |
POST /v1/images/generations | OpenAI Images API, base64 in the body. See POST /v1/images/generations |
POST /v1/videos | Video from a text prompt. See POST /v1/videos |
POST /v1/decisions | Typed answers from a decision model. See POST /v1/decisions |
/v1/files, /v1/batches | Many requests from one file. See Batches |
GET /v1/models | Models your key can call. OpenAI list shape by default, Anthropic shape when you send an anthropic-version header |
GET /v1/usage | Balance, credited and spent totals, recent requests with cost |
GET /v1/generation?id=<request id> | Audit of each attempt for one request: tokens, provenance, cost, outcome |
POST /v1/route | Shows how a request would route, without sending it. See Routing policies |
GET /v1/limits?model=<id> | The rate limits that apply to your key. See Limits and capacity |
Site
| Page | What it does |
|---|---|
/api/models.json | Public catalog: ids, prices, context windows, who serves each model. No auth. See Models & catalog |
/models/<id> | Each model's providers, prices, latency and uptime over the last 24 hours |
/playground | Chat with any catalog model, compare up to three side by side, judge with a decision model, and make images. See Playground |
/model-search | Optimize: find a cheaper model or mix that scores as well as yours on your Braintrust evals, then deploy it. See Optimize |
/endpoints | Your dedicated endpoints and the models you deployed from Optimize. Each has a tm/... model id that your keys can call |
/console | Keys, usage, logs, credits, limits, team and governance. See Console |
/signup, /login | Browser signup and sign-in through Clerk |
/llms.txt, /llms-full.txt | The docs index for agents, and every docs page as raw markdown in one file |
Where next
error_type, what it means and what to do →If a coding agent does the work, point it at https://demo.routerplus.com/docs/agent-integration.md to build RouterPlus into a product, or at Install to set up a coding tool. https://demo.routerplus.com/llms.txt is the index it reads first.
For agents: /docs/overview.md and /llms.txt