CCA-F start here · Trap gym · Batch or now?

Batch or now?

The Message Batches API halves the price, and that makes it a trap in both directions. Wrong answers put a job someone is waiting on into a batch that can take a day. Or they pay full price for an overnight report nobody reads until Monday. Ask who is waiting, and the choice is easy.

D4 Prompt Engineering & Structured OutputExam guide 4.5About 15 minutes

At a glance: Use the Batch API at half price only when nobody is waiting and no back-and-forth tool calls are needed; anything someone waits on, like a pre-merge check, calls the API directly.

Start here: the dry cleaner

A dry cleaner offers two services.

Express, while you wait. Full price. The shirt is ready in an hour. If you need it for a meeting this afternoon, this is the only service that helps, at any price.
Bulk, ready within a day. Half price. Drop off a whole bag and collect it tomorrow. They don't promise an hour. And they won't phone you halfway to ask “starch or no starch?”, so everything they need must be written on the ticket.

Claude works the same way. A synchronous call to the Messages API is express: the reply comes back in seconds, and you can go back and forth, so Claude can ask for a tool, your code runs it and sends the result back. The Message Batches API is the bulk service: about half the cost, results within 24 hours, no promise on how fast. Each request gets one reply, with no back and forth, so a batch request can't run a tool loop. Each request has a custom_id, the ticket that matches every result to its request.

One more saving works for both services: don't send the whole wardrobe when one shirt is dirty. If a request carries far more than the job reads, trimming it cuts the cost on either API.

Synchronous: full price, reply in seconds Your code or a person, waiting Claude Messages API Tool loop tool call, result, again request reply Message Batches API: half price, within 24 hours Many requests each with a custom_id Batch queue no promise how fast Results matched by custom_id one reply per request: no tool loop inside a batch
The one question to ask: is anyone waiting on this result?

Words in the question that tell you which side you're on

Now (synchronous)

  • blocking, must pass before merge
  • developers wait, the customer is waiting, live
  • tool calls, agent loop, looks up then decides
  • “within seconds”, “before replying”

Batch

  • overnight, weekly, nightly, quarterly
  • “read on Monday”, “due next week”
  • archive, backfill, re-extract thousands
  • one call each, no tools, “cut the cost”

Try it: run the job both ways

Pick a job, an API and what each request carries. The simulator shows the cost, when the results arrive against when they are needed, and whether the job works at all.

1. The job
2. How you call Claude
3. What each request carries
Cost per run
Results arrive
Does the job work?
When the results are needed (green) and when they arrived (marker):

The prices, token counts and batch times are illustrative, chosen to show the shape (input tokens only, at an example $3 per million standard and half that in a batch). They are not quotes. The batch time is a fixed example for each job, so it repeats when you record; real batches have no latency promise and can take up to 24 hours.

Things to try: PR review + batch, then PR review + synchronous, then switch on trim. Then weekly report + synchronous to see the trap in reverse. Last, support agent + batch: half price, and nothing gets done.

The three traps

TrapWhat the wrong option looks likeWhy it's wrong
Batch for a job someone waits on“Move the pre-merge review to batch for the 50% saving”, “poll the batch every minute”, “batch with a timeout fallback”A batch has no latency promise: up to 24 hours. Polling doesn't speed it up, and a fallback pays twice.
Full price for work nobody waits onRunning a weekly report, a nightly tagging job or a big backfill one live call at a time, or in parallel to finish soonerHalf the cost was available, and the speed you paid for is never used.
Batch for a tool loopMoving an agent that calls tools mid-task into a batch as it isA batch request returns one reply. Claude can't get a tool result back within it. Keep it synchronous, or fetch the data in code first.

And the saving the wrong answers often miss: trimming the request. When most of the tokens are content the job never reads, cutting them saves money on either API without dropping any work.

Practice: three exam-style questions

Answer first, then open “Think it through”.

Rule to remember

Someone waiting → now. Nobody waiting, one call each → batch at half price. Tool loop → not in a batch. Trim what each request carries either way.

Exam guide 4.5: “Message Batches API: 50% cost savings, up to 24-hour window, no latency SLA.” “Good for non-blocking/latency-tolerant (overnight reports, weekly audits); bad for blocking (pre-merge).” “Batch API does not support multi-turn tool calling in a single request.” “custom_id correlates request/response; resubmit only failed docs by custom_id.”

← All traps