AI & LLM Developer Tools

LLM Batch Request Builder

Turn a list of prompts or CSV rows into valid batch files for the OpenAI Batch API or Anthropic Message Batches, with duplicate-ID checks and token and cost estimates.

  • Batch JSONL
  • Validation findings
  • Token and cost estimate
Runs in your browser

Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics.

Batch builder workspace

1 Provider and model

Examples:
Batch API

2 Prompts

Input format

Each line (or CSV row) becomes one request. In CSV mode, the template below can use any column as {{column}}. Drop a .txt or .csv file here (max 20 MB).

In line mode each line is {{prompt}}.

{n} row number, {n:5} padded, {column} a CSV value.

Cost assumptions and custom rates

Loading batch prices…

3 Batch file

Paste prompts and build. You get a file ready to upload, with id checks, size limits and a cost estimate.

What the LLM Batch Request Builder does

This builder turns a list of prompts, or the rows of a CSV file, into a valid batch file for the OpenAI Batch API (JSONL) or the body of an Anthropic Message Batches request (JSON), checks it against the documented limits - unique custom_id values, request counts, file size, one model per OpenAI file - and estimates tokens and cost at the providers' batch rates.

Batch APIs cost half the standard price for work that can wait up to 24 hours: classification, extraction, evaluations, bulk rewriting. The format is simple but unforgiving; one duplicate id or a malformed line rejects the whole file. Your prompts are assembled into the file in your browser and are not uploaded anywhere.

How to use it

  1. Choose the batch API and the model. The endpoint list for OpenAI offers /v1/chat/completions and /v1/responses.
  2. Paste one prompt per line, or a CSV with a header row and write a template that uses columns as {{column}}. You can also drop a .txt or .csv file.
  3. Set the custom_id pattern - {n} for the row number, {n:5} for a zero-padded one, or {column} to reuse an id from your CSV - plus an optional system prompt and the maximum output tokens.
  4. Press Build batch file and read the findings. Adjust the expected output tokens and rates under Cost assumptions if you need to.
  5. Download the .jsonl or .json file, and the id map CSV that links each custom_id back to its source row.

Reading the results

Ids must be unique within a batch; results come back matched by custom_id, not by order. Anthropic also restricts them to 1-64 letters, digits, hyphens and underscores.

Token counts are estimates (characters / 4) and not a tokenizer. The cost shows an expected figure from your expected output length and an upper bound where every request uses its full max_tokens.

Prices come from a dated table copied from the official pricing pages (checked 2026-09-19) and are batch rates, already 50% below standard. They are not live: check the provider's page before you commit a budget, or enter your own rates.

Worked example: classifying 100,000 product reviews

The OpenAI example classifies six reviews with a one-line system prompt and max_completion_tokens 5 on GPT-5.6 Luna. The file is 1.97 KB, about 198 input tokens by the estimate, and costs about $0.000027 at the batch rates of $0.10 per million input tokens and $0.60 per million output tokens.

Scaled up, 100,000 reviews averaging 33 estimated input tokens each is 3.3 million input tokens, $0.33; two output tokens each is 200,000 output tokens, $0.12. The whole job is about $0.45 and fits in two OpenAI batches of at most 50,000 requests each. The same job through Anthropic's Message Batches would fit in one batch of up to 100,000 requests.

Each line of the file looks like {"custom_id":"review-00001","method":"POST","url":"/v1/chat/completions","body":{...}}, the shape the OpenAI Batch guide documents.

Formulas and scoring rules

Estimated tokens
tokens = ceil(characters / 4)A rough rule for English; code and non-Latin scripts usually need more tokens per character.
Cost
cost = input_tokens x input_rate / 1,000,000 + output_tokens x output_rate / 1,000,000Rates are batch rates per million tokens. Upper bound uses max output tokens for every request.
Batches needed
ceil(requests / limit)Limit 50,000 requests or 200 MB per OpenAI file; 100,000 requests or 256 MB per Anthropic batch.

OpenAI and Anthropic batch formats side by side

OpenAI's Batch API takes a JSONL file uploaded with purpose "batch": one line per request, each with custom_id, method "POST", the endpoint url and the request body. All lines in a file must use the same model, and the batch is created with completion_window "24h".

Anthropic's Message Batches API takes one JSON request whose requests array holds objects with a custom_id and params - the same parameters as a Messages API call, including model, max_tokens (at least 1) and messages. Streaming is not allowed inside a batch, and results remain downloadable for 29 days.

Limitations: what the result does not prove

  • Token and cost figures are estimates; the providers bill actual tokens, which depend on their tokenizers and on how long each answer really is.
  • Prices are copied from official pages on the review date and will change. They are not fetched live.
  • It builds text-only requests. Images, tools, structured-output schemas and prompt caching settings are not added; edit the file if you need them.
  • It does not submit the batch or hold any API key. You upload the file with your own account.

Privacy: where your data goes

Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics. Session recording and tag-manager scripts are switched off on this page.

Standards and sources

Frequently asked questions

What does an OpenAI Batch API JSONL line look like?

Each line is one JSON object: {"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {model, messages, ...}}. The body is exactly what you would send to that endpoint synchronously. Every custom_id must be unique and every line must use the same model.

How is an Anthropic Message Batch request structured?

It is a single JSON body with a requests array. Each item has a custom_id (1-64 letters, digits, hyphens or underscores) and params containing model, max_tokens and messages, like a normal Messages API call. stream: true is not allowed.

How much cheaper are batch requests?

Both OpenAI and Anthropic charge 50% of their standard per-token prices for batch requests, in exchange for completion within 24 hours rather than immediately. The rates in this tool are already the batch rates.

How many requests can one batch contain?

OpenAI allows up to 50,000 requests and 200 MB per input file; Anthropic up to 100,000 requests or 256 MB per batch, whichever comes first. The builder tells you how many batches your list needs.

Why do batch results need a custom_id?

Results are not guaranteed to come back in the order you sent them. The custom_id is how you match each result to its input, which is why duplicates are rejected and why the builder offers an id map CSV.

Are my prompts uploaded when I build the file?

No. The file is assembled in your browser and downloaded directly. Only the static price table is loaded from a2z.tools; your prompts never leave the page until you upload the file to your provider yourself.

Last reviewed by the A2Z.Tools team against the sources listed above.

Rate this tool

Was this tool useful? Your feedback helps us improve it.

No ratings yet — be the first to rate this tool.
Your rating (required)
0 / 2000

Please do not include passwords, payment details or other sensitive information.

Your feedback is sent privately to the A2Z.Tools team and will not be posted publicly.