Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
You're embedding 1 billion tokens of corpus with OpenAI text-embedding-3-large (sync price: $0.13 per 1M tokens) via the batch API, which gives a 50% discount. Compute the total cost in USD.
$65. 1B tokens at $0.13 per million is $130 sync; the batch API halves it to $65. Still cheap relative to storage and the cost of repeat re-embeddings.
Imagine buying concert tickets in bulk. At the box office window they cost thirteen cents each, but if you mail in your order and let them ship by tomorrow, the price drops to six and a half cents each. You need one thousand tickets. At the cheaper rate that comes to sixty-five dollars total. That is exactly the cost of converting a billion pieces of text into the premium catalog cards using the overnight lane. The bill looks tiny, almost laughable next to a real engineering budget. The expensive part shows up later, when the catalog system gets updated and every single card has to be reprinted from scratch in the new format. That reprint, repeated across years, is where the real money goes, not the original sixty-five dollars.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
2 min: arithmetic walkthrough + sync vs batch pricing + 6.5x cost ratio + Matryoshka truncation + re-embedding cycle multiplier.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Forgetting to apply the batch discount, or applying it to the wrong base price; the sync number is $130, batch is $65.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.