OpenAI Batch API reference: when asynchronous processing fits

Rama Adi Nugraha
Written by

Rama Adi Nugraha

Katelin Teen
Reviewed by

Katelin Teen

Last edited September 8, 2026

Expert Verified
JSON request files moving through an asynchronous process into output files

What the OpenAI Batch API does

Batch processing collects independent API requests into one uploaded file, creates a batch, lets your application check its state, and later provides output and error files. OpenAI lists evaluations, large-dataset classification, content-repository embeddings, and offline video-render jobs as examples. The current guide supports /v1/responses, /v1/chat/completions, /v1/embeddings, /v1/completions, /v1/moderations, image generation or edits, and /v1/videos; check the Batch API guide before choosing an endpoint.

That is different from “send one request and wait.” A batch gives the platform time to schedule many requests, while your application does other work. It is therefore useful only when your workflow can tolerate delayed and potentially partial results.

Good Batch API fitWhy it fitsWhat it does not prove
Offline evaluation of a fixed test setYou can submit many representative cases and compare the completed outputs laterThat a model is safe for new live conversations
Classifying historical ticketsThe result can be used for reporting, routing analysis, or data cleanupThat the classifier should make a customer-facing decision without review
Creating embeddings for an approved repositoryThe work is high-volume and not interactiveThat every source is current, allowed, or useful for retrieval
Generating a draft catalog or content setA reviewer can check the output after completionThat the output can be published or delivered without validation

How a batch job works

The input is a .jsonl file: one JSON object per request. Every request needs a unique custom_id, which matters because completed output lines can be returned in a different order from input lines. The request body follows the underlying endpoint's rules, and OpenAI says one input file can contain requests for only one model.

The operational sequence is straightforward, but each step needs checks:

  1. Prepare a representative .jsonl file. Validate the JSON, the chosen endpoint, the model, and every custom_id before sending customer or company content.
  2. Upload it through the Files API with purpose: "batch".
  3. Create a batch that points to the uploaded file and a supported endpoint. The documented completion window is currently 24h.
  4. Retrieve the batch status. Do not treat “accepted” or “in progress” as a completed evaluation.
  5. When it completes, retrieve both the output and error files. Join results back to the input by custom_id, not by line number.
  6. Review failed, expired, and surprising cases before a result is used downstream.

OpenAI's guide says a single batch can contain up to 50,000 requests and an input file can be up to 200 MB. Those limits are useful capacity constraints, not a reason to throw unreviewed data into one job. Divide work into recoverable groups, record the source set and model used, and make a plan for errors and expiration.

Cost, rate limits, and partial results

OpenAI currently describes Batch API as 50% cheaper than synchronous APIs and gives it a separate pool of rate limits. The exact per-model prices still come from OpenAI's pricing page, and queued prompt-token limits still depend on the model and account. The guide also documents a 2,000-batch-per-hour creation limit, a 50,000-request cap per batch, and no output-token limit for Batch API. Use the account's platform settings for the limits that apply to your organization.

The important boundary is that cheap asynchronous processing is not automatically cheap operations. Budget for the input and output you expect, file storage and any additional tools you invoke, plus your own validation, error handling, evaluation runs, and data retention choices.

Batch jobs can expire. When a batch does not finish within the completion window, OpenAI says unfinished requests are cancelled, completed responses remain in the output file, and consumed tokens for completed requests are charged. Your downstream process must be able to tolerate missing rows and read the error file. A batch system that silently treats missing results as successful classifications can corrupt a report or workflow.

Do not use Batch API as a live support queue

The Batch API can help a support organization with offline work. For instance, a team could use it to label a carefully approved historical sample for a quality study, then review the results against known outcomes. It should not be the response path for an urgent ticket or chat simply because it can process a large list of requests.

Live support introduces work outside a batch request: determining which knowledge is permitted, verifying customer identity, deciding whether an action needs approval, handling an integration error, handing off safely, and confirming that a response actually reached the right channel. A direct model API gives an application model access. The team building that application still owns those decisions.

This distinction is not an argument against Batch API. Use it when asynchronous cost and throughput match a bounded job. Do not turn “it finished a batch” into a claim that the workflow is ready to answer customers.

Where eesel CLI fits in repeatable support checks

