Skip to main content

Quickstart

Get Routor running in your existing app in under 5 minutes. No migration. No new SDK. Three lines change.

What You Are About to Do


Step 1 - Sign Up

Go to routor.ai and create an account. Then top up credits from the Billing page — pricing is pure pay-as-you-go, with no subscription or minimum spend. Quickstart - 3 lines, 2 minutes, no migration

Step 2 - Get Your API Key

  1. Click API Keys in the left sidebar
  2. Click Create Key
  3. Give it a name like “my-app”
  4. Copy the key. It starts with sk-routor-
📷 [Screenshot: API Keys page with the Create Key button highlighted]
Save your key now. It is only shown once.

Step 3 - Change Three Lines

Pick your language and swap these three values: the API key, the base URL, and the model name.

Node.js / TypeScript

import OpenAI from "openai";

const client = new OpenAI({
  apiKey:  "sk-routor-YOUR_KEY_HERE",   // your Routor key
  baseURL: "https://api.routor.ai/v1",  // Routor endpoint
});

const response = await client.chat.completions.create({
  model:    "auto",                      // Routor picks the model
  messages: [{ role: "user", content: "explain closures in JavaScript" }],
});

console.log(response.choices[0].message.content);

Python

from openai import OpenAI

client = OpenAI(
    api_key="sk-routor-YOUR_KEY_HERE",
    base_url="https://api.routor.ai/v1",
)

response = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "explain closures in JavaScript"}]
)

print(response.choices[0].message.content)

curl

curl https://api.routor.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-routor-YOUR_KEY_HERE" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "explain closures in JavaScript"}]
  }'

Step 4 - See What Happened

Open your dashboard to see the request logged in real time - model, tier, confidence, and savings for every call. Every non-streaming response also includes a routor object in the JSON body with the routing decision:
{
  "model": "moonshot/kimi-k2.6",
  "choices": [...],
  "routor": {
    "model":       "moonshot/kimi-k2.6",
    "tier":        "LIGHT",
    "profile":     "auto",
    "confidence":  0.82,
    "savingsPct":  87.4,
    "method":      "rules"
  }
}
If your deployment has DEBUG_ROUTING=1 set, the same information is also on the response headers (X-Routor-Model, X-Routor-Tier, etc.). Without that flag, only X-Request-Id is guaranteed on headers - use the routor response object or the Debug Endpoint instead. See Response Metadata for the full picture.
📷 [Screenshot: Dashboard usage table showing the routed request with model, tier, and cost]

Optional - Switch Tiers Per Request

Want more control? Pin, floor, or cap the routing tier per request with three optional body fields — no code restructuring:
{ "model": "auto", "routor_profile": "tier", "routor_tier": "COMPLEX" }
or bound the range with routor_tier_floor / routor_tier_ceiling. See Controlling the Tier for the full guide.

Done

Your app is now routing intelligently. Every request goes to the best-value model that can handle it, with automatic failover if any provider goes down. Where to go next: