Bottom line: Batch APIs advertise roughly half price and deliver it only for work that can wait hours. If your job finishes in under 20 minutes, the batch round-trip on turnaround, retries and partial-failure handling usually costs more engineering time than it saves in dollars.

The claimed 50%

The discount is real and applied at billing. What is not stated is the p50/p99 turnaround: batches complete in minutes when the provider is idle and in 12–24 hours when busy. You do not control which.

Break-even by job size

Same 100k-token job, two paths:

Path Cost Wall time Engineering
Realtime, 8 concurrent 1.00× ~7 min retries, rate limits
Batch 0.50× 20 min – 24 h upload, poll, partial failure

At 100k tokens the saving is a few cents. At 10M tokens it is a few hundred dollars and the extra engineering is obviously worth it. The crossover sits around 1–2M tokens per job, not at 100k.

Partial failure is the real cost

Batches return per-request status. Some succeed, some fail validation, some expire. The client must map results back to inputs, retry failures, and reconcile counts — code you never write for synchronous calls.

1
2
3
4
5
results = {r["custom_id"]: r for r in poll_until_done(batch_id)["results"]}
retry = [i for i, cid in enumerate(custom_ids) if results[cid]["response"]["status_code"] != 200]
for i in retry:
outputs[i] = call_realtime(inputs[i])
assert all(o is not None for o in outputs)

Without that assert, silent holes appear where a batch item expired and nothing noticed.

What belongs in a batch

Backfills of historical rows, nightly re-summarisation, bulk classification of a static corpus, evaluation runs over a fixed set. All have a human to notice a day’s delay and a natural retry window.

Realtime belongs to: synchronous user requests, anything a second request depends on, and jobs under roughly 500k tokens where the dollar saving is smaller than the review cost.

Operational guardrails if you do batch

  • One batch per logical unit, capped at 5k items, so a failure is scoped
  • custom_id carrying the primary key, never an array index
  • A stored manifest of the batch so an expired batch can be rebuilt
  • Alert on batch age > 6 h

The honest summary

Batch is a 50% discount on the token line and a 2–5× increase in the code you have to maintain. Model the total, not the price sheet. If the job is small and hourly, stay synchronous and put the engineering into caching instead — the same 50% with none of the reconciliation.

Designing the measurement

Total cost of a job is a sum, not a line item: tokens at the discounted rate, plus engineering hours to build and maintain the reconciliation, plus the cost of rework when a batch expires. Model the three over twelve months.

1
2
3
4
def total(tokens, price, eng_hours, retry_rate):
api = tokens * price
rework = api * retry_rate * 3 # a retry pass costs three times a clean one
return api + rework, eng_hours * 80

At 100k tokens a job the API line is cents and the rework is invisible; at 20M it dominates everything else.

Boundary conditions

Batch jobs are not resumable mid-flight once a batch expires. If the manifest lives only in memory the whole job is redoable and the failure is silent until a human notices a hole. Store the manifest and the custom_id mapping on disk before acknowledging success.

Rate limits differ per model and per tier; a batch of a premium model routes to a slower queue. Check which model classes accept a 24-hour ceiling before promising the turnaround to anyone.

Failure triage

  1. Batch stuck in validating for hours → usually one malformed line in the JSONL, not provider load
  2. Partial results with expired status → the window closed; rebuild only those ids
  3. Consistent validation failures on one field → schema mismatch across submissions, not the model
  4. Cost higher than modelled → duplicate submissions, check for a retry loop that re-uploads

Rollout

Ship batch behind a flag with a per-job token threshold: under 1M stays synchronous, over 1M goes to batch. That keeps the engineering exposure on the jobs where the money is. Log, per job, which path ran and why — a threshold that flips constantly means it sits in the wrong place.

FAQ

At what job size does the Batch API actually pay off?

The crossover sits around 1–2M tokens per job, not at 100k. At 100k tokens the saving is a few cents, while at 10M tokens it is a few hundred dollars and the extra engineering is worth it. Below that range, the engineering cost of reconciliation outweighs the discount.

Why is partial failure the real cost of batch jobs?

Batches return per-request status, so some items succeed, some fail validation, and some expire. The client must map results back to inputs, retry failures, and reconcile counts — code you never write for synchronous calls. Without an assertion check, silent holes appear where a batch item expired and nothing noticed.

How long does a batch actually take to complete?

Batches complete in minutes when the provider is idle and in 12–24 hours when busy, and you do not control which. The advertised discount is applied at billing, but the p50/p99 turnaround is not stated. A batch of a premium model routes to a slower queue.

What kinds of jobs belong in a batch instead of realtime?

Backfills of historical rows, nightly re-summarisation, bulk classification of a static corpus, and evaluation runs over a fixed set all fit. Each has a human to notice a day’s delay and a natural retry window. Synchronous user requests and anything a second request depends on belong in realtime.

What guardrails should I put in place if I do use batch?

Use one batch per logical unit capped at 5k items so a failure is scoped, and carry the primary key in custom_id, never an array index. Store a manifest of the batch on disk so an expired batch can be rebuilt, and alert on batch age over 6 hours.