Skip to content

Batch API returns 429 RESOURCE_EXHAUSTED despite being well under quota limits #1264

@poliha

Description

@poliha

Environment

  • SDK: @google/genai v1.37.0
  • Node.js: 22.x
  • Model: gemini-2.5-flash-lite
  • Account: Paid billing enabled

Description

Consistently receiving 429 RESOURCE_EXHAUSTED errors when using the Batch API,
despite usage being well below documented quota limits.

Error Message

status: 429
message: "You exceeded your current quota, please check plan and billing
details. For more information on this error, head to:
https://ai.google.dev/gemini-api/docs/rate-limits"

Details

  • Batch size: 1000 jobs (~5M tokens total)
  • Only 1 concurrent batch in flight
  • AI Studio dashboard shows no quota exceeded
  • Adding delays between batch creations (10+ seconds) doesn't help
  • First batch succeeds, subsequent batches fail with 429

Related Issue

This mirrors the exact behavior reported in the Python SDK:
googleapis/python-genai#1901

A comment there suggests Vertex AI (vertexai: true) has higher quota limits
than the Generative Language API. Can you confirm if this is expected behavior
or a bug?

Reproduction

  1. Create batch with ~1000 requests using genAI.batches.create()
  2. Wait for completion
  3. Create another batch
  4. Second batch fails with 429

Metadata

Metadata

Assignees

Labels

api:gemini-apipriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions