Documentation
RoutLLM speaks the OpenAI chat-completions protocol. If your library supports OpenAI, it supports us — Claude Fable 5, GPT-5.6, Gemini 3.5, DeepSeek, Llama, and more, through one endpoint and one key.
Create an API key in your dashboard, then point any OpenAI SDK at our base URL.
from openai import OpenAI
client = OpenAI(
base_url="https://routllm.app/api/public/v1",
api_key="mr_live_...",
)
resp = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)All requests use a bearer token. Keys start with mr_live_ and can be created or revoked from the API keys tab. Keys inherit your plan's 5-hour and 7-day usage limits.
Authorization: Bearer mr_live_... Content-Type: application/json
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://routllm.app/api/public/v1",
apiKey: process.env.MODERNROUTER_KEY,
});
const res = await client.chat.completions.create({
model: "openai/gpt-5.6-sol",
messages: [{ role: "user", content: "Write a haiku about caching." }],
});Pass stream: true to receive server-sent events. Delta chunks match the OpenAI streaming format exactly.
curl https://routllm.app/api/public/v1/chat/completions \
-H "Authorization: Bearer $MR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"google/gemini-3.5-flash","stream":true,"messages":[{"role":"user","content":"hi"}]}'All frontier models accept OpenAI-style tools and returntool_calls — no per-provider translation needed.
client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "What's the weather in Paris?"}],
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
},
}],
)Reference any model by its slug. See the full catalog for pricing and context windows.
anthropic/claude-fable-5Frontier reasoning + codeanthropic/claude-sonnet-5Balanced speed and depthanthropic/claude-opus-4.8Deepest reasoningopenai/gpt-5.6-solFlagship multimodalopenai/gpt-5.6-terraFast general modelgoogle/gemini-3.1-pro2M context, whole-repogoogle/gemini-3.5-flashUltra-low latencyroutllm/fre-5.5House coding modelEvery plan has a rolling $ every 5 hours and $ every 7 days spend limit. Exceeding either returns 429 usage_limit_exceeded with aretry-after header. Per-key RPM limits protect against runaway loops.
/api/public/v1/chat/completionsOpenAI-compatible chat completion. Supports streaming.
/api/public/v1/modelsList available models.
Errors follow OpenAI's shape: {"error":{"message":"…","type":"…"}}. Common codes: invalid_api_key (401), insufficient_quota (402), rate_limit_exceeded (429), quota_exceeded (429), model_not_found (404).