Overview and quickstart
RouterLane is an LLM API where you pick a tier instead of a model. Send fast, normal, smart or smart-plus as the model name, and the router picks the model and reasoning effort for each task.
It speaks three API formats, so the SDK or agent you already use works by changing its base URL and key.
| Format | Endpoint | Base URL for SDKs |
|---|---|---|
| Anthropic Messages | POST /v1/messages | https://api.routerlane.com |
| OpenAI Chat Completions | POST /v1/chat/completions | https://api.routerlane.com/v1 |
| OpenAI Responses | POST /v1/responses | https://api.routerlane.com/v1 |
1. Store your key
Keys are issued on request: request access and the key arrives by email. It starts with rl_. Put it in an environment variable named ROUTERLANE_API_KEY; every example in these docs reads it from there.
2. Call it in the OpenAI format
curl https://api.routerlane.com/v1/chat/completions \
-H "Authorization: Bearer $ROUTERLANE_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "normal",
"messages": [{"role": "user", "content": "Write a regex that matches dates like 2026-10-06."}]
}'import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.routerlane.com/v1",
api_key=os.environ["ROUTERLANE_API_KEY"],
)
response = client.chat.completions.create(
model="normal",
messages=[{"role": "user", "content": "Write a regex that matches dates like 2026-10-06."}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.routerlane.com/v1",
apiKey: process.env.ROUTERLANE_API_KEY,
});
const response = await client.chat.completions.create({
model: "normal",
messages: [{ role: "user", content: "Write a regex that matches dates like 2026-10-06." }],
});
console.log(response.choices[0].message.content);3. Or in the Anthropic format
curl https://api.routerlane.com/v1/messages \
-H "x-api-key: $ROUTERLANE_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "smart",
"max_tokens": 4096,
"messages": [{"role": "user", "content": "Review this function for race conditions."}]
}'import os
import anthropic
client = anthropic.Anthropic(
base_url="https://api.routerlane.com",
api_key=os.environ["ROUTERLANE_API_KEY"],
)
message = client.messages.create(
model="smart",
max_tokens=4096,
messages=[{"role": "user", "content": "Review this function for race conditions."}],
)
print("".join(block.text for block in message.content if block.type == "text"))import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.routerlane.com",
apiKey: process.env.ROUTERLANE_API_KEY,
});
const message = await client.messages.create({
model: "smart",
max_tokens: 4096,
messages: [{ role: "user", content: "Review this function for race conditions." }],
});
for (const block of message.content) {
if (block.type === "text") console.log(block.text);
}4. Read the decision
Every response says what the router did. The model field in the body holds the tier you called; the headers name the model and effort behind it.
HTTP/2 200
content-type: application/json
x-router-tier: smart
x-router-model: glm-5.3
x-router-effort: high
x-router-source: rule
x-router-request-id: 4f1c9a07d2e86b13x-router-source tells you how the decision was made: rule or default for a new task, continuation for a tool result inside a running task, sticky when the conversation kept its model, and smartplus for a Smart+ job turn. See response headers.
Next
Integrations
Claude Code, Codex, pi, the OpenAI and Anthropic SDKs, Vercel AI SDK and LangChain.
Tiers and model IDs
Accepted names, aliases, and what happens to the effort you send.
API reference
Every endpoint with request and response examples, streaming and headers.
Errors and limits
Status codes, error bodies, plan limits and how to retry.