Batch JSONL input format
Batch input files must be JSONL: one JSON object per line.
Request input object
Each line in the input file is a request input object:
custom_id(string): developer-provided per-request id, must be uniquemethod(string): currently onlyPOSTurl(string): the API relative URL for the requestbody(object): the request body for that endpoint
Example (Chat Completions)
jsonl
{"custom_id":"request-1","method":"POST","url":"/v1/chat/completions","body":{"model":"gpt-4o-mini","messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"What is 2+2?"}]}}Example (Responses)
jsonl
{"custom_id":"request-2","method":"POST","url":"/v1/responses","body":{"model":"gpt-4.1","input":"Tell me a short story."}}Common pitfalls
- The file must be valid JSONL (no commas between lines).
- The file must be uploaded with purpose
batch. - Keep each line within per-request size limits and within overall batch limits.
