OpenAI Batch API Validator
Validate a Batch API input file before you upload it. Checks every line for a unique custom_id, the required method, a supported url, and a well-formed body — plus the file-level 50,000-request and 200 MB limits. Runs in your browser.
Validate
What gets checked
custom_id— present, a non-empty string, at most 64 characters, and unique across the file. Duplicates are the most common reason a batch is rejected, and the report names the earlier line so you can find the clash.method— must be exactly"POST".url— one of/v1/chat/completions,/v1/completions,/v1/embeddings,/v1/responses. Anything else is a warning by default, an error in strict mode.- One endpoint per file — if several
urlvalues appear, the report says so. A batch cannot mix endpoints. body— an object containingmodel. For chat completions,messagesmust be a non-empty array whose entries have a recognisedroleand eithercontentortool_calls. For embeddings,inputis required.stream— must not betrue; batch requests cannot stream.- File limits — 50,000 requests and 200 MB, with a warning once you pass 150 MB.
- Unexpected top-level keys — reported as warnings, since they are ignored by the API and usually indicate a generation bug.
Batch format vs fine-tuning format
These two JSONL formats look similar and are not interchangeable — a mistake that costs people a rejected upload surprisingly often.
- Fine-tuning files hold training examples: each line is
{"messages": […]}with no wrapper. Validate those with the OpenAI fine-tune validator. - Batch files hold API requests: each line wraps a full request body in
custom_id/method/url/body. That is this page.
The practical tell: if your lines start with {"custom_id" you want this validator; if they start
with {"messages" you want the fine-tune one.
After validation
Use Token counter to estimate the cost before you submit — batch pricing is discounted but 50,000 requests still add up. Splitter breaks an over-limit file into compliant chunks, and Filter pulls out just the requests you want to retry.
Privacy
Nothing is uploaded. The whole thing runs in this tab, in your own browser. That matters here more than on most tool sites — training data is usually the most sensitive file a team owns.
Frequently asked questions
My custom_ids are unique but validation still complains.
Check for trailing whitespace or invisible characters — "req-1" and "req-1 " are different ids but look identical. The Encoding fixer strips zero-width characters and trailing whitespace.
Why is an unrecognised url only a warning?
OpenAI adds endpoints over time, and a warning that is really fine is less annoying than an error that is wrong. Turn on strict mode if you would rather fail closed.
Does it validate the model name?
No — model availability depends on your account and changes often. It only checks that body.model is present and a non-empty string.
Can I use this for Anthropic's Message Batches API?
Not directly. Anthropic's batch format uses custom_id plus params rather than method / url / body, so the required keys differ.