Canonical: https://botbento.com/blog/batch-api-for-bot-tool-calling-evals/
Format: Markdown representation of the public HTML page.

[Home](/) / [Blog](/blog/)

FIELD NOTES / 5 MIN READ

# Should Your Bot's Tool-Calling Eval Run on Claude or OpenAI's Batch API?

If your bot's tool-calling eval is a pile of independent single-turn test cases, Claude's Message Batches API and OpenAI's Batch API both cut the token bill roughly in half for a 24-hour wait. If your eval is a multi-step agent loop where each turn depends on the last, batching one call at a time defeats the purpose, because each batch entry is a single Messages or Chat Completions request, not a running conversation.

By BotBento Editorial · Published 2026-11-30 · Updated 2026-11-30

AI-assisted editorial: researched and drafted with AI using the primary sources linked below. Check the cited evidence and any stated test scope. Illustrative examples are not measured product results. [Editorial policy](/editorial/).

## In this article

- [The decision](#direct-answer)
- [What the Batch API actually does](#how-batch-mechanics-work)
- [Why a multi-step eval breaks on batch](#single-turn-vs-agent-loop)
- [Illustrative example: grading 500 tool-selection cases](#worked-example)
- [Checklist before you switch an eval to batch](#before-you-switch)[Read as Markdown ](/text/blog/batch-api-for-bot-tool-calling-evals/index.md)

## Key takeaways

- Batch APIs fit one specific eval shape: many independent single-turn test cases that don't need an answer right now.
- A batch entry is one API call. If your test case needs a tool result fed back for a second turn, that's a second request, and chaining those through another up-to-24-hour batch window breaks a multi-step eval.
- Match results by custom\_id, not position, poll instead of waiting on a webhook, and drop streaming parameters before you submit a batch.

## The decision

Route a tool-calling eval to the Batch API when every test case is a single, independent Messages or Chat Completions call: send a prompt, get back either a tool call or a final answer, grade it later with a separate scorer. That's exactly the shape a Message Batch is built for. Anthropic's own batch-processing guide describes it as a way to submit multiple requests together for asynchronous processing instead of one at a time with immediate responses.

Keep a multi-turn agent-loop eval on the synchronous API. A batch entry is a single Messages creation request; the batch endpoint itself is documented as a way to send a batch of Message creation requests, each handled independently. If your eval needs the model to call a tool, receive the tool's output, and keep reasoning in the same turn sequence, that loop doesn't fit inside one batch entry.

Sources: [Batch processing - Claude Platform Docs](https://platform.claude.com/docs/en/build-with-claude/batch-processing), [Create a Message Batch - Claude API Reference](https://platform.claude.com/docs/en/api/messages/batches/create).

## What the Batch API actually does

On Claude's API, once you create a Message Batch it begins processing immediately, and Anthropic documents that batches can take up to 24 hours to complete, though the batch-processing guide adds that most batches finish in under an hour while cutting costs by 50 percent and increasing throughput. Nearly every Messages API feature works inside a batch request, including most beta features, but a small number of parameters, including stream, speed, fallbacks, and max\_tokens: 0, are not supported.

OpenAI's Batch API offers the same trade in its own shape. Compared to the synchronous endpoints, OpenAI's guide lists a 50 percent cost discount, substantially more rate-limit headroom, and completion within 24 hours, often faster. Batch jobs are built from a JSONL file where each line is one request, each with a unique custom\_id you use to match results after completion, and batch usage doesn't count toward your standard per-model request or token rate limits.

Both providers treat an expired batch the same way in spirit: work that already completed is kept and billed, work that didn't finish in the window is dropped. OpenAI's guide states that batches which don't complete in time move to an expired state, unfinished requests are cancelled, completed responses are still written to the output file, and you're charged for the tokens those completed requests consumed.

Sources: [Batch processing - Claude Platform Docs](https://platform.claude.com/docs/en/build-with-claude/batch-processing), [Batch API | OpenAI API](https://developers.openai.com/api/docs/guides/batch).

## Why a multi-step eval breaks on batch

The Message Batches API processes multiple Messages API requests at once, and each one of those requests is a standard, single Messages call. That's fine when the test case is "does the model pick the right tool with the right arguments on turn one." It stops being fine the moment your test case is "does the model call the tool, see the tool's result, and then produce a correct final answer," because that second step is a separate Messages request with the tool result appended to the conversation.

If you tried to run that second step through the same batch mechanism, you'd be submitting a brand-new batch entry and waiting through another window that can take up to 24 hours to complete. A five-step agent trace evaluated this way could, in the worst case, take five separate 24-hour windows to finish scoring one trace. That's not an edge case to work around; it's the batch model doing exactly what it's documented to do; one independent request in, one result out.

The practical split: single-turn tool-selection and argument-correctness checks go to batch. Anything that requires the model to see a tool's actual output before producing a graded answer stays on the synchronous API, where you control the turn-by-turn loop yourself.

Sources: [Create a Message Batch - Claude API Reference](https://platform.claude.com/docs/en/api/messages/batches/create).

## Illustrative example: grading 500 tool-selection cases

Illustrative, not a measured result: say you maintain five tool definitions for a scheduling bot and want to check, across 500 prompts, whether the model picks the right tool and fills in the right arguments on the first turn, with no tool execution required to score it. Each test case is independent and nobody is waiting on an individual reply, which matches the conditions the Batches API is built for.

You'd build 500 requests, each with a unique custom\_id like tool-select-001 through tool-select-500 and the same params shape as a normal Messages call, submit them as one Message Batch, then poll the batch. Claude's retrieve endpoint is documented as idempotent and built to be used for polling Message Batch completion; once the batch ends, you fetch results from the results\_url field the response returns. You'd then run your own scorer against each result, keyed by custom\_id rather than by position in the file.

The cost shape, in round illustrative numbers: if the synchronous version of that 500-call sweep would cost some amount X in tokens, the batch version of the identical requests costs roughly half of X, per the documented 50 percent discount, in exchange for a wait that's usually well under the 24-hour ceiling. The number that matters for your decision isn't the discount, which is fixed, it's whether 500 independent single-turn cases is actually your eval shape, or whether some of those 500 are secretly multi-turn traces disguised as one test case.

Sources: [Batch processing - Claude Platform Docs](https://platform.claude.com/docs/en/build-with-claude/batch-processing), [Retrieve a Message Batch - Claude API Reference](https://platform.claude.com/docs/en/api/messages/batches/retrieve).

## Checklist before you switch an eval to batch

Run through this before moving a tool-calling eval off the synchronous API.

- Confirm every test case is one Messages or Chat Completions call. If a case needs a tool result fed back for a second turn, it's not a single batch entry.
- Strip stream, speed, fallbacks, and max\_tokens: 0 from the batched version of your requests; Claude's batch endpoint doesn't support them even though the synchronous API does.
- Build a polling loop, not a webhook listener, against the retrieve endpoint, and treat it as safe to call repeatedly since it's documented as idempotent.
- Give the scorer the custom\_id, not the row position, to match each result back to its test case.
- Budget for up to 24 hours before you can score a run, even though most batches finish faster, and keep a small synchronous eval path for the cases you need an answer on today.

Sources: [Batch processing - Claude Platform Docs](https://platform.claude.com/docs/en/build-with-claude/batch-processing), [Retrieve a Message Batch - Claude API Reference](https://platform.claude.com/docs/en/api/messages/batches/retrieve).

## Primary sources

Sources checked 2026-11-30. Standards and product documentation can change; follow the linked version when implementing.

- [Batch processing - Claude Platform Docs](https://platform.claude.com/docs/en/build-with-claude/batch-processing) — Anthropic
- [Create a Message Batch - Claude API Reference](https://platform.claude.com/docs/en/api/messages/batches/create) — Anthropic
- [Retrieve a Message Batch - Claude API Reference](https://platform.claude.com/docs/en/api/messages/batches/retrieve) — Anthropic
- [Batch API | OpenAI API](https://developers.openai.com/api/docs/guides/batch) — OpenAI

BotBento is in development. [Suggest a correction](/contact/).
