Enterprise LLM gateway: One key. Control every call.

Access supported models, apply your policies before generation, and track usage and charges in one place.

Watch one key do the checking.

How the gateway works.

Catalogue models under your access rules.

Call models in the live catalogue with one API key, scoped by your organization, team, and key permissions.

  • Point your OpenAI or Anthropic SDK at https://api.nrouter.ai/v1
  • Authenticate with a virtual key (sk-nrouter-*) scoped to your org and team
  • Access refusals return HTTP 401 or 403 before any model call runs
your OpenAI or Anthropic SDKbase_url = "https://api.nrouter.ai/v1"api_key = "sk-nrouter-••••"models your organization, team and key allowgpt-6-lunaclaude-sonnet-5-5gemini-3.1-progemini-3.8-flashA model outside your access: HTTP 401 or 403,before any call.

Apply your policies before generation.

Check key access, rate limits, and your configured input guardrails before reserving credits.

  • Enforces key and organization rate limits before reserving credits
  • Input policy blocks return HTTP 400 with $0 held and $0 spent
  • x-nr-guardrails reports pass, redacted, blocked, monitor, or partial
an allowed requestkey accessrate limitsinput guardrailsreserve creditsmodel called, one credit holdevery check runs before credits are reserved

Reserve credits. Settle at list price.

Reserve credits before calling a model and settle completed requests at list price with 0% token markup.

  • One credit reservation covers the request and any configured fallbacks
  • Settles once at the served model list price and releases unused hold
  • Buffered calls return x-nr-request-cost; streamed turns settle in Logs
one request, with fallbacks configured1 reserve$0.012one hold covers the request and its fallbacks2 settle at the served model's list price$0.0043 release the rest$0.0080% token markup

Gateway request logs without prompts.

Gateway request logs record request ID, served model, token usage, and settled cost without prompt text.

  • Records request ID, timestamps, model, tokens, cost, and routing outcome
  • Raw prompt bodies and completion text are not written to gateway logs
  • Prompts go to the selected model provider to generate the response
gateway request log, one rowrequest ID7a82c442modelgpt-6-lunatokens1,204 / 356cost$0.000668prompt textnot writtenPrompts still go to the chosen providerto be answered.

Take a closer look. How the SDK works.

  1. 01

    Install

    One package for your language. Python and TypeScript shown; every official SDK works the same way.

    pip install nrouter-sdknpm install @nrouter_ai/sdk
  2. 02

    Create a client

    nRouter() reads NROUTER_API_KEY from your environment and sends each call to api.nrouter.ai. Provider keys are ours to manage.

    client = nRouter()
  3. 03

    Call any model

    The OpenAI-compatible calls you already know. nRouter’s options ride on the same request; each topic below shows one.

    client.chat.completions.create(…)

Already on the OpenAI SDK? Point its base URL at https://api.nrouter.ai/v1 and keep your code.

Buffered calls return the settled charge in x-nr-request-cost with x-nr-cost-status: exact. Streamed calls settle in Logs, and unpriced calls stay unpriced rather than $0.

# Point your base URL and virtual key at api.nrouter.ai
curl -X POST https://api.nrouter.ai/v1/chat/completions \
-H "Authorization: Bearer $NROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-luna",
"messages": [{ "role": "user", "content": "Classify this support ticket." }]
}'

Read the docs

FAQs

What checks run on a request before a model provider is called?

Built in Rust, the gateway checks your virtual key permissions and model access rules, enforces key and organization rate limits, and evaluates your configured input guardrails before reserving credits and calling the upstream model provider. You can inspect which checks ran on each call in dashboard Logs and response headers.

When does a rejected request hold and spend $0, and when can a charge still settle?

