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

ModelDimensionsLanguagesBest fit
BGE Small EN amanai/bge-small-en 384 English Low-latency indexing
BGE Base EN amanai/bge-base-en 768 English Balanced retrieval
BGE Large EN amanai/bge-large-en 1024 English Higher-quality English retrieval
BGE-M3 amanai/bge-m3 1024 Multilingual Multilingual retrieval
EmbeddingGemma 300M amanai/embeddinggemma-300m 768 Multilingual Multilingual retrieval
Qwen3 Embedding 0.6B amanai/qwen3-embedding-0.6b 1024 Multilingual Multilingual retrieval
voyage-4-lite amanai/voyage-4-lite 1024 Multilingual General text retrieval
voyage-4 amanai/voyage-4 1024 Multilingual General text retrieval
voyage-4-large amanai/voyage-4-large 1024 Multilingual General text retrieval
voyage-code-4 amanai/voyage-code-4 1024 Multilingual Code retrieval
voyage-finance-2 amanai/voyage-finance-2 1024 Multilingual Finance retrieval
voyage-law-2 amanai/voyage-law-2 1024 Multilingual Legal retrieval

Request

bash
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"
  }'
FieldTypeBehavior
modelstringRequired embedding model ID from typed discovery.
inputstring or string[]One text item or up to 64 text items.
encoding_formatstringfloat for numeric vector arrays or base64 for encoded vectors.
dimensionsinteger, optionalVoyage 4-series models support 256, 512, 1024, or 2048. Voyage finance/law support 1024 only. Other embedding models keep their advertised native dimension.
input_typestring, optionalVoyage accepts query or document. Use the matching type for search queries and indexed documents; omit this field for legacy embedding models.
userstring, optionalA bounded end-user identifier for the request.

Voyage request example

bash
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

bash
{
  "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

✓Batch related inputs to reduce request overhead, while respecting the endpoint's accepted payload size.
✓Normalize your application text consistently before indexing and querying.
✓Use amanai/bge-m3 or another multilingual model when Indonesian, Malay, and English can coexist.
✓Use Rerank after vector retrieval when you need a more precise final ordering.

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.