Handling 429 / 503 errors from the Gemini API

If you’re experiencing 429 or 503 errors when accessing the Gemini API, please read on.

429 errors

429 (“Too Many Requests”) errors are usually triggered if you exceed one of our listed quotas:

  • Requests per minute (RPM)

  • Tokens per minute (TPM)

  • Requests per day (RPD)

First: check your usage & quota

  • In: AI Studio > Dashboard > API Keys > View usage (the bar chart symbol next to your project), check the Quota & Rate Limit tabs. Usage data is delayed ~15 mins.

  • Double check you’re using the API key for the correct project.

Still getting 429’s?

  • If you’re running into limitations from RPM or TPM limits, consider implementing backoff and retry with a long maximum delay (our SDKs support this through retry config).

  • If this still doesn’t solve the issue, you could be hitting internal quota limits. We’re planning to expose the cause of these starting in Q1 2026.

503 errors

503 (“Service Unavailable”) errors are unrelated to your quota and indicate our services are temporarily overloaded and can’t service your request. These errors are more common during certain times of the day. We apologise for the impact of these errors & are working hard to provision more resources and reduce their occurrence.

To handle these errors, we strongly recommend implementing backoff and retry (our SDKs support this through retry config). Although your requirements will vary based on your desired user experience, you can try setting a low number of retries with a short timeout at first, and increase these if the issue isn’t resolved.

4 Likes

AI Studio is returning consistent 503 and 504 errors on 3.1 Pro Preview since the Build has been ‘fixed’ (though it was already slow prior, now it’s just down for me). 3.0 seems to go through.

Same issue for me.

3.1 pro is not responding, although 3.0 pro is.

Experiencing the same issue. What’s even worse is that important production projects for a client are currently down because of this…

I’m getting those errors because Google won’t upgrade me to the next spending tier