Estimate the cost of embedding a whole dataset for search, RAG or clustering.
Embedding APIs bill per token, just like chat models, but there's only input — you pay once to turn each document into a vector. Total cost = total tokens ÷ 1,000,000 × rate. Re-embedding (after chunking changes or model upgrades) means paying again, so estimate before large runs.
The bill follows total tokens, and chunking changes that total more than most people expect. Overlap is the reason: a 200-token overlap on 500-token chunks means 40% of the corpus is embedded twice. Halving the chunk size roughly doubles the number of chunks, and with fixed overlap it more than doubles the tokens embedded.
That is not an argument for large chunks — retrieval quality usually improves with smaller, focused ones. It is an argument for calculating the real token total after chunking rather than from the raw document size.
Embedding the corpus once is often the smallest line item in a retrieval system:
| Cost | When it lands |
|---|---|
| Initial embedding | Once, and it is what this calculator estimates |
| Query embedding | Every search, forever — small per query, unbounded in total |
| Re-embedding | Whenever the model, chunking or preprocessing changes: the full cost again |
| Vector storage | Ongoing, and scales with dimensions as well as chunk count |
| The generation step | Usually the dominant cost in a RAG system — retrieved passages become input tokens on every answer |
A retrieval pipeline that looks cheap at build time can be expensive to run, because the recurring costs are per query rather than per document.
Embedding models differ in output dimensions, and some support shortening the vector at request time. Fewer dimensions means less storage and faster similarity search, at some cost to retrieval quality. Since storage and query latency scale with dimensions across millions of vectors, this is worth testing against your own evaluation set rather than defaulting to the largest available.
Only if retrieval quality is actually a problem. Vectors from different models are not comparable, so a migration is all-or-nothing: the whole corpus has to be re-embedded before anything can be queried. Estimate that full cost here before committing, and compare it against the improvement you measured on real queries.
Substantially, per token — embedding rates are a fraction of chat input rates. The saving in a retrieval system comes from a different place, though: retrieving five relevant passages instead of stuffing fifty documents into the prompt cuts the generation cost on every single query.
Related: Token Counter · LLM API Cost Calculator