Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Use a batch API for non-interactive jobs that can wait minutes to hours; you trade immediacy for a large discount (often ~50%) and isolation from live serving capacity.
Imagine you can either mail a single letter overnight for full price, or drop a big stack into a bulk service that delivers within a day for half the cost. If you need an answer right now, you pay for speed. If nobody's waiting, you save by letting them handle it whenever they have spare capacity. An LLM batch API is the bulk service. For work where no person is sitting there waiting — processing yesterday's data, scoring a big pile of records overnight — you hand the whole stack over, accept that it comes back later, and pay much less. You only use the instant, full-price option when someone is actually waiting on the reply.
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.
Spend 5-7 minutes framing it as an SLA decision, then cover the discount, capacity isolation, the canonical workloads, and the async retrieval flow.
| Dimension | Real-time endpoint | Batch API |
|---|---|---|
| Latency | Seconds | Minutes to hours (often up to ~24h) |
| Cost | Full per-token rate | Discounted, often ~50% off |
| Capacity | Shares interactive serving pool | Isolated from live traffic |
| Use when | A human or system is waiting | Nothing is waiting on the result |
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.
Running large offline jobs on the real-time endpoint, paying full price and starving live user traffic when batch would be cheaper and isolated.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.