Skip to main content
The Batch API takes up to 5,000 requests in one call, runs them in the background, and returns every result in one response. Use it for work where nobody waits for the answer, such as evals, classification, data labeling, summarizing a backlog, or embedding a corpus.

Use batch when

Nobody is waiting for the response, and cost matters more than speed.

Use the sync API when

A user waits for the answer, or you need image or audio output, OpenRouter web search, or Zero Data Retention.

Key facts

How it works

  1. Submit the batch. POST /api/v1/batches with a model, an endpoint, and your requests. The response is 202 with status: "validating".
  2. Wait for it to finish. Set callback_url to receive a webhook, or poll GET /api/v1/batches/{id}.
  3. Read the results. When status is completed, results holds one entry per request.
Shell
A 202 means OpenRouter stored the batch, not that the batch is valid. OpenRouter checks each request after it accepts the batch. If a check fails, the batch moves to failed and error.message says why.
The Batch quickstart walks through every step, with webhooks, polling, images and files, and deletion.

Batch status

Status progression
A completed batch can contain failed requests. Each result has either a response or an error. Check request_counts.failed before you assume every request worked.

Pricing

Batch requests are typically billed at 50% of the model’s standard per-token price. Some components are not discounted: web search calls bill at standard rates, and prompt caching rates vary by model. The price on each model page is the source of truth. For a completed batch, usage.cost reports the amount OpenRouter charged. Before OpenRouter accepts a batch, it estimates the cost. If the estimate is more than your balance, the submit returns 402. With a provider key (BYOK), the provider bills you for inference and OpenRouter charges only the BYOK fee.

Limitations

Limits

A batch over the size limits returns 413. A submit over the in-progress limits returns 429. Wait for running batches to finish, then retry.

Frequently asked questions

OpenRouter picks the cheapest provider that serves the model in batch mode. If that provider has no capacity, OpenRouter moves the batch to the next one at a similar price. The provider field on the batch shows which provider ran it. See Choose a provider.
No. Match each result to its request with custom_id.
30 days after you submit. After that, GET returns 410 Gone. Save the results you need, or delete the batch sooner.
In the Batches tab of your logs, or with GET /api/v1/batches.