OpenAI Embeddings Explained: Models, Dimensions and When to Use Them

OpenAI Embeddings Explained: Models, Dimensions and When to Use Them

OpenAI embeddings turn ordinary text into lists of numbers that capture what the text means, so that a search system can find documents by meaning rather than by matching exact words. If you are building semantic search, a recommendation engine or a retrieval-augmented generation system, the question is not whether embeddings help, but which OpenAI model gives you the quality you need at a price you can afford. The short answer is that text-embedding-3-small is the sensible default for most teams, text-embedding-3-large is the choice when retrieval quality matters most, and the older ada-002 model is now a legacy option you should only keep if migration is genuinely difficult.

An embedding is a vector, a long list of floating-point numbers, produced by a model that has learned how words and sentences relate to one another. Texts with similar meanings end up with vectors that sit close together, and that closeness can be measured with a simple distance calculation such as cosine similarity. OpenAI offers its embedding models through an API, so you send text in and receive vectors back, with no model to host, no GPU to manage and no training data to prepare. That convenience is the main reason OpenAI embeddings became the default starting point for so many retrieval systems.

Key takeaways

  • OpenAI embeddings convert text into meaning-bearing vectors for semantic search, RAG and classification.
  • text-embedding-3-small produces 1,536-dimensional vectors and text-embedding-3-large produces up to 3,072, both launched on 25 January 2024.
  • Both third-generation models support Matryoshka shortening, so you can shrink vectors to 256 dimensions and still beat ada-002 on benchmark quality.
  • The small model costs roughly a fifth of the large model per token, which makes it the default for high-volume workloads.
  • Vectors are only as good as the text you feed them, so chunking and data quality matter at least as much as model choice.

What OpenAI embeddings actually do

The practical workflow is straightforward. You split your documents into chunks, send each chunk to the embedding API, and store the returned vectors in a vector database alongside the original text. When a user asks a question, you embed the question with the same model, ask the database for the nearest vectors, and return the matching passages. The same vectors can also power classification, clustering, duplicate detection and recommendation, because any task that depends on “how similar are these two texts” can be reduced to a distance calculation between vectors.

One detail that trips up new teams is that the query and the document must be embedded by the same model. Vectors from different models live in different spaces, so a query embedded with text-embedding-3-small cannot be meaningfully compared with documents embedded by text-embedding-3-large. If you switch models, you must re-embed your whole corpus, which is why the choice deserves care up front rather than a casual default.

Abstract illustration of text turning into vectors
OpenAI embeddings turn text into vectors that place similar meanings close together.

The three models at a glance

Model Dimensions Max input tokens MTEB average Price per 1,000 tokens Best for
text-embedding-3-small 1,536 8,191 62.3 $0.00002 High-volume search and RAG
text-embedding-3-large Up to 3,072 8,191 64.6 $0.00013 Maximum retrieval quality
text-embedding-ada-002 1,536 8,191 61.0 $0.00010 Legacy systems only

The benchmark figures in the table come from OpenAI’s own announcement, which reported MTEB averages of 62.3 for the small model, 64.6 for the large model and 61.0 for ada-002. On the multilingual MIRACL retrieval benchmark the gap is wider: 44.0 for the small model and 54.9 for the large model, against 31.4 for ada-002. Those numbers describe average performance across many tasks, not your documents, so treat them as a guide to relative quality rather than a promise about your own retrieval accuracy.

text-embedding-3-small: the sensible default

Best for: teams embedding large corpora on a budget, or anyone building a first retrieval system.

Released on 25 January 2024, text-embedding-3-small replaced ada-002 as OpenAI’s efficient embedding model. It produces 1,536-dimensional vectors by default, the same width as ada-002, which makes migration simple because your vector database schema does not need to change. Despite the identical width, it scores higher than its predecessor on both the MTEB and MIRACL benchmarks, and it costs a fifth as much: $0.00002 per 1,000 tokens against $0.00010 for ada-002.

The small model also supports the dimensions parameter, so you can ask for shorter vectors and still keep most of the quality. That matters because storage is the quiet cost of a vector system: a corpus of a million chunks at 1,536 dimensions needs roughly six gigabytes of raw vector storage before any index overhead, and halving the width roughly halves that figure.

text-embedding-3-large: maximum quality

Best for: retrieval systems where a missed document is expensive, such as legal research, medical knowledge bases or enterprise search.

text-embedding-3-large is OpenAI’s most capable embedding model. It produces vectors of up to 3,072 dimensions and leads the family on both MTEB and MIRACL benchmarks. The quality gap over the small model is modest on English tasks, around two points on MTEB, but much larger on multilingual retrieval, where it scores 54.9 against the small model’s 44.0. If your corpus spans many languages, the large model earns its price far more easily.

The price is the catch. At $0.00013 per 1,000 tokens, the large model costs about six and a half times as much as the small model per token, and its wider vectors cost more to store and search as well. A sensible compromise is to use the large model with shortened dimensions, for example 1,024 or 1,536, which keeps most of the quality while cutting storage.

text-embedding-ada-002: the legacy model

Best for: existing systems that have not yet scheduled a migration, and nothing new.

