Getting StartedMigration Guide
Migration Guide
Move to nRouter from OpenRouter or a direct provider integration — change the base URL and the API key; keep your code, and map your model names.
Last updated
Switching to nRouter is a two-value change for most teams: the base URL and the API key. Your request code, prompts, and tools stay the same. This page lists what changes and the checks that catch most migration issues.
What changes
| Item | Becomes |
|---|---|
| Base URL | https://api.nrouter.ai/v1 |
| API key | NROUTER_API_KEY (sk-nrouter-…) |
| Model names | The nRouter catalog name — or nrouter/auto |
| Fallbacks | The nrouter_fallbacks request field |
| Response headers | x-nr-* headers — routing, attempts, exact cost |
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.nrouter.ai/v1",
api_key=os.environ["NROUTER_API_KEY"],
)From OpenRouter
- Model names differ — OpenRouter uses provider/model names; use the nRouter catalog name, or
nrouter/autoto let the router choose. - Response headers differ — routing and cost come back in
x-nr-*headers. - Fallbacks are expressed differently — via the
nrouter_fallbacksrequest field.
From a direct provider key
- One key replaces your separate provider keys — create it in the dashboard; it is shown once.
- Your OpenAI SDK stays — only the base URL and key change.
- Budgets and logs apply from the first call — set a budget on the key before you ship.
After you switch
- Watch the first calls land in the request logs.
- Set a budget on the key.
- Add fallbacks for your main model.
Next Steps
- Quick Start — Make your first API call
- Authentication — How API keys and auth work
- Chat Completions — Explore the Chat Completions API
- Per-Request Options — Fallbacks and per-request settings
Was this page helpful?