โก Batch input: 50% discount
Cost / request (batch)$0.0000
๐ Cost comparison
| Metric | Standard API | Batch API |
| Total input tokens | โ | โ |
| Input cost | โ | โ |
| Output cost | โ | โ |
| Total cost | $0.00 | $0.00 |
| Processing time | ~minutes | โค 24 hours (SLA) |
๐ Break-even analysis Batch is cheaper at any volume (input discount always applies).
๐งช Claude Batch API example (Python)
# Install: pip install anthropic
import anthropic
client = anthropic.Anthropic(api_key="your-api-key")
# Create a batch of messages
requests = [
{
"custom_id": "req-001",
"params": {
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello, batch!"}]
}
}
]
batch = client.batches.create(
requests=requests,
processing_window="24h" # batch SLA
)
print(f"Batch ID: {batch.id}")