Safeguard
Developer Tools•

Batch APIs for LLM work: when half price is worth the wait

Batch APIs trade speed for a lower price. See which workloads suit them, the limits to plan around, and how batching combines with prompt caching.

Safeguard Security Team
3 min read

Use a batch API for work nobody is waiting on: evaluations, backfills, bulk classification, nightly summaries. The Claude documentation lists a 50 percent discount, most batches finishing within an hour, and a 24 hour maximum. If a person or a pipeline step is blocked on the answer, use the normal endpoint.

What the documentation states

For the Message Batches API, the docs say:

  • All usage is charged at 50 percent of standard prices.
  • Most batches finish in under an hour, and a batch expires if it is not done within 24 hours.
  • A batch is limited to 100,000 requests or 256 MB, whichever comes first.
  • Results are available for 29 days after creation.
  • Results can come back in any order, so match them using the custom_id field.
  • Each request must set max_tokens of at least 1.
  • Batches are scoped to a workspace.

Other providers offer similar batch products with their own discounts and windows. Read the page for the one you use.

Good fits

  • Running an evaluation set after every prompt change.
  • Re-classifying or re-tagging a backlog of documents.
  • Generating embeddings or summaries overnight.
  • Large scale review jobs where results are consumed the next morning.

Poor fits

  • Anything interactive.
  • Multi step agents where each step depends on the previous result.
  • Work with a hard deadline shorter than 24 hours, since a batch can expire.

Design for partial failure

A batch is a set of independent requests. Some can succeed, some error, some expire. Store the custom_id for each item in your own database before submitting, then reconcile. Resubmit only what failed, in a new batch.

Combine batching with caching

The docs say the discounts from caching and batching stack, but cache hits in batches are best effort because requests run asynchronously and concurrently. They report typical hit rates between 30 and 98 percent depending on traffic. To improve your odds:

  1. Put identical cache_control blocks in every request.
  2. Keep requests flowing so entries do not expire.
  3. Share as much prefix as possible across requests.
  4. Consider the one hour lifetime, since batches can take longer than five minutes.

Cost control

Batches make spend lumpy, so budget for them separately from interactive traffic.

Each batch is a large, fast spend. Test a batch of ten items first, read the usage on the results, and multiply before submitting 100,000. Keep the sample in the same workspace so its usage is easy to find in reports. Set a workspace spend limit so a mistake has a ceiling.

Quick check

Can I rely on a batch finishing in an hour?

No. The docs say most finish within an hour, but the guarantee is the 24 hour expiry. Processing can slow with demand and volume.

Does batching change the output quality?

The documentation presents it as the same requests processed asynchronously at a lower price. Verify on your own evaluation set before moving production traffic.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.