Batch Processing
Facts
| Topic | Detail |
|---|---|
| Cost | 50% of standard prices |
| Speed | Processed asynchronously; most batches finish within 1 hour; no latency guarantee |
| Window | Results available when all requests finish or after 24 hours, whichever is first. Batches expire if not complete within 24 hours |
| Size | At most 100,000 requests or 256 MB, whichever comes first |
| Retention | Results available 29 days after creation |
| Request shape | A list of requests, each with a unique custom_id (^[a-zA-Z0-9_-]{1,64}$) and params (the usual Messages parameters) |
| Status | processing_status: in_progress, then ended (also canceling) |
| Per-request result | succeeded, errored, canceled, expired |
| Billing | errored, canceled and expired requests are not billed |
| Ordering | Results can come back in any order; match with custom_id |
| Supported | Vision, tool use (including server tools), system messages, multi-turn, extended thinking, most beta features, mixed request types in one batch |
| Not supported | stream: true, fast mode (speed), max_tokens: 0 (returns a validation error) |
| Caching | Prompt caching works but hits are best-effort (requests run concurrently, any order); use the 1-hour cache duration for shared context |
When to use (design guidance)
Use batches for non-urgent, high-volume work: evaluations, bulk classification or extraction, back-fills, overnight report generation, large-scale content moderation of archives.
Do not use batches for anything blocking (a user waiting, a pre-merge gate that must pass before a deploy step continues, interactive chat) because there is no latency guarantee.
Handling results (design guidance, built on verified statuses)
- Poll
processing_statusuntilended(or use the console), then stream the results. - Process each result by
custom_id: storesucceededoutputs, resubmiterroredrequests (after fixing invalid ones), re-queueexpiredones in a new batch. - Keep your own mapping from
custom_idto the source record. - Combine with structured outputs and validation for extraction at scale (4.3, 4.4).
Exam traps
- Using batches for a latency-sensitive step because of the 50% saving.
- Assuming results arrive in submission order.
- Assuming a result is available instantly or within a fixed time.
- Forgetting that
expiredanderroredrequests need resubmission. - Streaming inside a batch request.
References
- Batch processing — checked Oct 16, 2026
Check your understanding
Nightly re-classification of 200,000 old tickets: batches or real-time?Show answerHide answer
Answer
Batches (split to stay under 100,000 per batch), results matched bycustom_id.A pre-merge check that blocks CI must finish in minutes. Batches?Show answerHide answer
Answer
No; no latency guarantee.How do you match results to inputs?Show answerHide answer
Answer
custom_id; order is not guaranteed.