When access checks, rate limits, or your configured input guardrails reject a request before credit reservation, the gateway returns an error (such as HTTP 400 with x-nr-guardrails: blocked on an input policy block, HTTP 401 or 403 on access refusals, or HTTP 429 on rate limits) with $0 held and $0 spent. Preflight can also take and immediately release a reservation if a later pre-call step refuses the call. By contrast, if an output guardrail blocks or withholds a response after the provider has generated tokens, those consumed tokens still settle at the served model list price.

How do input and output guardrails work, and what does x-nr-guardrails report?

The gateway runs built-in baseline protections alongside the input and output rules you configure for your organization, team, or virtual key, plus any per-request nrouter_guardrails additions. Because coverage depends on your active policy and request content, every response reports the actual inspection outcome in x-nr-guardrails: pass, redacted, blocked, monitor (when only warn or log rules apply), partial (when attachments or unscannable content were not inspected by text detectors), none (when no policy evaluated), or unavailable.

How do credit reservations and provider failovers affect my bill?

Before calling a provider, the gateway places a single credit reservation sized to cover your request and any configured fallback models. If the primary attempt fails before delivering a response—such as on an upstream 429, 503, 529, connection fault, or first-byte timeout—the gateway advances to your next configured fallback under that same reservation. Once a model answers, the request settles once at the published list price of the model that served the response and releases any unused reservation.

Where do final charges appear for buffered and streaming requests?

For buffered responses, the gateway calculates the charge when the provider response finishes and returns x-nr-request-cost with x-nr-cost-status: exact. For streaming responses, HTTP headers are sent before generation completes, so initial headers cannot contain the final cost; the dashboard shows Pending while tokens stream and resolves the settled charge from your request log once the stream closes. If a response cannot be priced from the catalogue, x-nr-cost-status reports unpriced and omits x-nr-request-cost rather than reporting a false $0.

Does nRouter charge a platform fee, token markup, or deposit fee?

No. A 0% platform fee and 0% token markup is our standard pricing: completed requests settle against your organization credit balance (or an active legacy plan allowance, never split across both on one call) at the served model’s published list price. On self-serve Stripe credit purchases ($5 minimum), nRouter absorbs the standard 2.9% + $0.30 card processing fee so a $100 payment adds $100.00 to your credit balance.

What is stored in gateway request logs, and what is sent to model providers?

Gateway request logs store operational metadata only: request ID, timestamps, served model, token counts, settled charge, latency, routing outcome, and guardrail status. Raw prompt bodies and completion text are not written to gateway request logs. To generate a response, your prompt (after any configured pre-call redaction) is transmitted to the selected upstream model provider, where that provider’s data handling terms apply.

How do I integrate an existing application, and what compatibility limits apply?

Point your OpenAI-compatible or Anthropic-compatible client at https://api.nrouter.ai/v1 (or /v1/messages) and authenticate with an nRouter virtual key (sk-nrouter-*). Each model in the live catalogue (/models) lists the specific endpoints and modalities it supports; direct calls and fallback chains must target models compatible with the endpoint you call. Pay-as-you-go accounts start immediately with a $5 deposit, and organizations needing custom rate limits, SLAs, or procurement terms can reach our team at /contact.

  1. When access checks, rate limits, or your configured input guardrails reject a request before credit reservation, $0 is held and $0 is spent. Preflight can also take and release a reservation before refusing, and output blocked after generation can still settle a charge for generated tokens. Browse supported models at /models and feature controls at /product/smart-routing, /product/guardrails, and /product/budgets.
  2. Buffered responses return the settled charge in x-nr-request-cost with x-nr-cost-status: exact. Streaming headers are sent before generation finishes, so the dashboard shows Pending until settlement is read from the spend record, and unpriced calls remain unpriced rather than $0. Completed calls settle at the served model list price with 0% token markup.
  3. Gateway request logs store operational metadata only (request ID, timestamps, served model, token counts, settled charge, latency, routing outcome, and guardrail status) without writing raw prompt or completion text to gateway request logs. Prompts are sent to the selected upstream model provider to generate the response under that provider’s retention terms. For custom enterprise agreements, visit /contact.