Subject: Batch API consistently returns 400 FAILED_PRECONDITION on batches.create() — billing enabled, region Pakistan
I’m getting a 400 FAILED_PRECONDITION error every time I try to create a batch job via the Gemini API, using the Python google-genai SDK.
Error returned:
{“error”: {“code”: 400, “message”: “Precondition check failed.”, “status”: “FAILED_PRECONDITION”}}
Steps to reproduce:
- client.files.upload() succeeds (JSONL file, mime_type=‘jsonl’).
- client.batches.create(model=“models/gemini-3.6-flash”, src=, config={“display_name”: “test”}) fails with the error above.
What I’ve already ruled out:
- Not a payload/model issue: reproduced with a trivial single-request JSONL (“Say hello in one short sentence.”) and with two different models (gemini-3.1-flash-tts-preview and gemini-3.6-flash) — same error both times.
- Not a file-upload issue: the upload step itself succeeds every time; the error only occurs on batches.create().
- Not a billing issue on the account in general: billing is enabled on this API key’s project, and real-time generateContent calls with the same key and model work normally.
Account/environment details:
- Region: Pakistan
- SDK: Python google-genai (latest via pip install -U google-genai)
- Auth: plain Gemini API key (not Vertex AI / not a service account)
Question: Is Batch Mode currently restricted to specific regions, and if so, is Pakistan excluded from the current rollout? If there’s a separate opt-in or allowlist step beyond enabling billing, could you point me to it? Happy to provide the full request/response trace or my project ID if that helps investigate.