Need Help: Rate-Limit Issue with Gemini API for Accessible PDF Project

Hi @abhishek_kumawat,

Welcome to the Google AI Forum! :confetti_ball: :confetti_ball:

Strategies to get free credits

Option 1:
Google Cloud offers a 12-month free trial with US$300 in credits for new users, which you can apply toward many Google Cloud services (including AI/ML services).

If this is still not enough, try-out Option 2

Option 2:
Google Cloud’s Startup Program: If you are (or your company is) an early-stage startup, you can access much larger credits. Example: Up to US$350,000 in cloud credit (over 2 years) for AI-first startups.

Please refer to this link for more details

Option 3:
Collaborate with universities. Google offers “research credits” for academic researchers at higher-education institutions: you can apply for Google Cloud credits to support research projects. Here is the link

Option 4:
Collaborate with Non-Profit or create one.
The program Google for Nonprofits offers eligible organizations some free credits and access to Google Cloud services. Here is the link

Ways to handle rate limits

Implement retrys with Exponential Backoff: This is a standard error handling strategy for network applications. When you hit a rate limit and receive a 429 error, your code should wait for a progressively longer time before retrying the request. This prevents you from continuously hitting the limit and allows your processing to continue smoothly, albeit at a slower pace.

Here is a reference on my previous post on retry’s with exponential backoff:

Alternative Models and Methods

For your specific use case of extracting structured information from complex PDFs, the Gemini API is a great general-purpose tool. However, Google Cloud also offers more effective service called Document AI.

Link to Document AI and Pricing

Document AI is built to understand and extract data from documents. It has pre-trained models for common document types and can handle complex layouts, including Tables, Forms, Layouts, etc.

Free Resources and Best Practices

  • Batch Processing: When possible, try to process multiple items in a single request to reduce the number of API calls. While you are sending one image per page, ensure your code is efficient and not making unnecessary calls.