Batch inference is an asynchronous AI API workflow where you submit many model requests together, wait for queued processing, and collect results later, often within 24 hours. Trading live latency for flexible scheduling gives you higher throughput and, on OpenAI, Anthropic, and Google Gemini as of November 27, 2026, a 50% discount.
When I audit production AI pipelines, synchronous API calls often account for work that nobody is watching in real time. Moving those offline workloads onto an asynchronous AI API cuts token spend and keeps background jobs from colliding with live user traffic.
What Is Batch Inference and How Does It Differ From Real-Time Calls?
Batch inference (also called a Batch API, batch processing, or, in some Google documentation, batch prediction) is a method for submitting a large set of model requests for asynchronous, queued execution instead of waiting for each response over a live connection. In a standard synchronous API call, your application sends one prompt, holds the HTTP connection open, and waits seconds for a complete payload or a live token stream.
Offline inference removes that real-time wait. You package hundreds or tens of thousands of independent prompts into a single job, hand the job to the provider’s scheduler, and check back later to download the output file. Because the provider never has to reserve low-latency compute for a user waiting on a screen, a batch API trades immediate response speed for larger job sizes, higher throughput, and separate rate-limit handling.
Live API traffic is governed tightly by per-minute request and token ceilings. If you want to see how synchronous throttling behaves under load, our guide to AI API rate limits breaks down RPM and TPM constraints in detail. Batch processing sidesteps much of that live contention because the platform processes requests asynchronously in the background.
| Dimension | Real-Time Synchronous API | Batch Inference (Batch API) |
|---|---|---|
| Request model | One request per HTTP call | Thousands of requests grouped in one job |
| Response delivery | Immediate payload or live token stream | Output file or downloadable batch results |
| Typical turnaround | Seconds | Often under 1 hour to 24 hours (plus queue time on some services) |
| Rate-limit pool | Standard live RPM and TPM limits | Separate batch pool, shared pool, or higher batch limits |
| Streaming support | Supported (stream=true) |
Not supported for live token streaming |
| Pricing (verified vendors, Nov 27, 2026) | Standard published token rates | 50% off standard API rates on OpenAI, Anthropic, and Google Gemini |
How Does a Batch API Workflow Actually Work?
A batch API workflow follows a four-step asynchronous loop: package requests, upload or submit the batch, poll job status, and retrieve completed results. Unlike synchronous calls where your code receives the answer in the same HTTP transaction, batch processing separates submission from collection.
- Format the input requests. On OpenAI, you create a
.jsonlfile where every line holds one request to a single model along with a uniquecustom_idso you can match outputs back to inputs. On Anthropic, you assemble an array of Messages API requests. On Google Gemini, you prepare request batches or Cloud Storage files that meet the service’s format validation rules. - Submit the batch job. You send the file or request list to the provider’s batch endpoint. The provider validates the job structure and places the work into its asynchronous processing queue.
- Poll status while the job runs. Your application periodically checks the job status endpoint rather than holding an open socket. Depending on queue saturation and batch size, jobs finish anywhere from under an hour to the provider’s 24-hour processing limit.
- Download outputs and reconcile failures. Once the batch finishes or expires, you download the results file. Completed items return model outputs alongside their request identifiers, while any uncompleted or expired requests can be retried in a subsequent job.
Live response streaming does not apply to batch workflows. Anthropic explicitly disallows stream: true because batch outputs return as a single downloadable file rather than a stream, and OpenAI likewise does not return live streamed responses from batch jobs.
Why Do Cloud Vendors Offer a Batch Discount?
Cloud AI providers discount asynchronous jobs because queued workloads can be scheduled, batched, and packed onto GPUs more efficiently than unpredictable real-time traffic. Live user requests arrive in sharp daytime spikes, forcing infrastructure teams to keep spare capacity warm so latency stays low. Offline inference fills valleys in cluster utilization and lets the provider run parallel requests at its own pace over a multi-hour window.
As of November 27, 2026, three major model providers offer a verified 50% batch discount compared with their standard synchronous APIs:
- OpenAI Batch API provides a 50% cost discount compared to synchronous APIs.
- Anthropic Message Batches API charges 50 percent of standard API prices on both input and output tokens.
- Google Gemini batch inference runs at a 50% discounted rate compared to real-time inference.
Batch inference does not carry a single universal SLA or price cut across every vendor in the market. Not every cloud provider publishes a 50% reduction, and separate products inside the same cloud ecosystem follow different billing models. Classic Google Cloud AutoML batch prediction node-hour tables, for instance, are a different product from Gemini batch inference. For broader context on balancing batch queues against caching and model routing, see our guide on how to reduce AI API costs and our AI API pricing comparison.
Comparing Official Batch API Limits and Terms as of November 27, 2026
Each major provider documents its own request caps, file size ceilings, retention periods, and expiration rules for asynchronous jobs as of November 27, 2026. Knowing these limits up front prevents failed uploads and unexpected queue expirations when scaling a pipeline.
| Provider & Product | Verified Batch Discount | Max Requests / File Size | Processing Window & Queue | Retention, SLA & Caching Notes |
|---|---|---|---|---|
| OpenAI Batch API | 50% off synchronous API rates | 50,000 requests; 200 MB .jsonl file |
24h completion window | Up to 2,000 batches/hr; separate Batch/Background Rate Limit pool |
| Anthropic Message Batches API | 50% of standard API prices | 100,000 requests or 256 MB | Most finish in under 1 hour; 24h expiration | Results kept 29 days; best-effort prompt caching combines with batch discount |
| Google Gemini Batch Inference | 50% off real-time inference | 200,000 requests; 1 GB Cloud Storage file | Up to 72h in queue; 24h run time after start | Not a Covered Service / no SLA SLO; explicit caching and RAG unsupported |
OpenAI Batch API
OpenAI’s Batch API targets asynchronous request groups that do not need immediate answers, offering 50% lower token prices, a separate rate-limit pool, and a 24h turnaround window as of November 27, 2026. You submit a .jsonl input file containing requests for a single model, and each line must include a unique custom_id. Supported endpoints documented on the official guide include /v1/responses, /v1/chat/completions, /v1/embeddings, /v1/completions, /v1/moderations, /v1/images/generations, and /v1/images/edits.
Each batch supports up to 50,000 requests and an input file up to 200 MB, while /v1/embeddings batches are also capped at 50,000 embedding inputs across the batch. Organizations can create up to 2,000 batches per hour. Batch API jobs do not count against standard per-model request or token rate limits, and OpenAI states the Batch API currently has no output-token limit. Instead, batch jobs share a Batch/Background Rate Limit pool with Background mode requests using 2h or 8h completion windows, with exact queued token caps visible in organization settings.
OpenAI lists batch rates separately on its pricing page. For flagship models sampled on November 27, 2026, batch input and output prices were half the standard rates, such as gpt-6.2-astra short-context pricing at $4.00 per 1M input tokens and $20.00 per 1M output tokens in batch versus $8.00 and $40.00 in standard mode. Always check the official OpenAI pricing page before budgeting a run. If a batch misses the 24h window, it transitions to an expired state, unfinished requests are cancelled, completed responses remain downloadable, and you are billed only for tokens consumed by completed requests.
Anthropic Message Batches API
Anthropic’s Message Batches API processes large volumes of Messages requests asynchronously at 50 percent of standard API input and output prices as of November 27, 2026. A single Message Batch holds up to 100,000 Message requests or 256 MB, whichever limit is reached first, and every active Claude model supports batch processing. Almost any Messages API feature works inside a batch, including vision, tool use, system messages, multi-turn conversations, extended thinking, and most beta features.
According to Anthropic’s official documentation, most batches finish in less than 1 hour, and results become available once all messages finish or after 24 hours, whichever comes first. Batches are scoped to a Workspace, expire if processing does not complete within 24 hours, and retain downloadable results for 29 days after creation. After 29 days, you can still view the batch metadata, though the output file can no longer be downloaded.
Rate limits still govern Batches API HTTP requests and queued items waiting inside a batch, so heavy demand can slow processing and increase 24-hour expirations. Anthropic also allows prompt caching inside Message Batches and lets prompt caching and batch discounts stack, though cache hits are best-effort because requests execute concurrently in arbitrary order.
Google Gemini Batch Inference
Google Gemini batch inference (formerly known as batch prediction) provides asynchronous, high-throughput processing at a 50% discounted rate compared to real-time inference as of November 27, 2026. Official documentation also notes implicit caching discounts on certain Gemini models with stacking rules that depend on the model generation, specifically differing between Gemini 2.5 and Gemini 3 and later, so check the current Google pricing page rather than assuming additional discounts beyond the 50% batch rate.
A single Gemini batch job accepts up to 200,000 requests, or up to a 1 GB input file when reading from Cloud Storage, while embedding models carry different request limits. There are no predefined quota limits on usage because capacity comes from a shared pool, though saturated periods push jobs into a queue for up to 72 hours before expiring. Once a job begins executing, most jobs finish within 24 hours, and any work still incomplete after 24 hours is cancelled with billing applied only to completed requests.
Google explicitly notes that Gemini batch inference is not a Covered Service and is excluded from the Service Level Objective (SLO) of any Service Level Agreement (SLA). Unsupported features include Provisioned Throughput, explicit caching, and RAG. Google also advises combining smaller workloads into larger batches within the 200,000-request cap: one job of 200,000 requests delivers higher throughput than 1,000 jobs of 200 requests each, and jobs smaller than 1,000 requests incur unnecessary fixed per-job overhead.
Which AI Workloads Fit Batch Inference and Which Should Stay Real-Time?
Deciding between batch and synchronous execution comes down to whether a human or downstream system is actively waiting for the answer. Whenever latency can be measured in hours instead of seconds, offline inference delivers cleaner throughput and lower costs.
Good-Fit Offline Jobs
Offline batch queues excel at high-volume, non-urgent processing where prompts are already known up front:
- Model evaluations and benchmarks. Running prompt regressions, rubric scoring, or LLM-as-a-judge eval suites across thousands of test cases overnight.
- Large-scale classification and moderation. Tagging support tickets, annotating datasets, or screening large content backlogs for policy compliance.
- Corpus embeddings. Indexing document repositories, product catalogs, or knowledge bases before deploying search updates.
- Bulk document extraction and summarization. Translating, summarizing, or pulling structured fields out of archived PDFs and logs.
- Bulk content generation. Producing product descriptions or article summaries for scheduled publishing pipelines.
Poor-Fit Interactive Tasks
Synchronous real-time calls remain essential whenever response delay breaks the user experience or workflow dependency:
- Interactive chat and copilots. Any interface where a person types a message and expects streamed tokens within a second.
- Live tool-calling agents. Multi-step workflows that must inspect a model response immediately to trigger an API call, database query, or UI update.
- Human-in-the-loop approvals. Review queues or editing assistants where an operator sits idle waiting for a single draft.
Common Failure Modes and Edge Cases to Plan For
Even when a workload fits offline processing, batch pipelines introduce operational failure modes that differ from live API error handling. Designing for expiration, partial completion, and provider-specific constraints avoids silent data gaps.
First, build idempotent retry logic for expired or cancelled jobs. On OpenAI and Google Gemini, hitting the 24-hour execution limit cancels remaining work while returning and billing you for completed requests, and Google jobs can expire before starting if they sit in a saturated queue for 72 hours. Your pipeline needs to diff the returned custom_id or request keys against the original input set and resubmit only the missing items.
Second, account for feature and batching boundaries before migrating synchronous code. OpenAI restricts every .jsonl file to a single model, Google Gemini excludes Provisioned Throughput, explicit caching, and RAG from batch jobs, and Anthropic delivers prompt cache hits only on a best-effort basis due to out-of-order concurrent execution. On Google Gemini, consolidating small runs into batches of at least 1,000 requests also avoids fixed per-job overhead that slows throughput.
FAQ
How much cheaper is a batch API than real-time inference?
On OpenAI, Anthropic, and Google Gemini, official batch inference pricing is 50% lower than standard real-time API rates for both input and output tokens, as of November 27, 2026. Not every cloud provider or ML product offers the same 50% discount, so always check each vendor’s current official pricing page before modeling costs.
How long do batch inference jobs take to finish?
Most batch inference jobs finish well inside a 24-hour processing window, though exact timing depends on the provider and queue load. As of November 27, 2026, Anthropic notes most Message Batches finish in under 1 hour, OpenAI targets a 24-hour window, and Google Gemini runs up to 24 hours after leaving a queue that can hold jobs for up to 72 hours.
Do batch API requests count against standard rate limits?
Batch API jobs generally use separate capacity rules rather than consuming live per-minute request or token limits. OpenAI routes batch jobs through a dedicated Batch/Background Rate Limit pool, Google Gemini uses a shared pool without predefined usage quotas, and Anthropic applies rate limits specifically to Batches API HTTP calls and queued batch requests.
Can you stream responses from a batch inference job?
Batch inference does not support token-by-token live streaming. Because the provider queues and executes requests asynchronously in the background, you do not hold an HTTP stream open. Anthropic explicitly rejects stream: true and OpenAI disables streaming on batch requests, returning completed outputs together as downloadable files instead.
What happens if a batch job expires before every request finishes?
When a batch job hits its expiration window, unfinished requests are cancelled and you still receive outputs for any items that succeeded. Both OpenAI and Google Gemini state that you are charged only for tokens or requests that completed. On Anthropic, batches expire after 24 hours if processing has not finished.



