Quickstart, Neural Router

Route your first request in under five minutes.

If your code already calls OpenAI, you're most of the way there. Neural Router is OpenAI-compatible: change the base URL, send model:"auto", and you're done.

01

Get an API key

Create a free key from the dashboard. No credit card required to start experimenting.

# Set your environment variable
NR_API_KEY="sk-nr-live-7f3a-89bc-1234-x9y0"
02

Point your SDK

Keep the OpenAI SDK you already use. Only the base_url changes to our control plane.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.neuralrouter.ai/v1",
    api_key=NR_API_KEY
)
03

Let it route

Send model:"auto" with a residency policy. The router scores live endpoints and picks the winner based on current telemetry.

resp = client.chat.completions.create(
    model="auto",
    policy="balanced",  # Options: floor | nitro | quality | pinned
    residency="eu",
    messages=[{
        "role": "user", 
        "content": "Summarize this contract."
    }],
)

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

# response headers provide model details and cache status

Need to pin a model?

If you require a specific model version, you can pin it while still benefiting from Neural Router's failover, automatic caching, and unified telemetry.

# Example pinning a specific model
resp = client.chat.completions.create(
    model="claude-opus-4-8", 
    policy="pinned", 
    messages=[...]
)