Browse documentation

API Reference

Every endpoint the nRouter gateway serves, with request and response shapes

nRouter exposes an OpenAI- and Anthropic-compatible API at https://api.nrouter.ai. Any SDK that talks to either provider works by changing the base URL and the key.

Try any endpoint from its page

Every endpoint page below carries a live request panel — set your key, send a real request, read the cost straight off the response headers.

Endpoints

EndpointMethodWhat it does
/v1/chat/completionsPOSTChat completions (OpenAI-compatible)
/v1/completionsPOSTLegacy text completions
/v1/responsesPOSTOpenAI Responses API
/v1/messagesPOSTMessages (Anthropic-compatible)
/v1/messages/count_tokensPOSTCount tokens before spending
/v1/embeddingsPOSTEmbedding vectors
/v1/modelsGETList available models
/v1/models/{model_id}GETRetrieve one model
/v1/images/generationsPOSTImage generation
/v1/audio/speechPOSTText to speech
/v1/audio/transcriptionsPOSTSpeech to text
/v1/audio/translationsPOSTTranslate speech to English
/v1/videosPOSTStart a video job
/v1/videos/{id}GETPoll job status (free)
/v1/videos/{id}/contentGETDownload the video (free)

Video creation is billed; polling and download are not — you are charged once, when the job starts.

Authentication

Every request takes your virtual key as a bearer token:

curl https://api.nrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $NROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello!"}]}'

Guides

Start with Chat Completions — streaming, function calling, and the request shape in full.

Was this page helpful?