Documentation

Build with any model in minutes.

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.

Quickstart

Create an API key in your dashboard, then point any OpenAI SDK at our base URL.

Python
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)

Authentication

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.

HTTP
Authorization: Bearer mr_live_...
Content-Type: application/json

Node.js

TypeScript
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." }],
});

Streaming

Pass stream: true to receive server-sent events. Delta chunks match the OpenAI streaming format exactly.

curl
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"}]}'

Tool calling

All frontier models accept OpenAI-style tools and returntool_calls — no per-provider translation needed.

Python
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"],
            },
        },
    }],
)

Models

Reference any model by its slug. See the full catalog for pricing and context windows.

anthropic/claude-fable-5Frontier reasoning + code
anthropic/claude-sonnet-5Balanced speed and depth
anthropic/claude-opus-4.8Deepest reasoning
openai/gpt-5.6-solFlagship multimodal
openai/gpt-5.6-terraFast general model
google/gemini-3.1-pro2M context, whole-repo
google/gemini-3.5-flashUltra-low latency
routllm/fre-5.5House coding model

Rate & usage limits

Every 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 reference

POST
/api/public/v1/chat/completions

OpenAI-compatible chat completion. Supports streaming.

GET
/api/public/v1/models

List available models.

Errors

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).