Embeddings API (`/v1/embeddings`)
Convert text into dense vector representations for semantic search, retrieval-augmented generation (RAG), and clustering. 100% OpenAI SDK compatible with multi-provider failover and Zero Data Retention.
1. Quick Example (OpenAI SDK)
Point your standard OpenAI client to https://api.nicrron.ai/v1. No custom SDK required.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.nicrron.ai/v1",
apiKey: process.env.NICRRON_API_KEY,
});
const response = await client.embeddings.create({
model: "openai/text-embedding-3-small",
input: ["The quick brown fox jumps over the lazy dog", "Semantic search with Nicrron"],
dimensions: 512, // Optional: override the model's default width
});
console.log(response.data[0].embedding); // Float array
console.log(response.usage); // { prompt_tokens: 18, total_tokens: 18 }2. Supported Embedding Models
| Model Identifier | Provider | Default Dimensions | Max Dimensions | Pricing (per 1M tokens) |
|---|---|---|---|---|
| openai/text-embedding-3-small | OpenAI | 1536 | 1536 | $0.02 |
| openai/text-embedding-3-large | OpenAI | 3072 | 3072 | $0.13 |
| mistral/mistral-embed | Mistral | 1024 | 1024 | $0.10 |
| mistral/codestral-embed | Mistral | 1536 | 1536 | $0.15 |
| voyage/voyage-4-lite | Voyage | 1024 | 2048 | $0.02 |
| voyage/voyage-4 | Voyage | 1024 | 2048 | $0.06 |
| voyage/voyage-4-large | Voyage | 1024 | 2048 | $0.12 |
| voyage/voyage-code-4 | Voyage | 1024 | 2048 | $0.12 |
| voyage/voyage-finance-2 | Voyage | 1024 | 1024 | $0.12 |
| voyage/voyage-law-2 | Voyage | 1024 | 1024 | $0.12 |
Size your vector index against the default column unless you pass dimensions explicitly. The two differ only on the Voyage -4 family, which returns 1024 by default but supports up to 2048; the -2 domain models reject anything above 1024.
3. Multi-Model Embedding Fallbacks
Specify a fallback array with models in your request body. If the primary provider encounters a rate-limit (429) or outage (5xx), Nicrron automatically cascades to the secondary provider.
curl https://api.nicrron.ai/v1/embeddings \
-H "Authorization: Bearer $NICRRON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"models": ["openai/text-embedding-3-small", "mistral/mistral-embed"],
"input": "High-throughput retrieval augmented generation"
}'4. Zero Data Retention
🛡️ Strict In-Memory Streaming
Your document embeddings and raw input chunks are never saved to databases or disk. Only token usage and latency telemetry are stored for cost settlement. Read our Data Privacy Guarantee.