EN

Language

Our editions

Written for each audience, not translated word for word.

What are embeddings: the vectors behind semantic search

ExplainerBy Lucas Matías García TorresUpdated Data checked 4 min read

Reviewed by Lucas Matías García Torres on . How we work.

Leer en español

A 3D lattice of thin steel lines and nodes with a few pathways lit in orange, like a neural network

Short answer

What are embeddings? On October 23, 2026, an embedding is a vector of numbers that represents the meaning of a text or other input, so that related items sit close together and can be found by similarity. OpenAI's text-embedding-3-small returns 1,536 dimensions at roughly $0.02 per million tokens, Google's Gemini embeddings default to 3,072 dimensions and Anthropic points to Voyage instead of offering its own model. Always use the same model to index and to query.

Prices and limits change often: check the vendor's page before you pay. How we make money.

An embedding is a list of numbers that represents the meaning of a piece of text, an image or another input, so that a program can measure how related two things are. OpenAI's guide defines it as a vector of floating point numbers where the distance between two vectors measures their relatedness: small distances mean closely related, large distances mean unrelated. On October 23, 2026, embeddings are the quiet machinery behind semantic search, retrieval for chatbots, recommendations and clustering. This guide explains what they are, which models exist, what they cost and the mistakes that break them, based on the OpenAI, Google, Anthropic and Ollama documentation read on October 23, 2026.

What an embedding is

A language model reads text as tokens. An embedding model reads the same tokens but, instead of writing an answer, it returns a fixed-length vector: 1,536 numbers for OpenAI's text-embedding-3-small, for example. Texts with similar meaning land close together in that space even when they share no words, so "how do I reset my password" and "I forgot my login" end up near each other, while "password strength rules" lands a little further away.

You never read those numbers directly. You store them, and then you compare them. The usual comparison is cosine similarity, which OpenAI recommends for its models, and which for vectors normalized to length 1 is the same as a simple dot product.

What embeddings are used for

OpenAI lists the common uses: search (rank results by relevance to a query), clustering (group similar texts), recommendations, anomaly detection (find outliers), diversity measurement and classification. The best known today is retrieval for chatbots: you embed your documents once, embed each question, fetch the closest passages and give them to the model as context. That pattern is retrieval-augmented generation, and our comparison of RAG and fine-tuning explains when it beats retraining a model.

Embedding models compared

Table: embedding models from the official documentation (checked October 23, 2026)

Item OpenAI Google (Gemini API) Voyage (recommended by Anthropic) Ollama (local)
Models text-embedding-3-small, text-embedding-3-large gemini-embedding-2 (multimodal), gemini-embedding-001 (text) voyage-4-large, voyage-4, voyage-4-lite, voyage-code-4; voyage-4-nano with open weights any embedding model you pull, such as embeddinggemma
Default dimensions 1,536 (small), 3,072 (large) 3,072; recommended 768, 1,536 or 3,072 1,024 (also 256, 512 or 2,048) depends on the model, typically 384 to 1,024
Input limit 8,192 tokens 8,192 tokens (embedding-2), 2,048 (embedding-001) 32,000 tokens depends on the model
Normalized yes, length 1 embedding-2 yes; embedding-001 you normalize yes yes (L2)

Anthropic does not offer an embedding model of its own: its documentation points to Voyage. Gemini's embedding-2 also accepts images, audio, video and PDFs, within limits Google sets per request: up to 6 images, 180 seconds of audio, 120 seconds of video or one PDF of up to 6 pages.

Dimensions, normalization and similarity

More dimensions can capture more nuance, but they cost more storage and slower searches. Both OpenAI and Google let you shorten the vector: OpenAI with the dimensions parameter, Google with output_dimensionality between 128 and 3,072, thanks to a training technique Google calls Matryoshka Representation Learning. Voyage offers int8 and binary quantization that cut storage by 4 and 32 times.

Normalization is where silent bugs live. OpenAI's vectors come normalized to length 1, and Gemini's embedding-2 normalizes automatically, but with gemini-embedding-001 you have to normalize the shortened vectors yourself before comparing them. Skip it and cosine scores drift without any error message.

What embeddings cost

Embedding is one of the cheapest things you can buy from a model API. OpenAI quotes prices as pages per dollar, assuming about 800 tokens per page: 62,500 pages per dollar for text-embedding-3-small and 9,615 for text-embedding-3-large, roughly $0.02 and $0.13 per million tokens. Quality differs less than price: OpenAI reports 62.3% and 64.6% on the MTEB benchmark. Google offers its embeddings through batch mode at 50% of the standard embedding price, the same discount explained in our guide to the batch API. And a local model through Ollama costs nothing per token: our guide to running an LLM locally covers the setup, and Ollama's /api/embed endpoint accepts a list of inputs in one call.

