Embeddings
POST /api/v1/embeddings: turn text into vectors for search, clustering and retrieval. For examples and explanations, see the Embeddings guide.
Create embeddings
POST /api/v1/embeddings
Turns text into L2-normalised vectors.
Request body
inputstring, string[], integer[] or integer[][]required
One text, up to 2,048 texts, or token ids. Each input may be up to the model's context (8,192 tokens for bge-m3).
modelstringrequired
An embedding model, such as arklabsai/bge-m3.
dimensionsintegeroptional
Truncate vectors to this length (re-normalised). At most the model's size, 1,024 for bge-m3.
encoding_formatstringoptional
float (default) or base64 (little-endian float32).userstringaccepted, no effect
Accepted for compatibility.
Returns a list of embedding objects. usage.prompt_tokens is the number of inputs times the length of the longest input.
Request
curl https://api.ark-labs.cloud/api/v1/embeddings \
-H "Authorization: Bearer $ARK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "arklabsai/bge-m3", "input": ["Szczecin", "Stettin"]}'Response
{
"object": "list",
"data": [
{"object": "embedding", "index": 0, "embedding": [0.0213, -0.0127, …]},
{"object": "embedding", "index": 1, "embedding": [0.0198, -0.0144, …]}
],
"model": "arklabsai/bge-m3",
"usage": {"prompt_tokens": 10, "total_tokens": 10, "credits_used": 1, "credit_balance": 4999992}
}