# Batch API

> Canonical: https://skillalmanac.com/glossary/batch-api | Last verified: 2026-11-25 | Index status: index-eligible

A Batch API accepts groups of independent model requests for asynchronous processing and later retrieval. OpenAI calls its product Batch API; Anthropic calls its product Message Batches API.

Also called: OpenAI Batch API, Message Batches API.

## In plain language

A Batch API is useful when many requests can wait, such as an evaluation or bulk classification job. You submit independent requests, monitor the asynchronous job, and retrieve results after processing. It is unsuitable for a request path that needs an immediate answer. Costs, throughput, limits, storage, completion windows, supported request types, and result formats are provider-specific and should be checked before each implementation.

## Technical definition

OpenAI’s Batch API uses a JSONL input file whose lines contain a unique custom_id, HTTP method, endpoint URL, and request body, then exposes output and error files. Anthropic’s Message Batches API accepts requests with unique custom_id values and standard Messages parameters, processes them independently, and exposes results after processing. The identifiers let an application associate returned records with submitted work; no input-order guarantee is asserted here.

## How it shows up when you use agents

A Batch API is an asynchronous execution mode for many independent model requests. It fits work such as an evaluation set, bulk classification, repository embedding, or a collection of document analyses when no user is waiting for each individual response. It does not fit a request path that must return an immediate conversational answer, although a developer may still submit or monitor a batch while working in an interactive session.

The two cited products have different contracts. OpenAI documents a JSONL input file, a batch job, status checks, and output or error files. Anthropic documents a Message Batch containing independent Messages requests, status polling, and later result retrieval. Both require a unique `custom_id` for each submitted request. Use that identifier to associate a result with your own record; this entry does not assert a cross-vendor guarantee about result order.

Before choosing batch processing, divide the workload into work that can wait and work that cannot. Then inspect the current provider documentation for completion windows, supported request types, limits, storage behavior, rate limits, and pricing. These are product settings, not permanent properties of the general concept. Prompt caching may be available alongside batch processing under provider-specific rules, but it is a separate mechanism and should be evaluated separately.

## Common confusions

- **Batch API versus streaming.** Streaming returns portions of one response as they become available. A Batch API accepts many requests for asynchronous processing and later collection.
- **Batch API versus a larger prompt.** Combining tasks in one prompt creates one model request. A batch contains separate requests that are processed independently.
- **Batch API versus batch size.** [Batch size](/glossary/batch-size) is the number of examples or requests processed together by a training or inference implementation. A Batch API is a provider-facing job interface for asynchronously submitted requests.
- **Batch processing versus rate limits.** Providers document different limit models. OpenAI describes queued-token capacity separate from standard per-model limits, while Anthropic documents limits on batch HTTP requests and requests waiting for processing.
- **Batch processing versus guaranteed savings or timing.** Vendor pages may state current discounts, throughput, or completion windows. Treat those as changeable product terms and confirm them before budgeting or designing a deadline-sensitive workflow.

## Worked examples in this catalogue

### [llm-cost-estimator](https://skillalmanac.com/skills/skill-almanac/llm-cost-estimator)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A calculator that applies a user-supplied, dated price table to an LLM usage profile, including an optional batch share.

Why it exercises the concept: It can compare batch-eligible and synchronous workload shares without embedding fixed prices. It performs cost arithmetic only; it does not submit, monitor, or validate a provider batch.

## Related terms

- [Inference](https://skillalmanac.com/glossary/inference.md)
- [Rate limit](https://skillalmanac.com/glossary/rate-limit.md)
- [Inference cost](https://skillalmanac.com/glossary/inference-cost.md)
- [Prompt caching](https://skillalmanac.com/glossary/prompt-caching.md)
- [Batch size](https://skillalmanac.com/glossary/batch-size.md)

## Sources

- [Batch API guide](https://developers.openai.com/api/docs/guides/batch), OpenAI (accessed 2026-11-25)
- [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing), Anthropic (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
