Skip to main content

Endpoints, Auth & Errors: Notes on nRouter's API Reference

Updated 2 min readMarkdown
Endpoints, Auth & Errors: Notes on nRouter's API Reference

A gateway's API reference tells you what the marketing page cannot: exactly what you can call, how you authenticate, and what comes back. nRouter's API Reference is a single page that documents the full endpoint set, and its design choices are worth noting.

Auth: one virtual key

Authentication is a virtual key (sk-nrouter-…) sent as a Bearer token. Standard OpenAI and Anthropic SDKs connect by setting the base URL to https://api.nrouter.ai/v1 and swapping the key. Keys are scoped, and the same credential works across both wire formats.

The endpoints

Chat completions arrive OpenAI-compatible, streamed or buffered, with guardrails and provider fallback. Anthropic Messages is served natively at /v1/messages, with count_tokens alongside it. The models endpoints list what is available across connected providers and retrieve single models by ID. Embeddings, image generation, text to speech, transcription with timestamps, and audio translation round out the synchronous set. Video is asynchronous by design: POST to start a job, GET to poll, GET to download — polling and download unmetered.

What rides along

Every endpoint shares the same cross-cutting behaviour: a four-phase preflight security phase before dispatch, pass-through list rates, and real-time latency and spend reporting via x-nr- headers. The reference also gives each endpoint an interactive spec, so a request can be tried from the documentation itself.

Full reference: https://nrouter.ai/docs/api-reference

About the author

  • nRouter is a managed LLM gateway: one OpenAI-compatible API key, with smart routing, automatic failover, guardrails, virtual keys, and per-key budgets enforced in the request path.

No comments yet. Be the first to comment.

More from this blog