Embedding Cost Calculator
Inputs
| Document Count | 500 |
|---|---|
| Tokens per Document | 1,000 |
| Price (per 1M tokens) | 0.13 $ |
Embedding Cost Calculator
Estimate the one-time cost of embedding a document corpus for retrieval, from the document count, tokens per document, and the embedding model’s per-million-token price.
Inputs
Corpus
Pricing
Results
Enter a value to see results.
Details
Embedding cost explained
Embedding cost is the price of converting a body of text into vectors with an embedding model. Before a retrieval system can answer questions over a collection of documents, it must first turn every document into an embedding — a fixed-length list of numbers that captures its meaning. Embedding APIs meter this work in tokens and bill at a published per-million-token rate, so the cost of preparing a corpus is set by how many documents there are and how long each one is.
How embedding billing works
An embedding model reads text and returns one vector per input. The provider counts the input tokens — the same kind of token used in text generation, roughly four characters of English each — and charges the per-token rate. Because a single token costs a tiny fraction of a currency unit, rates are quoted per one million tokens. Embedding models are typically far cheaper per token than generation models, since they perform a single forward pass and produce no generated output.
The cost is a one-time charge per document. Once a document's vector is stored in a vector database, it does not need to be embedded again unless the content changes or the embedding model is swapped — vectors from different models are not comparable, so changing models means re-embedding the whole corpus.
The formula
With a corpus of documents averaging tokens each, the total token count is
T=ndoc⋅tdocand embedding the corpus at a rate of per million tokens costs
C=106T⋅pThe division by converts the per-million quote into a per-token rate before multiplying by the token count.
Worked example
Suppose a knowledge base holds passages averaging tokens each, embedded with a model priced at $0.13 per million tokens. The total token count is
T=1,800×740=1,332,000 tokensand the embedding cost is
C=1061,332,000×0.13=1.332×0.13≈0.17So embedding the entire corpus costs roughly seventeen cents — a one-time expense paid once when the index is built. Even a corpus an order of magnitude larger stays in the low single digits of currency, which is why embedding is rarely the dominant line item in a retrieval system's budget.
Notes and variations
The figure above covers only the initial embedding of the documents. Three related costs are billed separately: embedding each user query at run time (small, since queries are short), storing the vectors in a vector database, and re-embedding when documents change. Splitting documents into smaller chunks raises the document count but lowers tokens per document, so the product — and therefore the cost — stays close to the raw token total, plus a little overlap.
Application
Embedding cost is the first step in budgeting a retrieval pipeline. The vectors it produces have to be stored and queried, which is the subject of the Vector Database Cost Calculator, and the storage footprint itself depends on the vector dimension and count handled by Vector Database Size Calculator. The generation calls that consume the retrieved context are priced by the Token Cost Calculator.
Frequently Asked Questions (FAQ)
What is an embedding?
An embedding is a list of numbers — a vector — that represents the meaning of a piece of text. An embedding model reads a document and outputs a fixed-length vector, and texts with similar meaning land close together in that vector space. Retrieval systems embed every document once, store the vectors, and at query time embed the question and return the nearest documents.
How do I estimate tokens per document?
As a rule of thumb, one token is about four characters of English, or roughly 0.75 words, so a 1,000-word article is near 1,300 tokens. Code, tables, and non-English scripts tokenize less efficiently and produce more tokens per character. For a precise figure, run a sample of your documents through the provider tokenizer and take the average.
Do I have to pay this cost again?
Embedding is a one-time charge per document as long as the vectors are stored. You pay again only when you add new documents, when content changes and must be re-embedded, or when you switch to a different embedding model, since vectors from one model are not comparable with another. Query-time embeddings of the questions themselves are billed separately and are usually small.
Disclaimer
This is a one-time estimate for embedding the corpus and excludes query-time embedding, vector storage, and re-embedding when content changes. Token counts depend on the model’s tokenizer and the content, and published prices change over time. Verify current rates and token counts with your provider.