Formula: Embedding API Cost Calculator
- : Documents
- : Chunks per document
- : Average tokens per chunk
- : Embedding rate per million tokens
Estimate full re-index and recurring embedding spend from document volume and chunk size.
Estimate one full indexing run using an entered $0.10 per million token rate.
No. It estimates embedding API usage only. Storage and retrieval costs need separate inputs.
The monthly figure is the cost per run multiplied by runs per month, so zero runs gives zero. The first build still costs money. Read the cost per full indexing run line, which stays at $4.00 for the default corpus, and treat that as the one-off launch cost before any monthly spend begins.
Yes. The provider bills every token you send, so repeated text at chunk boundaries is billed each time it appears. If you set a chunk size and an overlap in your splitter, the tokens actually sent per chunk are what belong in this field. Measuring a sample after chunking is the easiest way to get it right.
Not if the total text stays the same. Twice as many chunks at half the size adds up to the same token count, and the default still shows 40,000,000 tokens and $4.00. Smaller chunks can raise costs indirectly through more overlap and more vectors to store, but the API charge for one pass depends on total tokens.
Run the calculator a second time with queries in place of documents. Enter monthly query volume as Documents, 1 chunk per document, your average query length as tokens per chunk, and 1 run a month. Queries tend to be short, but high traffic can still make this line significant, so it is worth adding to the indexing estimate.
Multiply the per-thousand price by a thousand to get the price per million, then enter that. Getting this wrong produces a result a thousand times too low or too high. A quick check: at the default rate, a run of 40,000,000 tokens should cost forty times the per-million rate, which is $4.00.
Embedding prices change and differ by provider, model and contract. The page takes the rate you enter so the estimate matches the price you actually pay. The default of 0.1 per million is only a starting value. Copy the figure from your provider's current price list or your latest invoice before using the result.
Switching models means every stored vector must be regenerated, because vectors from different models cannot be compared. Use the cost per full indexing run at the new model's rate. Then add the ongoing monthly cost at that rate. If you plan to run both indexes side by side for a while, count both sets of updates during the overlap.
Yes. A quarterly full rebuild is about 0.25 runs a month, and with the default corpus that gives $1.00 a month. A rebuild every two months is 0.5. This spreads an occasional large job across a monthly budget. The per-run line still shows the full cost you pay on the month it actually happens.
The result is rounded to cents. One document of eight 500-token chunks is a few thousand tokens, which costs a small fraction of a cent at the default rate. The tokens line still reports the real volume. For small tests, compare token counts rather than the cost line, or scale the inputs up to a realistic corpus size.
Whether a failed request is billed depends on the provider, but a request you resend that then succeeds is billed again. This page counts each token once per run. If your pipeline retries often, or you run repeated tests while tuning chunking, add a margin on top of the monthly figure.
Look at re-index frequency first. In the default, four full runs a month cost $16.00 while one costs $4.00, so embedding only changed documents usually saves more than any other change. After that, check for overlap and repeated metadata inflating tokens per chunk. The rate itself depends on which model you choose, which also affects search quality.
The default describes a modest search index. There are 10,000 documents, each split into 8 chunks, and each chunk averages 500 tokens. The embedding rate is 0.1 per million tokens, and the whole corpus is embedded once a month.
Multiply the three volume inputs and you get the first supporting line: 40,000,000 tokens per indexing run. Divide by one million and multiply by the rate, and one full run costs $4.00. With one run a month, the headline monthly embedding cost is also $4.00.
Those figures are easy to check by hand, and it is worth doing once. Ten thousand documents times eight chunks is eighty thousand chunks. Eighty thousand chunks at 500 tokens each is forty million tokens. Forty million is forty lots of a million, and forty times 0.1 is 4.
The rate in the default is a placeholder, not a price taken from any provider. Replace it with the rate on your own provider's pricing page or invoice before using the result for a budget.
Every input in this calculator multiplies the others, so the answer moves in proportion. The Lower preset drops the corpus to 6,000 documents and the run shrinks to 24,000,000 tokens, costing $2.40. The Higher preset raises it to 15,000 documents, giving 60,000,000 tokens and $6.00.
That straight-line behaviour is useful for planning. If you expect the corpus to grow by half over a year, the embedding bill for a full run grows by half too. There are no tiers, minimum charges or volume discounts in the formula, so any of those in your contract will need to be applied separately.
It also means one wrong input moves the whole answer by the same factor. An estimate of tokens per chunk that is double the truth doubles the cost. That is why the token count deserves the most care.
A quick way to use this is to run the default once with your real chunking and rate, then treat the result as a cost per ten thousand documents. In the default that is $4.00 per run. A corpus five times larger costs five times as much per run, and you can work that out without touching the form again.
For the cost of a single pass, what matters is total tokens, not how they are divided. Halve the chunk size and double the chunks per document and the run still comes to 40,000,000 tokens and $4.00. The calculator confirms this: sixteen chunks of half the size gives exactly the default figure.
Chunk size does matter for search quality and for the vector store, since more chunks means more vectors to hold and search. Those effects sit outside this page. The embedding API bill itself is driven by tokens.
Overlap is the exception that catches people out. Many chunking setups repeat some text at the edge of each chunk so a sentence is not cut in half. That repeated text is embedded twice and billed twice. If your chunks overlap by a fifth, the tokens you send are a fifth higher than the token count of the source documents, and so is the cost. Enter tokens per chunk including the overlap, not the raw document length divided by chunks.
The chunks field accepts decimals, which helps when documents vary in length. Enter 2.5 chunks and the tokens line uses 2.5 exactly, although the sentence under the result rounds it to 3 for display.
The last input, full re-indexes per month, is the one that turns a one-off cost into a recurring one. With the default corpus, four full runs a month raises the monthly cost to $16.00 while the cost per run stays at $4.00.
Fractions work too. A full re-index once a quarter is roughly 0.25 runs a month, and the default then shows $1.00 a month. That is a fair way to spread a periodic rebuild across a monthly budget.
Setting the field to zero shows a monthly cost of $0.00. The cost per full indexing run line still reads $4.00, and that is the figure you need for the first build. A new index has to be embedded once before anything else, so read the per-run line for the launch cost and the monthly line for ongoing spend.
Before setting a high re-index count, ask whether the whole corpus really changes. If you switch embedding models, every vector has to be regenerated, and a full run is unavoidable. If only some documents are edited, re-embedding the changed ones costs far less.
The page assumes every re-index embeds every document. Most production pipelines do not work that way. They track which documents were added or edited and embed only those.
You can model that with the same fields. Leave the main estimate as it is for the initial build, then run the calculator a second time with Documents set to the number of new or changed documents per month and re-indexes set to 1. The monthly figure from that second run is your ongoing update cost.
For example, if 6,000 documents a month were new or edited, the Lower preset already shows the answer: 24,000,000 tokens and $2.40 a month at the default rate and chunking. Add the occasional full rebuild, if you plan one, as a fraction of a run in a separate estimate.
Be honest about what counts as changed. If an edit to one paragraph causes your pipeline to re-chunk and re-embed the whole document, the full document's tokens are billed, not just the edited part. Some pipelines compare chunk hashes and skip unchanged chunks, which brings the cost closer to the size of the edit. Which one you have makes a large difference to the monthly figure, so check the pipeline before choosing the number to enter.
Tokens are not words. A token is a piece of text as the model's tokenizer splits it, and the ratio of tokens to words varies with language, formatting and the tokenizer itself. Code, tables, URLs and non-English text often produce more tokens per word than plain English prose.
The reliable method is to measure. Take a sample of real documents, run them through your chunker, and count the tokens in each chunk with the tokenizer for the embedding model you plan to use. The average of that sample is the number to enter. Then count the chunks each document produced to get the chunks per document figure.
If your chunker caps chunks at a fixed size, do not simply enter the cap. The last chunk of each document is usually shorter, so the true average sits below the limit. For a corpus of short documents, the difference can be large.
Metadata is another quiet addition. If your pipeline prepends a title, a section path or other fields to each chunk before embedding it, those tokens are billed on every chunk. With 8 chunks per document, a short header repeated on each one adds up quickly, so include it in the sample you measure.
The rate field is priced per million tokens. Some price lists quote per thousand tokens instead. A per-thousand price has to be multiplied by a thousand before you enter it here, or the result will be a thousand times too small.
The currency selector changes the symbol on the result, not the maths. Enter the rate in the same currency you want displayed. At a rate of 0.02 per million, the default corpus costs $0.80 a run, which shows how much the choice of model can matter even for a small index.
Very small jobs can round to nothing. A single document of eight 500-token chunks costs a fraction of a cent at the default rate, so the page shows $0.00. That is display rounding, not a free job; the tokens line still shows the real volume.
The headline covers indexing only. A search system also embeds every user query so it can be compared with the stored vectors. Those query embeddings are billed at the same kind of rate, and at high traffic they can rival the indexing bill.
You can estimate them here too. Enter the monthly number of queries as Documents, 1 as chunks per document, the average query length in tokens, and 1 re-index a month. The result is your monthly query embedding cost.
Vector database storage, search charges and the language model that reads the retrieved chunks are separate costs. The RAG Pipeline Cost Calculator linked from this page takes the monthly figure from here as one of its inputs. Failed requests that are retried, and any test runs while tuning the chunker, add tokens that this page does not count, so leave some headroom in a budget.