Embedding dimension is a cost and storage decision
Bigger embeddings can mean better retrieval — but every extra dimension is bytes you store and pay for, forever, across your entire corpus. This calculator separates the one-time embedding API cost (driven by tokens) from the ongoing storage cost (driven by dimension × document count) so you can choose the dimension that balances quality and bill.
How the numbers are built
embed_cost = (docs × tokens_per_doc)/1e6 × embed_price (one-time)
bytes_per_vec = dimension × 4 (float32)
storage_gb = docs × bytes_per_vec / 1e9
storage_cost = storage_gb × price_per_gb (monthly)
The embedding API charges per input token, so the dimension does not change the API price for a given model — it changes how much each resulting vector costs to store and search. At millions of documents, storage and index overhead dwarf the one-time embedding spend.
Tips for choosing a dimension
If your model supports dimension truncation (Matryoshka-style), start small (256 or 512) and only go larger if recall on your own queries demands it. Remember real vector databases add index overhead of 1.5-3x raw vector size, so the storage figure here is a conservative floor — confirm against your provider’s quote before committing at scale.