Skip to content
RU

Embeddings

POST /v1/embeddings produces vectors for search, clustering and RAG.

vec = client.embeddings.create(
model="text-embedding-3-small",
input=["first document", "second document"],
)
print(len(vec.data), len(vec.data[0].embedding))

Accepted models are text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002, plus qwen/qwen3-embedding-8b, qwen/qwen3-embedding-4b (multilingual, strong on Russian) and google/gemini-embedding-2. The input field takes a string or an array of strings — an array is cheaper and faster than looping one at a time.

Billed per million input tokens.

The endpoint requires the embeddings scope — a key without it gets a 403. A ready-made RAG pipeline on these embeddings — in the RAG guide.