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.
Detailed answer & concept explanation~6 min readEverything 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. 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.
- OpenAI's Batch API processes jobs within 24 hours at roughly 50% off the synchronous price for offline workloads.
- Anthropic's Message Batches API offers a discount for asynchronous bulk processing of Claude requests.
- Teams run nightly embeddings backfills and eval suites through batch endpoints to avoid contending with live chat traffic.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy can providers offer batch at roughly half the price?
QHow does batch protect live user latency beyond just cost?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
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.
Same topic, related formats. Practice these next.