openai · OpenAI Platform Docs
Batch API
A guide to implementing asynchronous request processing using the Batch API, covering file preparation in JSONL format, uploading files, initiating batch jobs, monitoring status, and retrieving results.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Batch API
A guide to implementing asynchronous request processing using the Batch API, covering file preparation in JSONL format, uploading files, initiating batch jobs, monitoring status, and retrieving results.
When To Use
Use when you need to process large datasets, run evaluations, or perform high-volume tasks like classification and embedding at a 50% cost discount with higher rate limits.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/batch-api-workflow-guide.md | A guide explaining how to use the OpenAI Batch API to send asynchronous groups of requests for lower costs and higher rate limits. | Questions about a guide explaining how to use the OpenAI Batch API to send asynchronous groups of requests for lower costs and higher... |
examples/batch-api-openai-batch-api-chat-completions-jsonl-requests.jsonl | A JSONL file containing multiple chat completion request objects formatted for the OpenAI Batch API. | Exact payloads, commands, or snippets shown in A JSONL file containing multiple chat completion request objects formatted for the OpenAI Batch API. |
examples/batch-api-openai-batch-api-request-payload.jsonl | A JSONL formatted file containing multiple API request objects for the OpenAI Batch API, including custom IDs, HTTP methods, and endpoint URLs. | Exact payloads, commands, or snippets shown in A JSONL formatted file containing multiple API request objects for the OpenAI Batch API, including custom IDs, HTTP m... |
examples/batch-api-openai-batch-api-request-payload-2.jsonl | A JSONL formatted file containing multiple API request objects for the OpenAI Batch API, including moderation endpoint calls. | Exact payloads, commands, or snippets shown in A JSONL formatted file containing multiple API request objects for the OpenAI Batch API, including moderation endpoin... |
examples/batch-api-openai-batch-api-javascript-upload.javascript | A JavaScript code example demonstrating how to upload a JSONL file to the OpenAI Batch API using the OpenAI client library. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to upload a JSONL file to the OpenAI Batch API using the OpenAI client li... |
examples/batch-api-openai-batch-api-python-upload.python | A Python script demonstrating how to upload a JSONL file to the OpenAI Batch API using the OpenAI client. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to upload a JSONL file to the OpenAI Batch API using the OpenAI client. |
examples/batch-api-openai-batch-api-upload-curl.bash | A bash curl command demonstrating how to upload a JSONL file for batch processing using the OpenAI Files API. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating how to upload a JSONL file for batch processing using the OpenAI Files API. |
examples/batch-api-openai-batch-api-cli-creation.cli | A CLI command demonstrating how to upload a JSONL file to the OpenAI Batch API using the openai files create command. | Exact payloads, commands, or snippets shown in A CLI command demonstrating how to upload a JSONL file to the OpenAI Batch API using the openai files create command. |
examples/batch-api-openai-batch-api-javascript-create-batch-request.javascript | A JavaScript code example demonstrating how to use the OpenAI SDK to create a new batch request using a file ID and endpoint. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI SDK to create a new batch request using a file ID and e... |
examples/batch-api-openai-batch-api-python-create-batch-request.python | A Python script demonstrating how to use the OpenAI client to create a new batch job using a file ID and a specific endpoint. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to create a new batch job using a file ID and a specific e... |
examples/batch-api-openai-batch-api-create-batch-curl.bash | A curl command demonstrating how to create a new batch job using the OpenAI Batch API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to create a new batch job using the OpenAI Batch API. |
examples/batch-api-openai-batch-api-create-batch.cli | A CLI command example demonstrating how to create a new batch job using the openai batches create command with an input file ID and completion window. | Exact payloads, commands, or snippets shown in A CLI command example demonstrating how to create a new batch job using the openai batches create command with an inp... |
examples/batch-api-openai-batch-api.python | A Python code example demonstrating how to interact with the OpenAI Batch API. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to interact with the OpenAI Batch API. |
examples/batch-api-openai-batch-api-retrieve.javascript | A JavaScript code example demonstrating how to use the OpenAI client to retrieve the status of an existing batch job. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI client to retrieve the status of an existing batch job. |
examples/batch-api-openai-batch-api-python-retrieve-batch.python | A Python script demonstrating how to use the OpenAI client to retrieve the status and details of an existing batch job. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to retrieve the status and details of an existing batch job. |
examples/batch-api-openai-batch-api-curl-request.bash | A curl command demonstrating how to make a request to the OpenAI Batch API endpoint. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to make a request to the OpenAI Batch API endpoint. |
examples/batch-api-openai-batch-api-retrieve-batch.cli | A CLI command example demonstrating how to retrieve the status and results of a specific batch using the openai batches retrieve operation. | Exact payloads, commands, or snippets shown in A CLI command example demonstrating how to retrieve the status and results of a specific batch using the openai batch... |
examples/batch-api-openai-batch-api-javascript-retrieval.javascript | A JavaScript code snippet demonstrating how to use the OpenAI client to retrieve the text content of a file associated with the Batch API. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to use the OpenAI client to retrieve the text content of a file associate... |
examples/batch-api-openai-batch-api-python-retrieval.python | A Python script demonstrating how to use the OpenAI client to retrieve the text content of a file via the Batch API. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to retrieve the text content of a file via the Batch API. |
examples/batch-api-openai-batch-api-retrieve-curl.bash | A curl command used to retrieve the content of a file from the OpenAI Batch API. | Exact payloads, commands, or snippets shown in A curl command used to retrieve the content of a file from the OpenAI Batch API. |
examples/batch-api-openai-batch-api-cli-upload-command.cli | A CLI command demonstrating how to upload a file to the OpenAI Batch API using the --file-id flag. | Exact payloads, commands, or snippets shown in A CLI command demonstrating how to upload a file to the OpenAI Batch API using the --file-id flag. |
examples/batch-api-openai-batch-api-response-format.jsonl | A JSONL formatted file demonstrating the structure of a completed batch API response containing request IDs and chat completion objects. | Exact payloads, commands, or snippets shown in A JSONL formatted file demonstrating the structure of a completed batch API response containing request IDs and chat... |
examples/batch-api-openai-batch-api-cancel.javascript | A JavaScript code example demonstrating how to cancel an existing batch job using the OpenAI client library. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to cancel an existing batch job using the OpenAI client library. |
examples/batch-api-openai-batch-api-cancel.python | A Python code example demonstrating how to cancel an existing batch job using the OpenAI client. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to cancel an existing batch job using the OpenAI client. |
examples/batch-api-openai-batch-api-cancel-request.bash | A curl command demonstrating how to cancel an existing batch job using the OpenAI Batch API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to cancel an existing batch job using the OpenAI Batch API. |
examples/batch-api-openai-batch-api-cancel-batch.cli | A CLI command example demonstrating how to cancel an existing batch job using the OpenAI Batch API. | Exact payloads, commands, or snippets shown in A CLI command example demonstrating how to cancel an existing batch job using the OpenAI Batch API. |
examples/batch-api-openai-batch-api-list-batches.javascript | A JavaScript code example demonstrating how to use the OpenAI client to list existing batches using the batches.list method. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI client to list existing batches using the batches.list... |
examples/batch-api-openai-batch-api-list-batches.python | A Python script using the OpenAI client to list recent batch jobs. | Exact payloads, commands, or snippets shown in A Python script using the OpenAI client to list recent batch jobs. |
examples/batch-api-openai-batch-api-list-batches-curl.bash | A curl command demonstrating how to list batches using the OpenAI Batch API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to list batches using the OpenAI Batch API. |
examples/batch-api-openai-batch-api-cli-list-batches.cli | A CLI command example demonstrating how to list existing batches using the OpenAI Batch API. | Exact payloads, commands, or snippets shown in A CLI command example demonstrating how to list existing batches using the OpenAI Batch API. |
examples/batch-api-openai-batch-api-jsonl-response-error-examples.jsonl | A JSONL file containing example batch API response objects that demonstrate error states such as batch expiration. | Exact payloads, commands, or snippets shown in A JSONL file containing example batch API response objects that demonstrate error states such as batch expiration. |
What This Skill Covers
- Learn how to use OpenAI's Batch API to send asynchronous groups of requests with 50% lower costs, a separate pool of significantly higher rate limits, and a...
- Main sections:
Overview,Getting started,1. Prepare your batch file,Moderations input examples,2. Upload your batch input file.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/batch.md
