
Batch APIs from OpenAI, Anthropic, and Google price asynchronous LLM inference at 50 percent off the standard rate. You trade speed for price. You submit a job, the provider runs it when capacity frees up, and you collect the results later. OpenAI promises completion within 24 hours. Anthropic says most batches finish in under an hour. Google lists the same 50 percent cut on its pricing page.
The rule I use is plain. If nobody waits on the answer, batch it. If a user stares at a loading spinner, keep the synchronous endpoint. Offline evals, backfills, classification of stored content, and bulk summarization all belong in batch. Live chat and agent loops do not.
The math stays simple. A workload that costs 1,000 dollars a month on synchronous calls costs 500 dollars on batch, before any other discount. Prompt caching can stack on top of that on Anthropic, which pushes the effective price lower still. Nothing here needs a rewrite of your code. The request format matches the sync API. The change sits in how you submit and collect.
A batch API runs inference later instead of now. You upload a file of requests, one JSON object per line, or you pass a list of requests in a single call. The provider returns a job id. You poll the job status. At the end, you download an output file with one result per request. Each request carries a custom id so you can match results to inputs.
That definition separates batch from two ideas people mix it up with. Client-side request batching packs several prompts into one call to save round trips. Batch APIs do the opposite: each request stays separate, and the provider schedules them on its own clock. Prompt caching reuses prefix tokens across calls to cut input cost. Batch changes when compute runs. Caching changes what you pay for each token. The two discounts stack on Anthropic, and I cover that combination in the stacking section below.
Think of batch as the overnight shift. Synchronous calls rent the model at peak attention. Batch jobs fill the gaps between peak loads, and providers pass part of that saving to you. The 50 percent figure comes from the providers themselves, so treat it as their listed price, not a guaranteed saving on your bill. Your real saving depends on which workloads you move and how much of your traffic can wait.
A batch job moves through four stages. You create it, the provider validates it, it runs, and you download the results. The details differ by provider, but the shape stays the same, and a developer can ship a first job in an afternoon.
Creation starts with the input file. OpenAI accepts up to 50,000 requests in one batch, with the input file capped at 200 MB. Anthropic caps a batch at 100,000 requests or 256 MB, whichever comes first. You also set a completion window. OpenAI accepts a 24-hour window. Anthropic expires a batch if processing does not finish within 24 hours. Give every request a custom id at this stage. Result files do not guarantee order, so the custom id is the safe way to join results back to inputs.
Validation catches malformed requests before the job starts. A bad line in the input file can fail the whole batch on some providers, so validate the file on your side first. A small script that checks each line parses as JSON and carries a custom id saves a wasted round trip.
While the job runs, you poll its status. OpenAI reports stages such as validating, in progress, and ended. Anthropic reports a similar progression toward completion. Poll on a slow interval. A status check every few minutes costs nothing and keeps you out of rate-limit trouble on the status endpoint itself.
At the end of a job, you download two files: the output file and the error file. The output file holds one result per successful request. The error file lists the requests that failed, with a reason per request. Partial success is normal. A batch can end with 98 percent of requests complete and a handful failed, and the error file tells you which ones to retry. Download both files on the day the job ends. OpenAI deletes batch output and error files 30 days after creation by default, with a setting to shorten that window to as little as one hour. Anthropic keeps results available for 29 days after creation.
All three providers price batch at half the synchronous rate. The differences sit in caps, windows, and how batch interacts with rate limits. The table below uses figures from each provider’s own documentation, checked on the day this article was written. Google publishes its 50 percent figure on its pricing page but keeps the batch how-to guide behind sign-in, so its limits stay unverified here and the table says so instead of guessing.
| Feature | OpenAI Batch API | Anthropic Message Batches API | Google Batch API |
|---|---|---|---|
| Discount vs synchronous price | 50% | 50% | 50% (pricing page) |
| Max requests per batch | 50,000 | 100,000 | Not verified in public docs |
| Input file cap | 200 MB | 256 MB | Not verified in public docs |
| Completion window | Within 24 hours | Expires if not done in 24 hours; most finish in under 1 hour | Not verified in public docs |
| Result retention | 30 days by default | 29 days | Not verified in public docs |
| Rate-limit treatment | Not counted toward standard per-model limits | Not subject to ramp limits | Not verified in public docs |
| Batches per hour | Up to 2,000 | Not published as a cap | Not verified in public docs |
Two rows deserve a closer look. OpenAI states that batch jobs do not count toward standard per-model request or token rate limits, which makes batch the clean answer when your synchronous calls hit 429 errors. Anthropic states the same idea from the other side: the Message Batches API is not subject to ramp limits. If your pipeline keeps tripping limits on the sync endpoint, moving the offline share to batch removes that pressure without a support ticket or a tier upgrade. For the synchronous calls that remain, OpenAI recommends exponential backoff with jitter and following the Retry-After header when the response carries one.
Sources for the table: the OpenAI Batch API guide, the Anthropic batch processing docs, and the Google Gemini API pricing page.
Batch fits work where the answer has no deadline measured in seconds. Five kinds of work move over with almost no friction. Offline evals run overnight and the scores wait for morning. RAG backfills re-embed a document store that nobody queries mid-job. Content classification tags stored support tickets, reviews, or images in bulk. Summarization of historical records turns months of logs into readable briefs. Bulk document processing extracts fields from a pile of PDFs or scans.
Four kinds of work stay on the synchronous endpoint. Live chat needs an answer while the user watches. Agent tool loops call the model, act on the result, and call again, so each step blocks the next. Streaming responses exist to show tokens as they arrive, which batch cannot do. Anything with a person waiting on screen belongs on sync, even if the wait is short, because batch adds a queue you cannot control.
Running an offline eval suite overnight is the first batch job I recommend for most teams. Evals already run on a schedule, the results feed a dashboard nobody watches live, and the request volume is large enough that 50 percent off shows up on the invoice at once. It also teaches the team the batch workflow on a workload where a failed job costs an hour, not a customer.
Watch for three failure modes. An expired batch means the provider could not finish inside the window, so split the next batch smaller. Partial success means some requests failed while the rest completed, so retry the ids in the error file instead of resubmitting the whole job. A missing result file means the retention window passed, so download outputs on the day the job ends and archive them in your own storage.
The 50 percent batch discount is one lever. Two more stack beside it, and the combination is where the bill drops hard.
Prompt caching is the second lever. Anthropic states that caching discounts and batch discounts stack. Cache writes cost extra: 1.25 times the base input token price for a five-minute cache, and 2 times for a one-hour cache. Cache reads cost far less than fresh input tokens, and Anthropic reports typical cache hit rates from 30 percent to 98 percent. That range comes from Anthropic with no published methodology, so treat it as the vendor’s own figure. The practical point stands: a batch job that reuses a long shared prefix, such as a system prompt or a retrieved document set, pays the batch rate on tokens that caching already discounted. The KV cache is the mechanism underneath, and it helps to know how it works before tuning cache TTLs.
Model routing is the third lever. An LLM gateway that routes by cost and latency sends each request to the cheapest model that can handle it. Route the easy 80 percent of a batch to a small model and the hard 20 percent to a flagship, and the blended price falls again. Batch and routing combine well because batch jobs give the router a full list of requests up front instead of one request at a time.
Rate limits form the fourth reason to move work to batch, even before price enters the picture. Synchronous calls share per-model limits, and a burst of eval traffic can starve a production chat endpoint. Batch jobs run outside those limits on OpenAI and outside ramp limits on Anthropic, so the offline share stops competing with live traffic. Your LLM observability stack should track cost per million tokens before and after the move, split by sync and batch, so the saving shows up as a number instead of a feeling. The rate-limit guidance behind this section comes from the OpenAI rate limits guide and the Anthropic rate limits docs, with caching detail from the Anthropic prompt caching docs.
One caution on cost math. Coding-tool subscriptions vs metered API spend behave the same way: a discount on paper turns into a saving when the workload fits the discount. Batch saves 50 percent on the requests you move. Requests that cannot wait stay at full price. Measure the share of traffic that can wait before promising a number to anyone.
Batch APIs cut the price of LLM inference in half on all three major providers, and the trade is a wait you control. OpenAI caps batches at 50,000 requests and 200 MB with a 24-hour window. Anthropic caps at 100,000 requests and 256 MB, finishes most batches in under an hour, and keeps results for 29 days. Google lists the same 50 percent cut. Caching stacks on top, routing trims the blend further, and batch jobs sidestep the rate limits that throttle synchronous calls.
Start with one job. Pick a non-urgent workload, ship a 1,000-request pilot, measure cost per million tokens before and after, then add caching and routing to the pilot before rolling batch out wider. Read the companion pieces on prompt caching and LLM gateways next, and check back for the next infrastructure deep dive.