Amanai Docs
Embeddings
OpenAI-compatible text embeddings for search, clustering, recommendations, and retrieval.
Overview
Use POST /v1/embeddings with the same Bearer API key and OpenAI-compatible SDK contract used by your other Amanai integrations. The endpoint accepts one string or a batch of up to 64 strings and returns one vector for each input item.
Discovery is typed. List the models available to your key with GET /v1/models?type=embedding. Do not select chat models on this endpoint.
Embedding models
| Model | Dimensions | Languages | Best fit |
|---|---|---|---|
amanai/bge-small-en | 384 | English | Low-latency indexing |
amanai/bge-base-en | 768 | English | Balanced retrieval |
amanai/bge-large-en | 1024 | English | Higher-quality English retrieval |
amanai/bge-m3 | 1024 | Multilingual | Multilingual retrieval |
amanai/embeddinggemma-300m | 768 | Multilingual | Multilingual retrieval |
amanai/qwen3-embedding-0.6b | 1024 | Multilingual | Multilingual retrieval |
amanai/voyage-4-lite | 1024 | Multilingual | General text retrieval |
amanai/voyage-4 | 1024 | Multilingual | General text retrieval |
amanai/voyage-4-large | 1024 | Multilingual | General text retrieval |
amanai/voyage-code-4 | 1024 | Multilingual | Code retrieval |
amanai/voyage-finance-2 | 1024 | Multilingual | Finance retrieval |
amanai/voyage-law-2 | 1024 | Multilingual | Legal retrieval |
Request
curl https://api.amanai.dev/v1/embeddings \
-H "Authorization: Bearer $AMANAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "amanai/bge-m3",
"input": ["hello world", "semantic search"],
"encoding_format": "float"
}' | Field | Type | Behavior |
|---|---|---|
model | string | Required embedding model ID from typed discovery. |
input | string or string[] | One text item or up to 64 text items. |
encoding_format | string | float for numeric vector arrays or base64 for encoded vectors. |
dimensions | integer, optional | Voyage 4-series models support 256, 512, 1024, or 2048. Voyage finance/law support 1024 only. Other embedding models keep their advertised native dimension. |
input_type | string, optional | Voyage accepts query or document. Use the matching type for search queries and indexed documents; omit this field for legacy embedding models. |
user | string, optional | A bounded end-user identifier for the request. |
Voyage request example
curl https://api.amanai.dev/v1/embeddings \
-H "Authorization: Bearer $AMANAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "amanai/voyage-4",
"input": ["A document about semantic search"],
"input_type": "document",
"dimensions": 1024
}' Response
{
"object": "list",
"model": "amanai/bge-m3",
"data": [
{"object": "embedding", "index": 0, "embedding": [0.012, -0.034, "..."]},
{"object": "embedding", "index": 1, "embedding": [0.021, -0.018, "..."]}
],
"usage": {"item_count": 2, "dimensions": 1024, "encoding_format": "float"}
} Keep the model ID and dimensions with your stored vectors. Queries and indexed documents must use the same model and vector dimension.
Batching and retrieval
amanai/bge-m3 or another multilingual model when Indonesian, Malay, and English can coexist.Billing
BGE, Qwen3, and Voyage embeddings bill tokens with a 250-credit minimum. EmbeddingGemma remains at 1 credit per UTF-8 unit with a 1,000-credit minimum. Local byte counts are not exact token counts. Failed requests before delivery are not charged. See Billing & pricing for current per-model rates.