# Batch submit pattern

> Batch processing cuts every token 50% with a 24h SLA and stacks with prompt caching to ~95% off cached async work - same model, asynchronous delivery.

URL: https://bartlomiejkrupa.dev/notes/batch-submit-pattern/
Category: snippet | Updated: 2026-10-07
Summary: Batch processing cuts every token 50% with a 24h SLA and stacks with prompt caching to ~95% off cached async work - same model, asynchronous delivery.

Anthropic and OpenAI batch queues: submit a set of requests, get results within 24 hours (Anthropic: most complete in under an hour), pay half price on every input and output token. Same models, same quality - just async. Batch is not eligible for Zero Data Retention.

The discounts stack: 0.1 (cache-read) × 0.5 (batch) = 0.05 - a 95% discount on most Claude models (Opus 5.5 and Fable 5.1 read cache cheaper still) on a [cache-stable prefix](/notes/cache-stable-prefix) processed asynchronously.

```python
from anthropic import Anthropic

client = Anthropic()

batch = client.messages.batches.create(
    requests=[
        {
            "custom_id": f"ticket-{i}",
            "params": {
                "model": "claude-sonnet-5",
                "max_tokens": 200,
                "messages": [{"role": "user", "content": ticket}],
            },
        }
        for i, ticket in enumerate(tickets)
    ]
)
# Poll client.messages.batches.retrieve(batch.id) until ended,
# then iterate client.messages.batches.results(batch.id).
```

## When it fits

Evaluation runs, nightly classification, content backfills, bulk labeling - anything that is not waiting on a real-time response. Still [trim output](/notes/output-tokens-never-cache); batch does not make prose free.

Worked economics and sibling levers: [Stop paying full price for repeat LLM calls](/articles/llm-cost-optimization).

Sources:
- Batch processing: https://platform.claude.com/docs/en/build-with-claude/batch-processing
- Pricing: https://platform.claude.com/docs/en/about-claude/pricing
- API and data retention: https://platform.claude.com/docs/en/manage-claude/api-and-data-retention
- Batch API: https://developers.openai.com/api/docs/guides/batch
