Gemini API 429 vs. 503: Quotas and Safe Retries
If your app gets a 429 or 503 from the Gemini API, resist retrying in a tight loop. The codes point to different problems, and unbounded retries can pile up requests.

Distinguish the causes and handling of 429 and 503
For 429, start with your rate limits and quotas. A 503 usually means the service is temporarily unavailable or overloaded. Google recommends exponential backoff for transient errors. Waiting will not fix a malformed request (Google's troubleshooting guide; checked October 16, 2026)
| Status | Meaning that should be checked | Initial guidance |
|---|---|---|
| 400 | Invalid request or parameter | Check the model name, API version, and data format. Don't resend the same thing again. |
| 429 | Rate limit, quota or spending rate ceiling | Read error details, check Usage and Rate Limits, and schedule retries appropriately |
| 503 | Service is temporarily unavailable. | Delayed and limited retries. |
| Other 5xx errors | Service-side problems that may be temporary | Save the status, check the documentation, and try again carefully. |
Error details can vary by API. Read the HTTP status and the returned error details, then compare them with the API errors manual before deciding what to do.
Why Gemini can return 429 even at low usage
Adding an API key to the same project does not grant another quota: limits are shared at project level. Requests per day are only part of the picture. Request and token rates depend on the model, account tier and feature, while Batch has separate limits. A manual request count may miss the limit you actually hit (Google's rate-limit documentation)
- Open Google AI Studio and select the project actually used by the app
- See Usage and Rate Limits for the model and time period of issue.
- Check if there are many concurrent requests from multiple users or background tasks.
- Look at the error details to see if it mentions a per-minute rate, daily quota, or other restrictions.
- Check billing and spending status when relevant; payment does not remove all limits.
If you hit a daily limit, check the reset time. Google says RPD resets at midnight Pacific time, not midnight in Thailand.
Hypothetical example: space retries and limit attempts
Suppose a read request returns 503. An app might retry at most three times, waiting about 1, 2 and 4 seconds, with a little random jitter so clients do not retry together. These are illustrative timings, not Google requirements. If the service suggests a wait time or your SDK already retries, account for that before adding another retry layer.
One way to express the delay is delay(n) = min(maximum delay, initial delay × 2^n + jitter), where n starts at 0. Set a maximum wait and a maximum number of attempts; once they are exhausted, tell the user the request did not complete.
Be especially careful with requests that write data or trigger transactions. The first attempt may have succeeded even if the app missed the response. Check its status before retrying, and design request IDs and duplicate protection.
When retrying will not fix a 429 or 503 error
- 400 caused by invalid JSON or parameters: correct the request
- Incorrect permissions or API key: check the configuration instead of repeatedly retrying
- Quotas requiring a reset or service-tier change: a few seconds of delay may be insufficient
- Results blocked by policy or content restrictions: retry should not be used to circumvent such checks.
Prepare limits, logs, and clear error states before launch
Before launch, limit concurrent requests and set timeouts. Log the time, model, status and request ID for diagnosis, but keep API keys and private prompts out of logs. Tell users when the app is waiting and when it has stopped trying. Once service resumes, check costs and response quality: HTTP success does not guarantee a correct answer.
Sources
- Google AI for Developers: Troubleshooting guide
- Google AI for Developers: Rate limits
- Google AI for Developers: API errors
- Google: Retry strategy
- Google Site Policies
Google documentation reviewed October 16, 2026. Retry delays are hypothetical, not Google requirements. This article includes no load tests or real API calls.