> ## Documentation Index
> Fetch the complete documentation index at: https://docs.routor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get Routor running in your existing app in under 5 minutes.

# 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

```mermaid theme={null}
flowchart LR
    subgraph Before["Before"]
        A["Your App"] -->|"gpt-4o always"| OAI["OpenAI\n$$$$"]
    end

    subgraph After["After - 3 lines changed"]
        B["Your App"] -->|"model: auto"| R["Routor"]
        R -->|"simple"| C1["GLM-4.7 Flash · $"]
        R -->|"medium"| C2["Sonnet · $$"]
        R -->|"complex"| C3["Opus 4.8 · $$$"]
    end

    Before -.->|"3 line change"| After
```

***

## Step 1 - Sign Up

Go to [routor.ai](https://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.

<img src="https://mintcdn.com/routor/cIATklos4kQp2x0I/images/quickstart-hero.svg?fit=max&auto=format&n=cIATklos4kQp2x0I&q=85&s=efcb9569f907d3244f9d01c88b7b2db6" alt="Quickstart - 3 lines, 2 minutes, no migration" width="1000" height="320" data-path="images/quickstart-hero.svg" />

***

## 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

```typescript theme={null}
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

```python theme={null}
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

```bash theme={null}
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:

```json theme={null}
{
  "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](api/debug.md) instead. See [Response Metadata](response-headers.md) 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:

```json theme={null}
{ "model": "auto", "routor_profile": "tier", "routor_tier": "COMPLEX" }
```

or bound the range with `routor_tier_floor` / `routor_tier_ceiling`. See [Controlling the Tier](tiers.md#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:

* [Understand how routing decisions are made](how-it-works.md)
* [Switch and constrain routing tiers](tiers.md#controlling-the-tier)
* [Set up a custom routing profile](playground/create-profile.md)
* [See all supported models](providers/supported.md)
