Hello,
I am developing an OCR automation system using the Gemini API.
Environment:
- Python 3.14
- google-genai 2.10.0
- Gemini 2.5 Flash
- API Key authentication
- Google Cloud Billing enabled (Paid account)
My application processes scanned daily work reports.
For each request, I send:
- One text prompt
- One template PDF (1 page)
- One scanned report PDF (1-2 pages)
using client.models.generate_content().
The requests are processed sequentially.
There is no parallel processing.
The first 20-22 documents are usually processed successfully.
After that, I begin receiving HTTP 429 errors.
My retry logic waits 50 seconds before each retry.
Sometimes the request succeeds after 1-10 retries.
However, in one test it still failed after more than 47 retries (approximately 39 minutes), so I stopped the process manually.
The API key is valid.
A simple connection test works correctly.
Google Cloud Billing is enabled.
The Quotas page does not indicate that token limits have been exceeded.
My questions are:
-
Is this expected behavior for Gemini 2.5 Flash?
-
Is there another rate limit besides the token quotas shown in Google Cloud?
-
Is there a recommended delay between PDF requests?
-
Is there a recommended approach for processing many scanned PDFs sequentially?
The application is intended for internal company use to automatically read handwritten production reports.
Reliability is much more important than maximum throughput.
If adding a delay between requests is recommended, I am happy to follow that recommendation.
Thank you very much.