Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/gemini-api-batch-workflow-guide.mdA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textPython 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textCurl 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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

  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://ai.google.dev/gemini-api/docs/batch-mode