esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

When Do You Use Batch APIs?

When to send AI work as a batch, what it saves, and when it is the wrong tool, explained simply for your AI interview.

In short

Use a batch API when nobody is waiting on the answer: nightly evaluations, labelling a big dataset, or embedding a document store. You send many requests together, collect the answers within about a day, and pay about half the live price.

9 min readIntermediateOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Batch APIs are for work nobody is waiting on. I send many requests together, the provider runs them in its own time, and I collect the answers within a day. Both OpenAI and Anthropic charge about half the live price for it. So I use it for nightly evaluations, labelling big datasets and backfills. Anything a user waits for stays a normal live call.

What is a batch API, in plain words?

A normal AI call is like standing at a counter. You ask, and you wait for the answer before you walk away. A batch API is like handing a pile of forms to a back office and collecting the results when they are ready. You send many requests together, the provider works through them, and you pick up the answers later.

Key words

Live call
One request, one reply, sent back straight away. You wait for it.
Batch job
Many requests sent together, processed later, with the results collected at the end.
Custom ID
Your own label on each request, so you can match its answer to the right input.
Rate limit
The cap on how many requests your account may send in a set time.

Here is a case with real stakes. A bank's support team wants every chat from the day tagged by complaint type, to spot a fault in a payment app. A live call per chat would be slow and cost full price. Running the whole day's chats as one overnight batch gives the same tags, at lower cost, and nobody waits on a screen.

When do you use a batch API?

Use one when the work has no one waiting on it. Typical jobs are nightly evaluations of a model, classifying a large dataset, and embedding a company's whole document store. Both vendors describe the same kind of work, jobs that do not need an immediate response. OpenAI names running evaluations, classifying large datasets and embedding content repositories. Anthropic names large-scale evaluations and data analysis.

  • “The service is ideal for processing jobs that don't require immediate responses.”

    OpenAI

  • “This approach is well-suited to tasks that do not require immediate responses”

    Anthropic

  • Good fit

    Work that can wait

    Nightly evaluations, bulk classification, embedding a document store, or rerunning old data through a new prompt.

  • Poor fit

    Anything a user waits for

    A chat reply, a payment check or a voice call. A batch can take up to a day, which is far too slow for these.

Pick the path with one question

A job from your app

thousands of items, no reply needed now

Does someone wait?

a person or live screen needs it

Live API call

answer in seconds, full price

Batch API job

answer within a day, half price

  1. 1The job goes to the question: does anyone wait for the answer?
  2. 2Yes: a live call, so the answer comes back in seconds.
  3. 3No: a batch, which costs about half and returns within a day.
One question picks the path: does a person or a live screen wait for the reply? If yes, use a live call. If nobody waits, use a batch, which costs about half and returns within a day.

Cost is the main reason. Both OpenAI and Anthropic charge half the standard price for batch work. OpenAI also says batch jobs get more headroom on rate limits than live calls do, which matters when you must push a very large number of requests through.

How does a batch job run, step by step?

Here is a nightly job of 300,000 chats. The size is made up, but a mid-size bank's support team could realistically face it.

  1. 1

    Build the requests

    Write one request per chat, each with its own custom ID and the same tagging instructions. Keep the shared instructions identical so they can be cached.

  2. 2

    Split into batches

    Anthropic caps one batch at 100,000 requests or 256 MB. So 300,000 chats need at least three batches.

  3. 3

    Submit and check

    Send each batch, then check its status now and then. It stays in progress until the provider has finished every request.

  4. 4

    Collect the results

    Match each answer to its chat by custom ID. Each result is succeeded, errored, cancelled or expired.

  5. 5

    Retry the failures

    Send errored rows in a smaller batch. Anthropic says errored requests are not billed.

Tip

If the same long instructions go into every request, ask for a one-hour cache. Anthropic suggests it when processing batches with shared context, because batches can take longer than 5 minutes to process.

A nightly batch, end to end

Day's chat logs

300,000 chats to tag, one request each

Batch of requests

custom ID each, 100k or 256 MB max

Provider runs the queue

no one waits; deadline is 24 hours

Results file

match each answer by its custom ID

  1. 1Split the day's chats into batches under the size cap and send them.
  2. 2The provider works through the queue in its own time.
  3. 3Each answer comes back with its ID, so it is matched to its chat.
A nightly job of 300,000 chats runs as a few batches. Each request has its own ID, the provider works the queue, and the results file is matched back row by row.

What do you give up with a batch?

  • Time

    Results can take up to a day. Anthropic says most batches finish within an hour, but the 24 hours is the promise you plan around.

  • Streaming

    No live stream of words. Anthropic says the results arrive as one file at the end.

  • Chained steps

    Each request is handled on its own, so a later step cannot use an answer from the same batch.

  • Expiry

    A batch that runs past 24 hours expires, so plan a retry for any work it did not finish.

Tip

Ask two questions before choosing: what does the team do with the answer, and by when? If the answer is needed before a meeting in an hour, a batch is the wrong tool.

What does the interviewer want to hear?

A strong answer covers

  • A plain definition: many requests sent together, answers collected later.
  • The test: does a person or a live screen wait for the reply?
  • The cost benefit, with the official discount named.
  • The costs: up to a day, no stream, each request on its own.
  • Practical care: size caps, custom IDs and retries for failed rows.
  • A real example, such as a nightly tagging job at a bank's support team.

Common traps

  • Trap"Batch is always cheaper, so send everything through it."

    BetterCheaper only helps work nobody waits on. A live screen needs a live call, whatever the price.

  • Trap"Batch results will come back in a few seconds."

    BetterPlan around the 24-hour deadline. Most batches finish sooner, but the deadline is the promise.

  • Trap"Just put all 300,000 requests in one batch."

    BetterEvery batch has a size cap. Split the job, and give every request a custom ID so results match.

Can you spot the right design?

Spot the right design

Your nightly job must tag 300,000 chats. Which code is the right design?

Quick check

A chat widget needs an answer in two seconds. A nightly report can take a day. Which setup is right at the lowest cost?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q330How do you handle rate limits and 429 errors?12 min
  2. Q334How do you cut cost on a cloud-hosted LLM workload?13 min
  3. Q314Static vs continuous batching?12 min
  4. Q332Cold starts and autoscaling?14 min
  5. Q345Design single-GPU inference batching.13 min

Learn it in depth

Last updated on 27 November 2026

Running a large AI job on your own data?

I design and build AI systems at work scale, including batch pipelines with size limits, checks and retries. Book a short call and tell me what your data and deadline look like.