Skip to content

Text embeddings with the API

An embedding is a numerical vector that represents the meaning of a text. To find similar passages, compare vectors produced by the same model with the same number of dimensions.

All three models use POST /v1/embeddings. Send the model ID in model, the text in input, and your API key in the Authorization header.

https://gptunnel.ru/v1/embeddings
Model Vector size without dimensions Set the size
text-embedding-3-small 1536 In the example, dimensions: 1024 returns 1024 numbers.
text-embedding-3-large 3072 In the example, dimensions: 2048 returns 2048 numbers.
text-embedding-ada-002 1536 Send text without dimensions. A request with dimensions: 1024 returned HTTP 400.

Choose a model before indexing. If you change models, regenerate your vectors for existing texts and search queries. Check available IDs in the model catalog.

If you want to upload and search documents without managing a vector store, use RAG knowledge bases.