ZeroDB · Embeddings API
Embed, store & search vectors in one API call
Generate embeddings with bge-m3, MiniLM, or gte-large, store them in ZeroDB vectors, and run semantic similarity search for RAG. One API key, zero infrastructure.
Five embedding models
bge-m3 1024d (0.02 cr/1k) to MiniLM 384d (0.009 cr/1k). Get the live list from GET /api/v1/public/embeddings/models.
Embed-and-store in one call
POST /embeddings/embed-and-store generates vectors and upserts them in a single round trip. Identical texts are cached (~7-day TTL).
Filtered semantic search
Scope search to a namespace, filter by metadata, threshold by cosine similarity. HNSW index for production scale.
Embedding models
Choose a model based on quality, language coverage, and cost. All models are served via the same endpoint — swap with the model field.
| Model | Dimensions | Cost / 1k texts | Notes |
|---|---|---|---|
| bge-m3 | 1024 | 0.02 credits | Default · multilingual · best overall quality |
| e5-large-v2 | 1024 | 0.02 credits | Strong English quality |
| all-mini-lm-l6-v2 | 384 | 0.009 credits | Fastest · lowest cost · English |
| qwen3-embedding-0.6b | 1024 | 0.04 credits | Multilingual · instruction-tuned |
| gte-large-en-v1.5 | 1024 | 0.09 credits | Highest accuracy · English |
Cosine similarity ranges from 0.0 to 1.0. Query vectors must match the dimension of stored data or you will get zero results. Always use the same model within a namespace.
Quickstart
Get a free temporary project with 1,000 embedding credits in one POST — no account required.
Step 1 — Get an Instant DB key (free, 72-hour project)
curl -X POST https://api.ainative.studio/api/v1/public/instant-db \
-H "Content-Type: application/json" \
-d '{
"agree_terms": true,
"on_behalf_of": "user_or_agent_id"
}'
# Returns: { "project_id": "...", "api_key": "...", "credits": 1000 }Step 2 — Embed and store documents in one call
curl -X POST https://api.ainative.studio/api/v1/public/{project_id}/embeddings/embed-and-store \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"To reset your password, click Forgot Password on the login page.",
"Team billing is managed by the account owner under Settings > Billing."
],
"namespace": "docs",
"model": "bge-m3"
}'{
"success": true,
"vectors_stored": 2,
"embeddings_generated": 2,
"model": "bge-m3",
"dimensions": 1024,
"namespace": "docs",
"processing_time_ms": 128.4
}Step 3 — Semantic search
curl -X POST https://api.ainative.studio/api/v1/public/{project_id}/embeddings/search \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "how do I change my password?",
"namespace": "docs",
"limit": 3
}'{
"results": [
{
"namespace": "docs",
"document": "To reset your password, click Forgot Password on the login page.",
"source": "help/security",
"vector_id": "...",
"metadata": { "section": "password" }
}
]
}Low-level vector API
Generate embeddings and manage vectors independently when you need more control.
Generate only (no storage)
POST /api/v1/public/{project_id}/embeddings/generate
{
"texts": ["..."],
"model": "bge-m3"
}Upsert a single vector
POST /api/v1/public/zerodb/{project_id}/database/vectors/upsert
{
"vector_embedding": [0.01, -0.02, ...],
"namespace": "docs",
"document": "original text",
"vector_metadata": { "source": "help/security" }
}Batch upsert (up to 500 per call)
POST /api/v1/public/zerodb/{project_id}/database/vectors/upsert-batchSame body shape as single upsert, wrapped in an array.
Similarity search with query vector
POST /api/v1/public/zerodb/{project_id}/database/vectors/search
{
"query_vector": [...],
"namespace": "docs",
"limit": 10,
"threshold": 0.8,
"metadata_filter": {
"source": { "$in": ["help/security", "help/billing"] }
}
}Create a vector index
POST /api/v1/public/zerodb/{project_id}/database/vectors/index
{
"namespace": "docs",
"index_type": "hnsw"
}| Index type | Best for |
|---|---|
| flat | Under 10k vectors · perfect recall · no index overhead |
| ivf | Large datasets · balanced speed and accuracy |
| hnsw | Best accuracy at scale · production workloads |
Get the ZeroDB Embeddings & Semantic Search Guide
Free PDF workbook: choose an embedding model, embed-and-store your documents, run semantic search, and build a RAG prompt — step by step.
Frequently asked questions
What embedding models does ZeroDB support?
Five models: bge-m3 (1024d, 0.02 credits/1k, multilingual, default), e5-large-v2 (1024d, 0.02 credits/1k), all-mini-lm-l6-v2 (384d, 0.009 credits/1k, fastest), qwen3-embedding-0.6b (1024d, 0.04 credits/1k), and gte-large-en-v1.5 (1024d, 0.09 credits/1k). Get the live list from GET /api/v1/public/embeddings/models.
What is a namespace?
A namespace is a logical collection inside your project — like a folder for vectors. Search is always scoped to one namespace. The default is "default". Use separate namespaces for separate corpora (e.g. "docs", "support_tickets") and always use the same embedding model within a namespace, since query dimensions must match stored dimensions.
How does embed-and-store work?
POST /api/v1/public/{project_id}/embeddings/embed-and-store accepts an array of texts, generates an embedding for each, and upserts the vectors in one request. ZeroDB returns vectors_stored, the model used, and dimensions. Identical text+model combinations are cached for ~7 days, so repeated embeds are near-instant.
How do I build RAG on top of ZeroDB embeddings?
Three steps: (1) embed your document chunks with embed-and-store, (2) when a user asks a question, POST /embeddings/search with the query text and get back the most similar chunks, (3) concatenate the returned documents as context in your LLM prompt and cite the metadata.source for grounding.
How much does the Embeddings API cost?
Models are metered per 1,000 texts against your credit balance. The cheapest is all-mini-lm-l6-v2 at 0.009 credits/1k; bge-m3 (default, best multilingual quality) is 0.02 credits/1k. Credits are $0.001 each. Get started free with Instant DB — POST /api/v1/public/instant-db returns 1,000 free embedding credits with a 72-hour temporary project.