Skip to main content
Embedding models turn text into a vector so that distance between vectors tracks closeness in meaning. That is what powers semantic search, retrieval-augmented generation, deduplication, clustering, and recommendation. Call the dedicated Embeddings API (POST /v1/embeddings). An embedding model is routable only on this endpoint and returns OpenAI’s native embeddings envelope, so an existing client only needs its base URL and model id changed. Both models return 384-dimensional vectors, so they are interchangeable in an existing index. Embeddings are billed on input tokens only.

all-minilm-l6-v2

Sentence-Transformers’ all-MiniLM-L6-v2 is the default workhorse of semantic search. It maps a sentence or short paragraph to a 384-dimensional vector, trained with contrastive learning on more than a billion sentence pairs, so cosine distance between two vectors tracks how close the two texts are in meaning. At 22.7M parameters it embeds fast and cheap enough to index a whole corpus and re-embed it whenever your content changes. Inputs are truncated at 256 tokens, so embed chunks rather than whole documents.
References: Model cardTermsPrivacy
Embeddings API
Response
The vector above is truncated for readability; a real response carries all 384 values. The model field reads all-MiniLM-L6-v2, the upstream capitalization of the id you send.

bge-small-en-v1.5

BAAI’s BGE-small-en-v1.5 is a retrieval-first English embedding model and one of the strongest performers on the MTEB benchmark for its size. It produces the same 384-dimensional vectors as all-minilm-l6-v2, so it is a drop-in swap in an existing index, but it takes a 512-token window instead of 256 and is tuned specifically for dense retrieval rather than general sentence similarity. At 33.4M parameters it is the one to reach for when the job is ranking passages against a query.
References: Model cardTermsPrivacy Embed a batch by passing an array. Each data[i].index maps a vector back to its input.
Batch embeddings

Which one to pick

Start with all-minilm-l6-v2 for general semantic similarity over short chunks. Move to bge-small-en-v1.5 when the job is English retrieval, when your chunks run past 256 tokens, or when retrieval quality is the bottleneck. Both cost the same and return the same vector width, so switching is a one-line change plus a reindex.