Mistakes that break embeddings

  • Mixing models. Vectors from different models live in different spaces. Ollama's documentation is explicit: use the same model for indexing and for querying. Changing models means re-embedding everything.
  • Ignoring the input type. Voyage asks you to mark inputs as query or document, Gemini's embedding-001 takes a task_type and embedding-2 uses prompt prefixes instead. Using the wrong one lowers retrieval quality.
  • Embedding whole documents. Inputs over the limit get rejected or cut, and a long text averaged into one vector loses detail. Split documents into passages first.
  • Expecting world knowledge. OpenAI notes that its third-generation embedding models lack knowledge of events after September 2021. Embeddings capture meaning, not facts, so new product names may not land where you expect.

What we checked

  • OpenAI: an embedding is a vector of floating point numbers and the distance between two vectors measures relatedness; uses include search, clustering, recommendations, anomaly detection, diversity measurement and classification; text-embedding-3-small has 1,536 dimensions, text-embedding-3-large 3,072, both with an 8,192-token input limit; about 62,500 and 9,615 pages per dollar at about 800 tokens per page; MTEB 62.3% and 64.6%; the dimensions parameter shortens vectors; embeddings are normalized to length 1 and cosine similarity is recommended; the third-generation models lack knowledge of events after September 2021. (OpenAI, )
  • Gemini API: gemini-embedding-2 is multimodal and gemini-embedding-001 is text only; default 3,072 dimensions, recommended 768, 1,536 or 3,072, adjustable from 128 to 3,072 with output_dimensionality using Matryoshka Representation Learning; embedding-2 normalizes automatically, embedding-001 shortened vectors must be normalized; embedding-001 uses task_type and embedding-2 uses prompt prefixes; input limit 8,192 tokens for embedding-2 and 2,048 for embedding-001; multimodal limits of 6 images, 180 seconds of audio, 120 seconds of video and one PDF of up to 6 pages; batch mode at 50% of the embedding price. (Google, )
  • Anthropic does not offer its own embedding model and points to Voyage; voyage-4-large, voyage-4, voyage-4-lite and voyage-code-4 have a 32,000-token context and 1,024 default dimensions with 256, 512 and 2,048 options; voyage-4-nano has open weights under Apache 2.0; input_type query or document; embeddings are normalized; int8 and binary quantization reduce storage 4 and 32 times. (Anthropic, )
  • Ollama: the /api/embed endpoint returns L2-normalized vectors and accepts an array of inputs; embeddinggemma is used as an example; typical dimensions range from 384 to 1,024; use cosine similarity and the same model for indexing and querying. (Ollama, )

What may change

  • Embedding models, default dimensions and prices change with new releases. This page is reviewed quarterly.
  • The per-million-token prices for OpenAI are our conversion of the pages-per-dollar figures OpenAI publishes, at its 800-token page.

Frequently asked questions

What is an embedding in simple terms?

A list of numbers that represents the meaning of a text, image or other input. Inputs with similar meaning get vectors that are close together, so a program can find related items by measuring the distance between vectors instead of matching exact words.

What are embeddings used for?

OpenAI lists search, clustering, recommendations, anomaly detection, diversity measurement and classification. The most common use today is retrieval for chatbots: documents and questions are embedded, and the closest passages are given to the model as context.

How much do embeddings cost?

Very little. OpenAI quotes 62,500 pages per dollar for text-embedding-3-small and 9,615 for text-embedding-3-large, at about 800 tokens per page, which is roughly $0.02 and $0.13 per million tokens. Gemini embeddings cost 50% less in batch mode, and local models through Ollama have no per-token price.

How many dimensions should an embedding have?

Use the model's default unless storage or speed is a problem. OpenAI's models return 1,536 or 3,072 dimensions and Gemini's 3,072, and both can be shortened: Google recommends 768, 1,536 or 3,072. Fewer dimensions save space but can lose some quality.

Can I mix embeddings from different models?

No. Each model places vectors in its own space, so a query embedded with one model cannot be compared with documents embedded by another. Ollama's documentation says to use the same model for indexing and querying, and changing models means re-embedding your data.

Sources

  1. Vector embeddings (OpenAI API guide): models, dimensions, pages per dollar, use cases and limitations, OpenAI. Accessed October 23, 2026.
  2. Embeddings with the Gemini API: models, output dimensionality, task types, normalization and multimodal limits, Google. Accessed October 23, 2026.
  3. Embeddings (Anthropic documentation): Voyage models, context lengths, dimensions and quantization, Anthropic. Accessed October 23, 2026.
  4. Embeddings (Ollama documentation): the /api/embed endpoint, normalized vectors and batch input, Ollama. Accessed October 23, 2026.

Spotted an error or an outdated price? Tell us and we will fix it.

Change history

  • : First published. Checked against OpenAI's embeddings guide, Google's Gemini embeddings guide, Anthropic's embeddings page and Ollama's embeddings documentation on October 23, 2026.

Next review: .

Part of our Language Models Explained guide.

Other topics