google · Google AI Docs
Gemini API Batch API
Explains how to use the Batch API to process large volumes of requests asynchronously for improved cost-efficiency and higher throughput.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Gemini API Batch API
Explains how to use the Batch API to process large volumes of requests asynchronously for improved cost-efficiency and higher throughput.
When To Use
Use when you need to process large datasets of prompts asynchronously to reduce costs and manage rate limits for non-latency-sensitive tasks.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/gemini-api-batch-workflow-guide.md | A guide explaining how to use the Gemini API Batch API to process large volumes of asynchronous requests at a reduced cost. | Questions about a guide explaining how to use the Gemini API Batch API to process large volumes of asynchronous requests at a reduced... |
examples/gemini-api-batch-python-generatecontent-request.text | A Python code example demonstrating how to create a batch job using the Google GenAI SDK by passing a list of GenerateContentRequest dictionaries. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to create a batch job using the Google GenAI SDK by passing a list of Generat... |
examples/gemini-api-batch-nodejs-inlined-requests.text | A Node.js code example demonstrating how to create a Gemini API batch job using inlined requests. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to create a Gemini API batch job using inlined requests. |
examples/gemini-api-batch-generatecontent-curl-request.text | A curl command demonstrating how to send a batchGenerateContent request to the Gemini API using a JSON payload. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a batchGenerateContent request to the Gemini API using a JSON payload. |
examples/gemini-api-batch-jsonl-request-format.text | A JSONL formatted file containing multiple request objects for the Gemini API Batch API, including content and generation configuration. | Exact payloads, commands, or snippets shown in A JSONL formatted file containing multiple request objects for the Gemini API Batch API, including content and genera... |
examples/gemini-api-batch-python-jsonl-request-format.text | A Python code snippet demonstrating how to construct and save a JSONL file containing multiple batch request objects for the Gemini API. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to construct and save a JSONL file containing multiple batch request objects... |
examples/gemini-api-batch-jsonl-request-format-2.text | A JSONL formatted file containing multiple individual request objects for the Gemini API Batch mode. | Exact payloads, commands, or snippets shown in A JSONL formatted file containing multiple individual request objects for the Gemini API Batch mode. |
examples/gemini-api-batch-input-jsonl.text | A JSONL formatted input file containing multiple content requests for the Gemini API batch processing job. | Exact payloads, commands, or snippets shown in A JSONL formatted input file containing multiple content requests for the Gemini API batch processing job. |
examples/gemini-api-batch-python-create-job.text | A Python code snippet demonstrating how to use the Google GenAI client to create a new batch job using an uploaded file. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the Google GenAI client to create a new batch job using an uploaded file. |
examples/gemini-api-batch-create-job-nodejs.text | A Node.js code snippet demonstrating how to create a new batch job using the Gemini API and an uploaded file object. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to create a new batch job using the Gemini API and an uploaded file object. |
examples/gemini-api-batch-generate-curl-request.text | A curl command demonstrating how to send a batchGenerateContent request to the Gemini API using a previously uploaded file ID. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a batchGenerateContent request to the Gemini API using a previously uploaded... |
examples/gemini-api-batch-job-creation.text | A text log showing the successful creation of a Gemini API batch job with its unique identifier. | Exact payloads, commands, or snippets shown in A text log showing the successful creation of a Gemini API batch job with its unique identifier. |
examples/gemini-api-batch-python-embeddings-job-creation.text | Python code demonstrating how to create embeddings batch jobs using the Gemini API with both uploaded file and inline request methods. | Exact payloads, commands, or snippets shown in Python code demonstrating how to create embeddings batch jobs using the Gemini API with both uploaded file and inline... |
examples/gemini-api-batch-embeddings-nodejs-create-job.text | A Node.js code snippet demonstrating how to create an embeddings batch job using the Gemini API client. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to create an embeddings batch job using the Gemini API client. |
examples/gemini-api-batch-inline-requests-list.text | A list of inline request objects formatted for the Gemini API Batch API containing text prompts and system instructions. | Exact payloads, commands, or snippets shown in A list of inline request objects formatted for the Gemini API Batch API containing text prompts and system instructions. |
examples/gemini-api-batch-inline-requests-list-2.text | A list of inline request objects containing content and system instructions for the Gemini API Batch mode. | Exact payloads, commands, or snippets shown in A list of inline request objects containing content and system instructions for the Gemini API Batch mode. |
examples/gemini-api-batch-mode-inlined-requests.text | A text file containing a list of inlined request objects formatted for the Gemini API Batch API. | Exact payloads, commands, or snippets shown in A text file containing a list of inlined request objects formatted for the Gemini API Batch API. |
examples/gemini-api-batch-inline-requests-list-3.text | A list of inline request objects formatted for the Gemini API Batch API. | Exact payloads, commands, or snippets shown in A list of inline request objects formatted for the Gemini API Batch API. |
examples/gemini-api-batch-python-generate-request-list.text | A Python code example demonstrating how to structure a list of GenerateContentRequest objects for use with the Gemini API Batch mode. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to structure a list of GenerateContentRequest objects for use with the Gemini... |
examples/gemini-api-batch-nodejs-inlined-requests-2.text | A Node.js code example demonstrating how to structure inlined requests for the Gemini API Batch mode using the @google/genai library. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to structure inlined requests for the Gemini API Batch mode using the @googl... |
examples/gemini-api-batch-response.text | A text representation of a sample response containing recipe data from a Gemini API batch processing job. | Exact payloads, commands, or snippets shown in A text representation of a sample response containing recipe data from a Gemini API batch processing job. |
examples/gemini-api-batch-python-job-status-check.text | A Python code snippet demonstrating how to retrieve and check the completion status of a Gemini API batch job using the genai client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to retrieve and check the completion status of a Gemini API batch job using t... |
examples/gemini-api-batch-job-status-polling-javascript.text | A JavaScript code example demonstrating how to poll the status of a Gemini API batch job until it reaches a terminal state. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to poll the status of a Gemini API batch job until it reaches a terminal... |
examples/gemini-api-batch-python-webhook-creation.text | A Python code snippet demonstrating how to create a webhook to monitor batch job success and failure events using the Google GenAI client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to create a webhook to monitor batch job success and failure events using the... |
examples/gemini-api-batch-webhook-creation-javascript.text | A JavaScript code example demonstrating how to create a webhook to listen for batch success and failure events using the GoogleGenAI client. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to create a webhook to listen for batch success and failure events using... |
examples/gemini-api-batch-webhook-registration-curl.text | A curl command demonstrating how to register a webhook to receive batch job status notifications via the Gemini API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to register a webhook to receive batch job status notifications via the Gemini API. |
examples/gemini-api-batch-python-get-job-status.text | A Python code example demonstrating how to retrieve and check the status of a completed Gemini API batch job using the GenAI client. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to retrieve and check the status of a completed Gemini API batch job using th... |
examples/gemini-api-batch-job-status-check-javascript.text | A JavaScript code snippet demonstrating how to retrieve and check the status of a specific Gemini API batch job using its name. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to retrieve and check the status of a specific Gemini API batch job using... |
examples/gemini-api-batch-status-check-shell.text | A shell script using curl and jq to poll the status of a Gemini API batch job. | Exact payloads, commands, or snippets shown in A shell script using curl and jq to poll the status of a Gemini API batch job. |
examples/gemini-api-batch-list-jobs-python.text | A Python code example demonstrating how to list batch jobs using the Gemini API client with optional pagination configuration. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to list batch jobs using the Gemini API client with optional pagination confi... |
examples/gemini-api-batch-list-jobs-javascript.text | A JavaScript code snippet demonstrating how to list active batch jobs using the Gemini API. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to list active batch jobs using the Gemini API. |
examples/gemini-api-batch-curl-request.text | A curl command demonstrating how to create a new batch job using the Gemini API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to create a new batch job using the Gemini API. |
examples/gemini-api-batch-python-cancel-job.text | A Python code snippet demonstrating how to cancel an existing Gemini API batch job using the client library. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to cancel an existing Gemini API batch job using the client library. |
examples/gemini-api-batch-cancel-job-javascript.text | A JavaScript code snippet demonstrating how to cancel an active Gemini API batch job using the cancel method. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to cancel an active Gemini API batch job using the cancel method. |
examples/gemini-api-batch-cancel-and-status-check-curl.text | Curl commands to cancel a Gemini API batch job and verify its status using the batch job name. | Exact payloads, commands, or snippets shown in Curl commands to cancel a Gemini API batch job and verify its status using the batch job name. |
examples/gemini-api-batch-python-delete-job.text | A Python code snippet demonstrating how to delete a specific batch job using the Gemini API client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to delete a specific batch job using the Gemini API client. |
examples/gemini-api-batch-delete-job-nodejs.text | A code snippet demonstrating how to delete a specific batch job using the Gemini API in Node.js. | Exact payloads, commands, or snippets shown in A code snippet demonstrating how to delete a specific batch job using the Gemini API in Node.js. |
examples/gemini-api-batch-delete-job-curl.text | A curl command demonstrating how to delete a specific Gemini API batch job using its batch name. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to delete a specific Gemini API batch job using its batch name. |
examples/gemini-api-batch-python-jsonl-request-creation.text | A Python script demonstrating how to format and write multiple Gemini API requests into a JSONL file for batch processing. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to format and write multiple Gemini API requests into a JSONL file for batch proces... |
examples/gemini-api-batch-nodejs-jsonl-request.text | A Node.js code example demonstrating how to structure and upload a JSONL file containing multiple batch requests for the Gemini API. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to structure and upload a JSONL file containing multiple batch requests for... |
examples/gemini-api-batch-jsonl-request-payload.text | A JSONL formatted file containing multiple request objects for the Gemini API Batch API, including text and image generation configurations. | Exact payloads, commands, or snippets shown in A JSONL formatted file containing multiple request objects for the Gemini API Batch API, including text and image gen... |
What This Skill Covers
- Ongoing incident: The Batch API is currently experiencing an issue causing batch jobs to randomly fail. Our team is actively investigating.
- Main sections:
Creating a batch job,Inline requests,Python,JavaScript,REST.
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://ai.google.dev/gemini-api/docs/batch-mode
