Question presented to candidate: "We need to re-classify two million support tickets with an LLM after a taxonomy change, and we also run a nightly eval suite. Someone suggested the provider batch API instead of normal calls. When is that the right choice, how does it work, and what would you watch out for?"
What a strong answer should cover:
- The rule: use a batch API when no person is waiting and a result within hours (up to a 24-hour window) is acceptable: backfills, enrichment, eval runs, offline generation; keep real-time calls for anything interactive
- How it works: a file or list of independent requests, each with a
custom_id; the provider processes them asynchronously; you poll for status and download results, which can come back in any order and with per-request failures - Why it is cheaper: providers price batch work at about half the normal rate (50% off in Anthropic's docs, and in OpenAI's and Google's batch guides as quoted in search results, October 2026) and run it on a separate, larger quota, so it does not eat the rate limits your live traffic needs
- Operational design: join results on
custom_id, never by position; idempotent requests; retry only failed or expired items in a follow-up batch; split work under per-batch limits; plan for jobs that expire unfinished - Related trade-offs: prompt caching can stack with batch discounts on some providers; flex or low-priority synchronous tiers are a middle option; real-time can still be right for small urgent jobs
Clarifying questions expected:
- How fresh must the results be: minutes, by tomorrow morning, or by the end of the week?
- How many requests and tokens, and are they independent of each other, or does one depend on another's output?
- Which provider, and do we already use prompt caching for a shared prefix?
Code / implementation expected: Optional โ building the request file with ids, joining results back, and the cost arithmetic.