Quickstart
From zero to a routed, streamed response — and running it on your own provider key — in about five minutes.
This is a learn-by-doing guide. Every step has copy-paste code and a one-line explanation of what just happened.
Get a key
Sign up, finish the short onboarding, then go to Build → API Keys in the
console sidebar and click Create key. A string starting with nyu_live_ appears once — copy
it now, it is never shown again.
Holding an older neu_live_ key?
Keys minted under the legacy neu_live_ prefix are still accepted everywhere
nyu_live_ is, so nothing breaks today. Use nyu_live_ for anything new and
rotate existing keys when convenient — the legacy prefix is kept for
backwards compatibility only and may be withdrawn in a future release.
Treat the key like a password. Backend-only, never in client-side code, never committed to git. Use environment variables.
Scopes. Keys grant access per capability. A new key arrives with chat,
embeddings and models.read, which covers this whole guide — nothing to
request. The exception is media (image, audio and video generation), which is
opt-in because it bills at far higher rates.
A missing scope returns 403, not 401:
{"detail": "api key missing required scope 'media'"}That is a permission error, not an outage — worth remembering, because from the client side the two look identical. Full table in Unified API → Scopes.
Your first call
The gateway exposes an OpenAI-compatible endpoint at
https://api.routing.nyuro.ai/v1/chat/completions. Any client that speaks OpenAI's
shape works — curl, fetch, the OpenAI SDK, anything.
Include /v1 for the SDK, omit it for raw HTTP
The OpenAI SDK appends the path itself, so its base_url ends in /v1. A
raw HTTP client writes the full path, so its base URL must not. Doing
both gives you /v1/v1/chat/completions and a bare 404 that reads like an
endpoint which was never deployed.
| Client | Base URL |
|---|---|
| OpenAI SDK | https://api.routing.nyuro.ai/v1 |
| curl / fetch | https://api.routing.nyuro.ai |
curl https://api.routing.nyuro.ai/v1/chat/completions \
-H "Authorization: Bearer nyu_live_…" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "user", "content": "Tell me a one-line joke about kubernetes."}
]
}'# pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://api.routing.nyuro.ai/v1",
api_key="nyu_live_…",
)
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Tell me a one-line joke about kubernetes."}],
)
print(resp.choices[0].message.content)// npm i openai
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.routing.nyuro.ai/v1",
apiKey: process.env.NYURO_API_KEY!,
});
const resp = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Tell me a one-line joke about kubernetes." }],
});
console.log(resp.choices[0].message.content);What just happened? Your call hit the gateway, which checked the key, picked
gpt-4o-mini, called the provider on your behalf, and returned the same shape
OpenAI uses — but now one URL reaches every model in the
curated set.
Let routing pick
Naming a model is fine when you know what you want. When you don't, pass auto,
or describe the shape of answer you need with a strategy.
resp = client.chat.completions.create(
model="strategy:cost", # cheapest viable
# model="strategy:quality", # strongest reasoner
# model="strategy:latency", # fastest first token
# model="strategy:local", # Nyuro's open-weight Luna models
messages=[{"role": "user", "content": "Explain TLS like I'm five."}],
)await client.chat.completions.create({
model: "strategy:cost",
messages: [{ role: "user", content: "Explain TLS like I'm five." }],
});curl https://api.routing.nyuro.ai/v1/chat/completions \
-H "Authorization: Bearer nyu_live_…" \
-H "Content-Type: application/json" \
-d '{"model": "strategy:cost", "messages": [{"role": "user", "content": "Explain TLS like I am five."}]}'Mental model
strategy:cost means "cheapest that still works". strategy:quality means
"this answer matters, spare no expense". strategy:local
means "stay on Nyuro's open-weight models". Same code, very different decisions. See Routing.
Stream it
Add one parameter and tokens flow back as they are generated.
stream = client.chat.completions.create(
model="claude-sonnet-4-6",
messages=[{"role": "user", "content": "Write a haiku about server logs."}],
stream=True, # the only change
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True)const stream = await client.chat.completions.create({
model: "claude-sonnet-4-6",
messages: [{ role: "user", content: "Write a haiku about server logs." }],
stream: true, // the only change
});
for await (const chunk of stream) {
const delta = chunk.choices[0].delta?.content;
if (delta) process.stdout.write(delta);
}We forward Server-Sent Events from the underlying provider with no shape change, so any SDK that expects OpenAI-style streaming just works.
Tell us your industry
Tell the router the industry and it picks a model tuned for that kind of
question — pass it as metadata, or pin directly with industry:<name>.
resp = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Summarize this MSA in 3 bullets."}],
extra_body={"metadata": {"industry": "legal"}},
)
# or pin directly: model="industry:legal"await client.chat.completions.create({
model: "industry:legal",
messages: [{ role: "user", content: "Summarize this MSA in 3 bullets." }],
});Supported tags include legal, healthcare, finance, code, creative,
support, sales, data, education, and general. See the full list in
Models.
Use your own provider key (optional)
Already have an OpenAI, Anthropic, Google or other provider account? Add its key under Settings → Provider Keys and requests for that provider's models run on your account: the provider bills you for the tokens, and Nyuro charges a 5% fee on the list price from your credits. Your client code does not change.
Your own models: coming soon
Where to go next
Introduction
One OpenAI-compatible endpoint that routes across every provider — on our keys or yours — with governance and observability built in.
Onboarding
Everything an application needs to integrate with Nyuro end to end — one key, one base URL, and the three request shapes for chat, embeddings, and media generation.