InferenceReference
Embeddings
A method that turns text into vectors for semantic search and document comparison.
The Embeddings method turns text into a vector: a set of numbers that lets you compare texts by meaning. Vectors are what you need when you build search over your own documents or compare texts with each other. A single request can take either one text or a list of texts.
Parameters
modelstringrequired
Name of an embedding model from the catalog, for example
bge-m3.inputstring | arrayrequired
The text or list of texts to get vectors for.
Embedding models
| Model | Vector length |
|---|---|
bge-m3 | 1024 |
qwen3-embedding-4b | 2560 |
qwen3-embedding-8b | 4096 |
Vectors from different models are not comparable with each other. If you switch models, recompute all the vectors you have already stored.
curl https://api.yenisei.ru/v1/embeddings \
-H "Authorization: Bearer $YENISEI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bge-m3",
"input": ["first text", "second text"]
}'
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.yenisei.ru/v1",
api_key=os.environ["YENISEI_KEY"],
)
resp = client.embeddings.create(
model="bge-m3",
input=["first text", "second text"],
)
print(len(resp.data[0].embedding))
Errors
The method returns the same codes as the other API methods. They are described on the Error codes page.