0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

nRouter API Reference: One Key for OpenAI- and Anthropic-Compatible Endpoints

0
Posted at

nRouter's API Reference documents the whole surface of its gateway: endpoints, authentication, and errors, in one page.

One key, two wire formats

Every request takes a scoped virtual key (sk-nrouter-...) as a Bearer token against https://api.nrouter.ai/v1. Standard SDKs connect by changing the base URL and the key. The same key speaks the OpenAI wire format at /v1/chat/completions (streamed or buffered, with guardrails and provider fallback) and the Anthropic Messages format at /v1/messages, which also has a count_tokens endpoint for counting input tokens before sending.

The rest of the endpoint set

  • GET /v1/models lists models across every connected provider; GET /v1/models/{model_id} retrieves one model
  • POST /v1/embeddings for semantic search, RAG and classification
  • POST /v1/images/generations for image generation
  • POST /v1/audio/speech, /v1/audio/transcriptions (timestamps, language detection) and /v1/audio/translations
  • POST /v1/videos starts an asynchronous video job; GET /v1/videos/{id} polls it and GET /v1/videos/{id}/content downloads it — polling and download are unmetered

Cross-cutting behaviour

A four-phase preflight security check runs before dispatch, rates are pass-through list rates, and real-time latency and spend are reported back on x-nr- response headers for every call.

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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?