Embeddings¶
POST /embeddings converts text—or multimodal content supported by the model—into vectors for semantic retrieval, clustering, and similarity calculations. Vector dimensions and accepted input types are properties of the selected model.
Embed text¶
Submit either one string or an array through input:
curl "$GENESIS_BASE_URL/embeddings" \
-H "Authorization: Bearer $GENESIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<embedding-model-id>",
"input": [
"MatrixOne is a database for the intelligence era.",
"Genesis provides a unified model API."
]
}'
The data array maps back to the inputs:
Field |
Meaning |
|---|---|
|
Floating-point vector |
|
Index of the corresponding input |
|
Token usage for reconciliation, when returned |
Use index to associate batched inputs rather than relying on an undocumented relationship.
Batch safely¶
Combine small inputs within the model’s input-length and request-size limits to reduce request overhead.
Keep a stable business ID for each input and align it with
data[].indexbefore writing vectors.Empty strings, long text, and languages can behave differently across models. Clean input and retain individual failures.
Use one model and one preprocessing pipeline within an index. Changing models can alter dimensions or vector distribution and requires re-embedding the data.
Multimodal embeddings¶
Genesis can also expose multimodal embedding models. Only models tagged with the embedding_multimodal capability accept image-text content. Copy the current content-part format from the Use page code generator and validate it in the Debug Playground. Do not send the Chat Completions messages structure directly to /embeddings.
For model discovery, see Models and Providers. This endpoint has no general pagination contract: when a batch exceeds the model’s request limits, split it in the caller and control concurrency. For authentication and 429 troubleshooting, see Endpoints and Authentication.