The embeddings endpoint converts text into dense vector representations you can use for semantic search, clustering, classification, and retrieval-augmented generation (RAG). It is OpenAI-compatible, so the openai SDK's embeddings.create call works without modification.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://opendunes.com/api/v1",
apiKey: process.env.OPENDUNES_API_KEY,
});
const resp = await client.embeddings.create({
model: "openai/text-embedding-3-large",
input: "خوارزمي pioneered algebra in the 9th century.",
});
const vector = resp.data[0].embedding;
- Batch inputs — pass an array of strings and receive one embedding per element in a single request.
- Multiple models — choose from several embedding models at different size/cost trade-offs; all billed in DA per million tokens.
- DA pricing — same micro-DA billing as chat: input tokens × model rate, rounded up.
- Arabic and French support — multilingual models support all three official languages of Algeria natively.
The response follows the OpenAI embeddings schema:
{
"object": "list",
"data": [
{ "object": "embedding", "index": 0, "embedding": [0.002, -0.018, ...] }
],
"model": "openai/text-embedding-3-large",
"usage": { "prompt_tokens": 12, "total_tokens": 12 }
}