Home › Gemini API lesson 3: Batch API

Gemini API lesson 3: Batch API

Last checked

For large jobs that don't need an instant answer (tagging, summaries, evaluations), the Batch API runs your requests at 50% of the standard cost.

Step by step

  1. Collect your requests: inline in the batch request for small jobs (under 20MB), or one per line in a JSONL file for big ones.
  2. Create the batch job with the SDK.
  3. Wait for it to finish; Google targets 24 hours, and most finish much sooner.
  4. Read the results: a list of responses, or a JSONL file with one response or status per line.
  5. Match each result to its request and handle any failed lines.

Try it: examples

Good to know

Sources (official pages, read Nov 8, 2026)

Written from Google's official documentation and product pages; we don't run hands-on tests. Features and limits vary by plan and country.

Report an error on this page