Skill · Anthropic Claude Platform Documentation
Cut AI processing costs 50% with Claude Batch API
Photo: Google DeepMind on Unsplash
Transform expensive real-time API calls into cost-effective asynchronous batches. The Claude Batch API processes up to 100,000 requests at half the standard token price, perfect for bulk document processing, nightly data extraction pipelines, and large-scale content analysis. Submit once, retrieve results within hours.
The Claude Batch API isn't a separate tool-it's the same Messages API you already use, routed through asynchronous processing. Here's how it works in practice:
Submit a batch containing up to 100,000 independent requests (or 256 MB total payload, whichever limit is hit first). Each request is processed independently on Anthropic's schedule rather than your user request queue. Results return as a downloadable JSONL file, typically within 1 hour but guaranteed within 24 hours. You pay exactly 50% of standard token rates for all input and output tokens-no volume commitments, no contracts.
Consider a real scenario: a legal team needs to extract structured data (dates, parties, key clauses) from 5,000 PDF contracts. Using synchronous API calls at $4 per million input tokens and $20 per million output tokens, that could cost $300–$600 monthly. With the Batch API at $2 per million input and $10 per million output, the same work costs $150–$300. The 50% savings compound across your entire organization. The tradeoff is latency-your results come back hours later, not milliseconds later. This suits nightly ETL pipelines, weekly reporting jobs, and offline enrichment work perfectly.
To implement: package your requests as a JSON array, each with a custom_id for tracking. Post to /v1/messages/batches with your Messages API requests. Poll the batch ID until processing_status reads 'ended'. Download your results. If processing doesn't finish within 24 hours, incomplete requests are marked expired and you're not charged for them. Combined with prompt caching, batch processing compounds your savings-cached reads cost 90% less, then get the 50% batch discount on top.
Sources & credits
Original source: Anthropic Claude Platform Documentation