Home › OpenAI API lesson 3: Batch API
OpenAI API lesson 3: Batch API
When you don't need answers right away (tagging thousands of reviews, overnight reports, evaluations), the Batch API runs the requests for you at a 50% discount.
Step by step
- Write one request per line in a .jsonl file, each with a custom_id so you can match results later.
- Upload the file with purpose "batch".
- Create the batch with the file ID, the endpoint (for example /v1/responses) and completion_window "24h".
- Check the batch status until it is completed.
- Download the output file and match each result to its custom_id.
Try it: examples
- One line of the .jsonl file
{"custom_id": "review-1", "method": "POST", "url": "/v1/responses", "body": {"model": "gpt-6-luna", "input": "Label this review positive, neutral or negative: Great service!"}}
Good to know
- Each batch completes within 24 hours, often sooner; 24h is the only completion window.
- Batches use a separate, much higher rate-limit pool, so they don't slow your live app.
- Use normal API calls for anything a user is waiting for.
Sources (official pages, read Nov 8, 2026)
Written from OpenAI's official documentation and product pages; we don't run hands-on tests. Features and limits vary by plan and country.