Batch API (LLM)
Sending many model requests as one job that finishes within hours instead of seconds, usually at a large discount.
A batch API lets you send many model requests as one job that finishes within hours instead of seconds, usually at a large discount. It trades waiting time for price.
Major providers offer batch endpoints for work nobody waits on: classifying a backlog, enriching a catalog, running evals overnight, generating descriptions. You submit the requests as a list or a file and collect results later. Batches also get separate rate limits; they do not suit anything a user is waiting for. On Anthropic’s Message Batches API, as documented in November 2026, batches cost 50% less, most finish in under an hour, unfinished batches expire after 24 hours, one batch holds up to 100,000 requests or 256 MB, and the discount can stack with prompt caching. OpenAI’s Batch API follows a similar model.
Build it like any queue: each request carries your own id so results can be matched, failed items are retried or moved to a dead-letter queue, and evals on a small sample catch a bad prompt before the whole backlog runs. A cost cap limits how much you spend; batching lowers the price of each call.
Sources
- Claude Docs: Batch processing platform.claude.com
- OpenAI: Batch API platform.openai.com
Related terms
- Tokens: The pieces of text models read and write, and the unit you pay for.
- Cost cap: A hard spending limit enforced by your code, per user, per day or per month.
- Prompt caching: Reusing an identical prompt prefix across requests so it is cheaper and faster to process.
- Cost per task (agent unit economics): What one finished agent task really costs: tokens, retries, tool calls and the human time to review it, compared with doing it another way.
- Dead letter queue (DLQ): A separate queue where messages land after failing processing too many times, so they are kept instead of lost or retried forever.
- Evals: A repeatable test set that scores an AI feature, so changes can be measured instead of guessed.
