Browse documentation

Create Embeddings

Create embeddings through nRouter with one POST to /v1/embeddings, with models from OpenAI, Cohere, Voyage, and Vertex for search and RAG workloads.

Generate dense vector embeddings for semantic search, retrieval-augmented generation (RAG), and clustering via a single POST request to /v1/embeddings across industry-standard vector providers.

Request Syntax & Options

Generate embeddings across OpenAI, Cohere, Voyage, and Vertex AI models (live catalog):

curl https://api.nrouter.ai/v1/embeddings \
  -H "Authorization: Bearer $NROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "text-embedding-3-small", "input": "How do fallbacks work?"}'

input accepts a string or array of strings. Configure encoding_format ("float" or "base64" to compress payload transfer) and dimensions (on text-embedding-3).

Token usage reports under x-nr-input-tokens and x-nr-total-tokens headers, settling at list price in request logs. See Embeddings API, Generate Speech, and Errors & Rate Limits.

Frequently asked questions

Which providers can I embed with?

OpenAI, Cohere, Voyage, and Google Vertex AI; inspect the live catalog for current models.

Can I embed many texts at once?

Yes; pass an array of strings in input to receive a corresponding array of embedding vectors in data.

How do I keep large batch responses small?

Set encoding_format to base64 to reduce JSON payload transfer overhead on large batches.

Do I need a separate key for embeddings?

No; a single virtual key and credit balance covers text, embedding, and multimodal endpoints.

Was this page helpful?