# Message Batches API and batch strategy

*Claude Certified Architect - Foundations Study Guide · Prompt Engineering & Structured Output · Last updated October 22, 2026 · https://www.certifyforce.com/study-guide/claude-certified-architect-foundations/prompt-engineering-and-structured-output/message-batches-api-and-batch-strategy*

When the Message Batches API's 50% discount is worth its up-to-24-hour window, how to correlate results by custom_id, resubmit only failed requests, size submission intervals against an SLA, and why client tools cannot run inside a batched request.

- Certification: Claude Certified Architect - Foundations
- Exam section: Prompt Engineering & Structured Output
- Study guide: https://www.certifyforce.com/study-guide/claude-certified-architect-foundations

**Official exam objective:**

> Design efficient batch processing strategies

## What the exam expects

- Match the API to the workflow's latency need: synchronous Messages API for blocking work such as pre-merge checks, the Message Batches API for overnight or weekly analysis.
- Build batch requests with meaningful `custom_id` values and correlate results by `custom_id`, never by position.
- Handle batch failures by resubmitting only the failed `custom_id`s, each with the change its failure needs (chunk oversized documents, resend expired requests unchanged).
- Calculate how often to submit batches so a worst-case batch still meets an SLA.
- Explain why a batched request cannot run your tools mid-request, and design around it.
- Refine the prompt on a sample before batch-processing large volumes.

Key terms: **Message Batches API** (asynchronous processing of many Messages requests at 50% of standard prices); **`custom_id`** (your identifier for each request, echoed on its result); **result type** (`succeeded`, `errored`, `canceled` or `expired`); **processing window** (up to 24 hours before unfinished requests expire); **SLA arithmetic** (submission interval + batch window + downstream time).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Batch price | 50 percent of standard API prices, input and output | [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) |
| Typical vs maximum time | Most batches finish within 1 hour; expire if not done in 24 hours | [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) |
| Batch size limit | 100,000 requests or 256 MB, whichever comes first | [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) |
| Oversized batch | 413 `request_too_large` | [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) |
| `custom_id` format | 1-64 chars, `^[a-zA-Z0-9_-]{1,64}$`, unique within the batch | [Create a Message Batch](https://platform.claude.com/docs/en/api/messages/batches/create) |
| Result order | Not guaranteed; match by `custom_id` | [Retrieve Message Batch results](https://platform.claude.com/docs/en/api/messages/batches/results) |
| Result types | `succeeded`, `errored`, `canceled`, `expired` | [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) |
| Not billed | `errored`, `canceled` and `expired` requests | [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) |
| One failure | Does not affect other requests in the batch | [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) |
| Submitted batch | Cannot be modified; cancel and submit a new one | [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) |
| Client tool call | Request ends with `stop_reason` `tool_use`; your code must send the `tool_result` | [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls) |

## Check yourself

- Why is the Message Batches API wrong for a check that blocks merging?
- When a batched request calls a client tool, what happens?
- What are the per-batch size limits?
- When is it safe to resubmit a failed request unchanged?

## Sources

- [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
- [Create a Message Batch](https://platform.claude.com/docs/en/api/messages/batches/create)
- [Retrieve Message Batch results](https://platform.claude.com/docs/en/api/messages/batches/results)
- [Claude Certified Architect – Foundations Exam Guide v1.0](https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F6nizmqk8tpzpfjvt6qmmav7rh%2Fpublic%2F1783542750%2FClaude+Certified+Architect+%E2%80%93+Foundations+Exam+Guide.pdf)
- [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls)
- [Best practices for Claude Code](https://code.claude.com/docs/en/best-practices)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 10 linked practice questions, and unlimited timed mock exams are included with the Claude Certified Architect - Foundations pack (USD $19): https://www.certifyforce.com/practice-exams