If the desired outcome is operating a support teammate, not building a custom asynchronous pipeline, eesel CLI provides a different control surface. It does not submit JSONL files to OpenAI Batch API or operate an OpenAI account. It operates the same eesel teammate and workspace as the dashboard.

That is useful when a support lead wants the dashboard while an engineer, a scheduled script, or Claude Code, Codex, or Cursor needs structured output. The official CLI needs Node.js 18.17 or newer, and npx @eesel/cli is the documented no-install entry point. Every command prints JSON, so a coding agent can use the output without scraping the dashboard.

Start by making the target workspace and teammate explicit. These inspection commands do not make a change:

Bash
npx @eesel/cli whoami
npx @eesel/cli agents

TARGET_EESEL_AGENT="paste-agent-id-or-name-here"
npx @eesel/cli status --agent "$TARGET_EESEL_AGENT"
npx @eesel/cli integrations --agent "$TARGET_EESEL_AGENT"
npx @eesel/cli instructions --agent "$TARGET_EESEL_AGENT"
npx @eesel/cli activity --agent "$TARGET_EESEL_AGENT"

Here is a concrete repeatable evaluation loop. A support manager selects approved historical cases and records the expected answer or handoff. A developer or coding agent scopes the inspection to the intended teammate, checks which knowledge source is connected and downloaded, then compares the teammate's replies to those expectations. It reports a missing policy or instruction first; it does not write to a workspace just because a case failed.

If a team approves a new policy file, it can add the approved file and confirm its presence through the same workspace:

Bash
npx @eesel/cli files upload ./approved-refund-policy.pdf --agent "$TARGET_EESEL_AGENT"
npx @eesel/cli files ls --agent "$TARGET_EESEL_AGENT"

Use --dry-run before a documented write where available, and check npx @eesel/cli approvals --agent "$TARGET_EESEL_AGENT" before allowing held actions. Then test fictional or approved cases through npx @eesel/cli chat --agent "$TARGET_EESEL_AGENT", review npx @eesel/cli activity --agent "$TARGET_EESEL_AGENT", and separately check the target helpdesk or channel after a controlled rollout. A terminal response, a downloaded source, or an activity record is useful evidence, but none alone proves that a customer received an appropriate answer.

CLI chat is not automatically a read-only evaluation environment: a teammate can have connected actions. That is why the human must decide which policy file, target teammate, and action permissions are in scope. Scripts and coding agents can make checks repeatable; they do not replace approval, representative testing, or outcome review.

Choose the smallest system that fits the job

Use OpenAI Batch API for delayed, independent requests when you can validate the input and process the output and errors later. Keep its 24-hour window, partial-result behavior, and exact current pricing inside the design, not in a footnote after launch.

Use a ready-to-work eesel helpdesk teammate when the job is handling support with connected knowledge and helpdesk workflows. The CLI keeps that teammate accessible to technical users without creating a second configuration: people can work in the dashboard while scripts and coding agents inspect or operate the same workspace from the terminal.

Try eesel for support evaluation and automation

Try eesel if you want to evaluate and operate a support teammate rather than build a Batch API pipeline for live support. Start with a defined policy and a small, approved case set; inspect the teammate's sources and instructions through the dashboard or CLI, test expected handoffs, and review the result before expanding customer-facing work. Check eesel pricing separately from OpenAI Batch API rates because they are different products and units of work.

The Activity view gives the support lead a dashboard-side record to compare with the CLI's JSON output after each controlled evaluation.

eesel AI Activity page
eesel AI Activity page

Frequently asked questions

What is the OpenAI Batch API?

The OpenAI Batch API processes a submitted group of API requests asynchronously. It is intended for work that does not need an immediate result, such as evaluations, classification, embeddings, or offline generation.

How long does an OpenAI Batch API job take?

OpenAI documents a 24-hour completion window. A batch may finish sooner, but it is not a latency promise for an interactive customer request; expired batches can leave unfinished requests in the error file.

What format does the Batch API require?

Input is a .jsonl file. Each line describes one request, includes a unique custom_id, and uses parameters for the underlying supported endpoint. The output order can differ from input order, so use custom_id to match results.

Does the Batch API cost less than synchronous OpenAI API calls?

