API Reference
POST/v1/embeddings
Embeddings
Converts text into a numeric vector for search, clustering, RAG, and other retrieval workflows. Shape matches the OpenAI Embeddings API, so client.embeddings.create() works unmodified.
A separate paid product from chat — embeddings don't share the free daily token pool. Rate limit: 60 requests/min per account.
Request body
modelstringRequired
The embedding model id, e.g. openai/text-embedding-3-small, voyageai/voyage-3.5, cohere/embed-v4, or qwen/qwen3-embedding-8b. See Models for the full list, dimensions, and context length of each.
inputstring / string[]Required
Text to embed — a single string, or an array of strings to embed several inputs in one request.
encoding_formatstringOptional
Passed through to the provider as-is (e.g. "float").
dimensionsintegerOptional
Requests a reduced output dimensionality, on models that support it (e.g. text-embedding-3-*).
curl https://api.dravenai.lat/v1/embeddings \
-H "Authorization: Bearer sk-drv-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/text-embedding-3-small",
"input": ["Draven AI is an OpenAI-compatible API.", "Vectors power semantic search."]
}'
result = client.embeddings.create(
model="openai/text-embedding-3-small",
input=["Draven AI is an OpenAI-compatible API.", "Vectors power semantic search."],
)
const result = await client.embeddings.create({
model: "openai/text-embedding-3-small",
input: ["Draven AI is an OpenAI-compatible API.", "Vectors power semantic search."],
});
Response
200 OK
{
"object": "list",
"model": "openai/text-embedding-3-small",
"data": [
{ "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, "..."] },
{ "object": "embedding", "index": 1, "embedding": ["..."] }
],
"usage": { "prompt_tokens": 18, "total_tokens": 18 },
"pricing": { "unit": "per_mtoken", "usd_per_mtoken": 0.02, "usd_total": 0.00000036 }
}
Store the
embedding arrays in your own vector database (pgvector, Pinecone, Qdrant, etc.) — Draven AI doesn't host a vector store, this endpoint only produces the vectors.For error responses, see Errors. To re-order search results by relevance instead, see Rerank.