text-embedding-ada-002 was released in December 2022 and served as OpenAI’s standard embedding model for over a year. It produces 1,536-dimensional vectors and accepts up to 8,191 tokens per input, the same input limit as its successors. On the benchmarks OpenAI published, it trails both third-generation models, and it costs five times as much as the small model that replaced it.

There is no technical reason to choose ada-002 for a new project. The only argument for keeping it is inertia: if a production system already stores millions of ada-002 vectors, re-embedding the corpus takes time and money. Even then, the switch is worth planning, because every new document embedded with the old model extends the life of a weaker, more expensive vector space.

How Matryoshka dimensions work

Both third-generation models were trained with a technique called Matryoshka representation learning, named after the nested Russian dolls. The model is trained so that the first few hundred numbers in a vector already carry most of the meaning, and later numbers add progressively finer detail. That makes the vector truncatable: you can cut it short and still have a working embedding, which is not true of an ordinary vector, where cutting numbers at random destroys the meaning.

In practice you control this with the dimensions parameter on the API call. Ask for 1,024 dimensions from text-embedding-3-large and you get the first 1,024 numbers of the full 3,072-number vector, already trained to work well at that width. Start wide while you are testing, measure retrieval quality on your own data, then turn the dial down until quality starts to fall, and keep the smallest width that still meets your bar. OpenAI’s own figures show the large model shortened to 256 dimensions still outperforming ada-002 at full width on MTEB.

Where OpenAI embeddings fit best

The most common home for OpenAI embeddings is retrieval-augmented generation. In a RAG system the embedding model decides which passages reach the language model, and a weak retriever caps the quality of every answer that follows. Choosing the right embedding model, and tuning how documents are chunked before embedding, is therefore one of the highest-leverage decisions in a RAG build, and our guide to choosing and tuning RAG embedding models walks through that decision in detail.

Semantic search is the second natural fit. Where keyword search fails on synonyms and paraphrase, embeddings succeed, because “how do I reset my password” and “I cannot log in” sit close together in vector space even though they share almost no words. That is why embedding-based search has become the standard for help centres, documentation sites and internal knowledge bases. The choice between keyword and vector retrieval is not either-or, and our comparison of vector search versus full-text search explains when to use each approach and when to combine them.

Beyond search, the same vectors support classification, clustering and recommendation. Support tickets can be routed by similarity to past tickets, research papers can be grouped by topic without labelled training data, and products can be recommended by the meaning of their descriptions rather than by purchase history alone. All of these uses share the same requirement: text of consistent quality, chunked sensibly, embedded with one model, and stored in an index that fits the scale. For help picking that index, see our guide to the best vector databases for RAG.

Limitations to know before you commit

The 8,191-token input limit is the first constraint: longer documents must be split before embedding, and some client libraries silently truncate over-long inputs. Cost is the second constraint, since re-embedding a corpus on every model change adds up; caching embeddings and batching requests are the cheapest optimisations available. Third, OpenAI embeddings are a hosted, closed service, so your text leaves your infrastructure and you cannot fine-tune the model on your own domain. If data residency is a hard requirement, an open-weight model you host yourself may fit better.

Decision checklist: should you use OpenAI embeddings?

  • Data sensitivity: confirm that sending your text to a hosted API complies with your privacy and contractual obligations.
  • Corpus size: estimate total tokens and multiply by the per-token price for both models before you commit to one.
  • Languages: if most of your corpus is non-English, budget for the large model, whose multilingual lead is large.
  • Chunking plan: decide chunk size and overlap before embedding anything, since changing it later means re-embedding.
  • Evaluation set: build a small set of questions with known good answers so you can measure retrieval quality instead of guessing.
  • Width test: try the large model at 1,024 and 512 dimensions on your evaluation set before paying for full width.
  • Migration path: if you already have ada-002 vectors, plan a re-embedding window rather than running two models side by side.

Frequently asked questions

What are OpenAI embeddings used for?

OpenAI embeddings are used for semantic search, retrieval-augmented generation, classification, clustering, duplicate detection and recommendation. Any task that depends on measuring how similar two texts are in meaning can use them.

Which OpenAI embedding model should I choose?

Choose text-embedding-3-small for most workloads, because it is cheap, fast and better than the older ada-002 model. Choose text-embedding-3-large when retrieval quality is critical or your corpus is heavily multilingual.

How many dimensions do OpenAI embeddings have?

text-embedding-3-small produces 1,536-dimensional vectors and text-embedding-3-large produces up to 3,072. Both support Matryoshka shortening through the dimensions parameter, so you can request shorter vectors such as 512 or 256 dimensions.

Can I mix OpenAI embedding models in one system?

No, not for direct comparison. Vectors from different models live in different spaces, so queries and documents must be embedded with the same model. Switching models means re-embedding your corpus.

What is the maximum input length for OpenAI embeddings?

All three current models accept up to 8,191 tokens per input. Longer texts must be split into chunks before embedding, and you should confirm your client library truncates or rejects long inputs in the way you expect.

Are OpenAI embeddings better than open-source alternatives?

They are better on convenience and on multilingual quality at the top end, and they need no infrastructure. Open-source models can match or beat them on English retrieval benchmarks and keep your data in-house, so the right choice depends on your privacy needs, budget and engineering capacity rather than on a single leaderboard score.

Latest articles

Scroll to Top