Quick Start
Create an nRouter API key, set it in your environment, and send your first chat completions request in minutes with TypeScript, Python, or cURL.
Send your first nRouter chat completion in minutes by generating an API key, setting it in your environment, and calling the Chat Completions endpoint via cURL, Python, or TypeScript.
- Quick activation: Verify your email and claim promotional credits directly on Getting Started (
/[org]/getting-started). - Drop-in compatibility: Point existing OpenAI SDKs or HTTP clients to
https://api.nrouter.ai/v1with ansk-nrouter-*key. - Immediate observability: Inspect the responding model and exact token costs in the dashboard request log within seconds.
- Flexible integration: Test immediately using cURL, official nRouter SDKs, or the in-browser Playground.
1. Get your API key
Complete setup at Getting Started (/[org]/getting-started):
- Verify your email via the confirmation link or 6-digit code.
- Activate account: Verify SMS for $100.00 promo credit (spendable on
promo-labeled models, subject to the current daily limit on Pricing), or add $5+ via Stripe (0% platform fee) for full catalog access. - Create and export your starter key: Click Create API key on the checklist to provision and reveal your starter key once, then export it:
export NROUTER_API_KEY="sk-nrouter-…"(PowerShell:$env:NROUTER_API_KEY = "sk-nrouter-…"). Manage additional keys in API Keys (/[org]/keys).
2. Send your first request
Call https://api.nrouter.ai/v1/chat/completions (trial keys support promo-labeled models directly by model name; funded keys support nrouter/auto and the model catalog):
import { nRouter } from "@nrouter_ai/sdk"; // npm install @nrouter_ai/sdk
const res = await new nRouter().chat.completions.create({
model: "gemini-2.5-flash", messages: [{ role: "user", content: "Hello!" }]
});
console.log(res.choices[0]?.message.content);Requests record to dashboard request logs with exact list-price costs:
| Header | Meaning | Example |
|---|---|---|
x-nr-model | Model that served the request | gemini-2.5-flash |
x-nr-request-cost | Settled cost in USD (0% markup) | $0.00015 |
x-nr-routing | Direct vs fallback execution | direct |
3. Continue building
- In-browser Playground: Test with 1 click via the Playground.
- Chat Completions API — Streaming, parameters, tools
- SDK guides — Language libraries and OpenAI-compatible setup
- Authentication — Key permissions and scoping
- Budget Controls — Spend limits and rate limits
Start building with nRouter
One API key, three steps. Choose your tool to begin.
Get a key
Create API keySet your API key
export NROUTER_API_KEY="<YOUR_API_KEY>"Configure Claude Code
Choose a tool, then copy its setup from the panel.
Frequently asked questions
What do I need before my first request?
An account, verified email, and an activated key from Getting Started (/[org]/getting-started).
Can I use the OpenAI SDK I already have?
Yes. Set the base URL to https://api.nrouter.ai/v1 and use your nRouter key.
Which model should I send in my first request?
Test with a promo-labeled model (such as gemini-2.5-flash), or nrouter/auto and catalog models after adding credits.
Where can I see my request after it succeeds?
In the dashboard request logs within seconds, showing serving model and exact cost.
Can I call the API from browser code?
No. Keep keys on your server to avoid exposing credentials.