Troubleshooting the Gemini "High Demand" Error

If you’ve seen the message "This model is currently experiencing high demand... status code: BadRequest (or 503)" in your Zenphi logs, you aren't alone! This is one of the most common errors users encounter when integrating with Gemini.

What’s happening?

This error isn't a bug within Zenphi; it is a direct response from Google’s Gemini API. It simply means that at that exact moment, Google's servers are at capacity for that specific model. Just like traffic on a highway, there are times when millions of people are using Gemini simultaneously. If you are using a shared or default Gemini Key, you are competing for capacity with many other users. This significantly increases the chances of hitting a "High Demand" wall.

A Highly Recommended Solution: Use Your Own API Key 🔑

Because these high-demand spikes are usually temporary, the first recommended approach is to implement Retry error-handling logic or simply retry the step after a few minutes. In most cases, the same request succeeds on a subsequent attempt once the load decreases.
Pro Tip: If you have your own API key, definitely try using it. Personal API keys operate under your own usage quota, which can help provide more consistent performance during high-traffic periods and may reduce the likelihood of encountering temporary “High Demand” responses.