How AI embedding costs are calculated
Embedding models convert text into numerical vectors used for semantic search and retrieval-augmented generation (RAG).
Providers charge per token, where one token is roughly 0.75 English words.
To estimate total cost, multiply your document count by average tokens per document to get total tokens, divide by 1,000,000, then multiply by the model's price per million tokens.
For example, embedding 100,000 documents averaging 500 tokens each produces 50 million tokens, costing about $1.00 with OpenAI's text-embedding-3-small at $0.020 per million.
Costs scale linearly with both document count and average document length, so trimming verbose content before embedding directly lowers your bill without hurting retrieval quality.