OpenAI currently documents a 50% cost discount for Batch API compared with synchronous APIs. Confirm the exact model and current pricing, then include retries, storage, evaluation, and your application operations in the estimate.

Can I use the OpenAI Batch API for live support replies?

It is usually a poor fit for a live reply because results are asynchronous within a 24-hour window. It can be useful for offline analysis or evaluation of support cases, but a live workflow needs its own response-time and delivery design.

How does eesel CLI relate to the OpenAI Batch API?

eesel CLI does not create or submit OpenAI batch jobs. It operates an eesel teammate: people, scripts, and coding agents can inspect setup, upload approved knowledge, review instructions, chat, and inspect activity in the same workspace as the dashboard.

Can a coding agent use eesel CLI for repeatable support checks?

Yes. CLI output is JSON and commands can be scoped to an agent. Claude Code, Codex, or Cursor can inspect a selected teammate and prepare a bounded change; use --dry-run before writes, test representative cases, and keep a person responsible for approval and result checks.

Share this article

Rama Adi Nugraha

Article by

Rama Adi Nugraha

Rama is a software engineer at eesel AI with two years of experience writing about B2B SaaS, AI tools, and customer support technology. Based in Bali, Indonesia, he brings a developer's perspective to product comparisons — cutting through marketing copy to what the integrations and APIs actually do.

Related Posts

All posts →
A source handbag, a selected mask, and a blue edited handbag
Guides

OpenAI Image Edit API: a practical guide to safe image workflows

Learn what the OpenAI Image Edit API does, when to use the Image or Responses API, and how to test image-based support work without confusing an edit with a verified outcome.

Rama Adi NugrahaRama Adi NugrahaOct 12, 2025
One landscape illustration branching into three visual variations
Guides

OpenAI Image Variations API: what it does in 2026

Understand the legacy OpenAI Image Variations API, when current image edits are a better fit, and how to keep visual support content and teammate guidance under review.

Rama Adi NugrahaRama Adi NugrahaOct 12, 2025
OpenAI logo connected to six outlined squares
Guides

OpenAI Embeddings API: how semantic search actually works

Learn how the OpenAI Embeddings API supports semantic search and retrieval, what a support knowledge workflow still needs, and how to test it before relying on results.

Rama Adi NugrahaRama Adi NugrahaOct 12, 2025
Text and image inputs moving through risk flags to a human reviewer
Guides

OpenAI Moderation API: build a safer support review flow

Learn what OpenAI Moderation API signals mean, how to route flagged support content safely, and how eesel CLI helps test the support workflow around them.

Rama Adi NugrahaRama Adi NugrahaOct 12, 2025
Blue gradient graphic reading Realtime API GA and OpenAI
Guides

OpenAI Realtime API: a current guide to live voice support

Learn when the OpenAI Realtime API fits a live voice-support experience, how to choose a session and transport, and what to test before callers rely on it.

Rama Adi NugrahaRama Adi NugrahaOct 12, 2025
A person viewing connected user and assistant message threads
Guides

OpenAI Threads API: conversation state after Assistants

Learn why OpenAI conversation state now belongs in the Responses and Conversations APIs, what your application still owns, and how to test an eesel teammate safely.

Rama Adi NugrahaRama Adi NugrahaOct 12, 2025
A base network, curated examples, checklist, and refined network
Guides

OpenAI Fine-Tuning API: what to do as it winds down

Learn OpenAI's current fine-tuning status, how to decide between training and support configuration, and how to test a safer path before customer replies change.

Rama Adi NugrahaRama Adi NugrahaOct 12, 2025
A support agent beside a secured web chat interface
Guides

OpenAI ChatKit Sessions API: current setup and migration choices

Understand OpenAI ChatKit Sessions, client-secret handling, the Agent Builder transition, and when a ready-to-work eesel support teammate is a better fit than building a custom chat stack.

Rama Adi NugrahaRama Adi NugrahaOct 10, 2025
A practical guide to the OpenAI Vector Stores API reference
Guides

A practical guide to the OpenAI Vector Stores API reference

Building an AI assistant? This guide breaks down the OpenAI Vector Stores API Reference, covering everything from creating stores to managing files and running searches.

Kenneth PanganKenneth PanganOct 12, 2025

Ready to hire your AI teammate?

Set up in minutes. No credit card required.

Get started free