Message Batches API: cut Claude costs by 50% for work that can wait
TL;DR
The Batch API accepts up to 100,000 requests (or 256 MB) per batch, billed at 50% of standard prices. Most batches finish in under an hour, at most 24 hours; results are kept for 29 days. It stacks with prompt caching.
When to use it
| Good fit | Poor fit |
|---|---|
| Bulk classification / labeling | Real-time user-facing chatbots |
| Summarizing or translating archives | Multi-step agents that need the previous result |
| Running evals, comparing prompts | Anything with a seconds-level deadline |
Python example
import anthropic
client = anthropic.Anthropic()
batch = client.messages.batches.create(requests=[
{"custom_id": f"ticket-{i}",
"params": {"model": "claude-haiku-5-5", "max_tokens": 200,
"messages": [{"role": "user", "content": t}]}}
for i, t in enumerate(tickets)
])
print(batch.id, batch.processing_status) # in_progressOperational notes
- Results come back out of order — always join on
custom_id. - Batches not finished within 24 hours expire; retry failed requests in the next batch.
- Prompt caching stacks with the batch discount, but cache hits are best-effort since requests run concurrently.
- Download results within 29 days; after that only the status remains.