Prompt Engineering & Structured Output20% of the exam

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.

Official exam objective
Design efficient batch processing strategies

~8 min read · 10 practice questions ·

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_ids, 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

Batch price
Detail
50 percent of standard API prices, input and output
Typical vs maximum time
Detail
Most batches finish within 1 hour; expire if not done in 24 hours
Batch size limit
Detail
100,000 requests or 256 MB, whichever comes first
Oversized batch
Detail
413 request_too_large
custom_id format
Detail
1-64 chars, ^[a-zA-Z0-9_-]{1,64}$, unique within the batch
Result order
Detail
Not guaranteed; match by custom_id
Result types
Detail
succeeded, errored, canceled, expired
Not billed
Detail
errored, canceled and expired requests
One failure
Detail
Does not affect other requests in the batch
Submitted batch
Detail
Cannot be modified; cancel and submit a new one
Client tool call
Detail
Request ends with stop_reason tool_use; your code must send the tool_result
Sources for this section (4)
  • 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?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Claude Certified Architect - Foundations pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 30 lessons of the Claude Certified Architect - Foundations guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Inline practice questions and one-click topic practice (10 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the Claude Certified Architect - Foundations exam

Certifyforce is an independent study resource and is not affiliated with, endorsed by or sponsored by Anthropic. Claude is a trademark of Anthropic.