Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

Batch API | OpenAI API

Teaches how to use the Batch API to send large volumes of requests asynchronously for lower costs and higher throughput.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Batch API | OpenAI API

Teaches how to use the Batch API to send large volumes of requests asynchronously for lower costs and higher throughput.

When To Use

Use when you need to process large sets of model requests asynchronously at a reduced cost and do not require immediate real-time responses.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/batch-api-openai-workflow-guide.mdA 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-openai-batch-api-jsonl-request-format.textA JSONL formatted file containing multiple batch request objects with custom IDs, HTTP methods, URLs, and chat completion bodies.Exact payloads, commands, or snippets shown in A JSONL formatted file containing multiple batch request objects with custom IDs, HTTP methods, URLs, and chat comple...
examples/batch-api-openai-openai-batch-api-request-jsonl-format.textA JSONL formatted file containing batch request objects with custom IDs, methods, URLs, and request bodies for the OpenAI Batch API.Exact payloads, commands, or snippets shown in A JSONL formatted file containing batch request objects with custom IDs, methods, URLs, and request bodies for the Op...
examples/batch-api-openai-openai-batch-api-request-jsonl-format-2.textA JSONL formatted file containing multiple batch request objects including custom IDs, methods, URLs, and request bodies for the OpenAI Batch API.Exact payloads, commands, or snippets shown in A JSONL formatted file containing multiple batch request objects including custom IDs, methods, URLs, and request bod...
examples/batch-api-openai-openai-batch-api-nodejs-upload.textA Node.js code snippet 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 Node.js code snippet demonstrating how to upload a JSONL file to the OpenAI Batch API using the OpenAI client library.
examples/batch-api-openai-openai-batch-api-python-upload.textA Python script demonstrating how to use the OpenAI client to upload a JSONL file for batch processing.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to upload a JSONL file for batch processing.
examples/batch-api-openai-openai-batch-api-upload-curl.textA 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 curl command demonstrating how to upload a JSONL file for batch processing using the OpenAI Files API.
examples/batch-api-openai-openai-batch-api-jsonl-input-format.textA sample JSONL file containing structured requests formatted for the OpenAI Batch API.Exact payloads, commands, or snippets shown in A sample JSONL file containing structured requests formatted for the OpenAI Batch API.
examples/batch-api-openai-openai-batch-api-nodejs-create-batch-request.textA Node.js code example demonstrating how to create a new batch job using the OpenAI SDK by specifying an input file ID and an endpoint.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to create a new batch job using the OpenAI SDK by specifying an input file I...
examples/batch-api-openai-openai-batch-api-python-create-batch-request.textA Python code example demonstrating how to use the OpenAI client to create a new batch job using a file ID and the chat completions endpoint.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the OpenAI client to create a new batch job using a file ID and the ch...
examples/batch-api-openai-openai-batch-api-create-batch-curl.textA curl command demonstrating how to create a new batch job using the OpenAI Batch API endpoint.Exact payloads, commands, or snippets shown in A curl command demonstrating how to create a new batch job using the OpenAI Batch API endpoint.
examples/batch-api-openai-openai-batch-api-create-batch-request.textA text example demonstrating the command to create a new batch request using the OpenAI Batch API.Exact payloads, commands, or snippets shown in A text example demonstrating the command to create a new batch request using the OpenAI Batch API.
examples/batch-api-openai-openai-batch-api-response-object.textA text representation of an OpenAI Batch API response object containing batch status, endpoint, and file IDs.Exact payloads, commands, or snippets shown in A text representation of an OpenAI Batch API response object containing batch status, endpoint, and file IDs.
examples/batch-api-openai-openai-batch-api-retrieve-nodejs.textA Node.js code snippet demonstrating how to retrieve the status of an existing batch job using the OpenAI client library.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to retrieve the status of an existing batch job using the OpenAI client libr...
examples/batch-api-openai-openai-batch-api-python-retrieve-batch.textA Python code snippet demonstrating how to use the OpenAI client to retrieve the status of an existing batch job.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the OpenAI client to retrieve the status of an existing batch job.
examples/batch-api-openai-openai-batch-api-retrieve-batch-status-curl.textA curl command demonstrating how to retrieve the status of a specific batch using the OpenAI Batch API.Exact payloads, commands, or snippets shown in A curl command demonstrating how to retrieve the status of a specific batch using the OpenAI Batch API.
examples/batch-api-openai-openai-batch-api-retrieve-batch-command.textA text example demonstrating the CLI command to retrieve a specific batch using a batch ID.Exact payloads, commands, or snippets shown in A text example demonstrating the CLI command to retrieve a specific batch using a batch ID.
examples/batch-api-openai-openai-batch-api-nodejs-retrieval.textA Node.js code snippet demonstrating how to retrieve and log the text content of a file using the OpenAI client.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to retrieve and log the text content of a file using the OpenAI client.
examples/batch-api-openai-openai-batch-api-python-retrieve.textA Python code snippet demonstrating how to use the OpenAI client to retrieve and print the text content of a file via the Batch API.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the OpenAI client to retrieve and print the text content of a file via...
examples/batch-api-openai-openai-batch-api-retrieval-curl.textA curl command demonstrating how to retrieve the content of a completed batch job file using the OpenAI API.Exact payloads, commands, or snippets shown in A curl command demonstrating how to retrieve the content of a completed batch job file using the OpenAI API.
examples/batch-api-openai-openai-batch-api-jsonl-input-format-2.textA text file demonstrating the JSONL structure required for inputting requests into the OpenAI Batch API.Exact payloads, commands, or snippets shown in A text file demonstrating the JSONL structure required for inputting requests into the OpenAI Batch API.
examples/batch-api-openai-openai-batch-api-response-format.textA JSON object representing the structure of a completed batch API response containing a chat completion result.Exact payloads, commands, or snippets shown in A JSON object representing the structure of a completed batch API response containing a chat completion result.
examples/batch-api-openai-openai-batch-api-cancel-request-javascript.textA JavaScript code snippet demonstrating how to cancel an existing batch job using the OpenAI Batch API.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to cancel an existing batch job using the OpenAI Batch API.
examples/batch-api-openai-openai-batch-api-cancel-python.textA Python code snippet demonstrating how to cancel an existing batch job using the OpenAI client.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to cancel an existing batch job using the OpenAI client.
examples/batch-api-openai-openai-batch-api-cancel-request-curl.textA 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-openai-batch-api-cancel-command.textA text example demonstrating the command to cancel an existing OpenAI Batch API job using a batch ID.Exact payloads, commands, or snippets shown in A text example demonstrating the command to cancel an existing OpenAI Batch API job using a batch ID.
examples/batch-api-openai-openai-batch-api-list-batches-nodejs.textA Node.js code example demonstrating how to list existing batches using the OpenAI client library.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to list existing batches using the OpenAI client library.
examples/batch-api-openai-openai-batch-api-python-list-batches.textA Python code snippet using the OpenAI client to list batch jobs with a specified limit.Exact payloads, commands, or snippets shown in A Python code snippet using the OpenAI client to list batch jobs with a specified limit.
examples/batch-api-openai-openai-batch-api-list-batches-curl.textA 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-openai-batch-api-list-batches-cli.textA CLI command example demonstrating how to list batches using the OpenAI Batch API with a limit parameter.Exact payloads, commands, or snippets shown in A CLI command example demonstrating how to list batches using the OpenAI Batch API with a limit parameter.
examples/batch-api-openai-openai-batch-api-expired-request-response.textA JSON-formatted text example showing an error response from the OpenAI Batch API when a request expires before completion.Exact payloads, commands, or snippets shown in A JSON-formatted text example showing an error response from the OpenAI Batch API when a request expires before compl...

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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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