API Features & Capabilities

Message Batches API: Submitting, Polling, and Retrieving Bulk Jobs

For work that can wait an hour, Anthropic's Message Batches API halves the price of every token. Here is the full lifecycle — and which platforms actually offer it.

Claude 3P 101 · Updated July 2026 · Unofficial guide

Plenty of enterprise workloads have no user waiting on the other end: nightly document classification, content migration, evaluation runs, bulk summarization. The Message Batches API exists for exactly this shape of work. You submit up to 100,000 Messages requests (or 256 MB, whichever comes first) as one batch, the platform processes them asynchronously — most batches finish in under an hour — and every token is charged at 50% of the standard price. Opus 4.8 drops to $2.50/$12.50 per million input/output tokens; Haiku 4.5 to $0.50/$2.50.

Step 1: create the batch

A batch is an array of requests, each with two fields: a custom_id you choose (1–64 characters, letters, digits, underscores, and hyphens) and a params object containing an ordinary Messages API request. The custom_id is how you match results back to inputs later, because results are not guaranteed to arrive in submission order.

from anthropic import AnthropicAWS  # needs AWS_REGION + ANTHROPIC_AWS_WORKSPACE_ID

client = AnthropicAWS()
batch = client.messages.batches.create(requests=[
    {"custom_id": "doc-001",
     "params": {"model": "claude-haiku-4-5", "max_tokens": 512,
                "messages": [{"role": "user",
                              "content": "Classify this ticket: ..."}]}},
])
print(batch.id, batch.processing_status)  # -> in_progress

Batched requests support almost everything the synchronous API does — vision, tool use including server tools, system prompts, multi-turn conversations, extended thinking. What they reject with a validation error: stream: true, fast mode, and a handful of other synchronous-only options; every request also needs max_tokens of at least 1.

Step 2: poll for completion

Retrieve the batch by ID and watch processing_status: it starts as in_progress and becomes ended when all requests are resolved. Batches that don't finish within 24 hours expire, and expired requests are not billed. You can also cancel a running batch — it moves through canceling to ended, and partial results for already-processed requests may still be available. Batches are scoped to a Workspace, so any API key in that workspace can view them.

Step 3: retrieve results and handle per-request errors

When the batch ends, fetch its results_url, which streams a .jsonl file — one result per line, each tagged with your custom_id and a result type:

Result typeMeaningBilled?
succeededContains a full Message responseYes
erroredThat one request failed — fix and resubmit it aloneNo
canceledBatch was canceled before this request ranNo
expiredNot processed within 24 hoursNo

Because errors are per-request, one malformed entry never sinks the batch — your retry logic can collect the errored lines and resubmit just those. Results stay downloadable for 29 days after creation; after that the batch is still viewable but the output is gone, so persist results promptly.

Cost tip: batch and prompt-caching discounts stack. Since batches routinely run longer than 5 minutes, use the 1-hour cache TTL on shared context. Also note batches can slightly exceed a workspace's configured spend limit due to concurrent processing.

The platform question

This is where 3P buyers need to read carefully. Anthropic's Message Batches API is available on the first-party Claude API and on Claude Platform on AWS — and not on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. That does not mean those clouds lack batch options: AWS and Google Cloud each offer their own cloud-native batch inference for Claude (S3-based on Bedrock; BigQuery/GCS-based on Vertex AI, also at 50% batch pricing). Those are different mechanisms with different tooling, not the endpoint described here. See batch platform availability and the Bedrock workaround guide for the alternatives.

Where to go next

Compare approaches in batch vs realtime, and use token counting to size a batch before you submit it. The feature matrix tracks current availability.

Sources