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.

Request envelopes spaced in a queue beside an hourglass represent bounded waiting and API retries

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)

StatusMeaning that should be checkedInitial guidance
400Invalid request or parameterCheck the model name, API version, and data format. Don't resend the same thing again.
429Rate limit, quota or spending rate ceilingRead error details, check Usage and Rate Limits, and schedule retries appropriately
503Service is temporarily unavailable.Delayed and limited retries.
Other 5xx errorsService-side problems that may be temporarySave 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)

  1. Open Google AI Studio and select the project actually used by the app
  2. See Usage and Rate Limits for the model and time period of issue.
  3. Check if there are many concurrent requests from multiple users or background tasks.
  4. Look at the error details to see if it mentions a per-minute rate, daily quota, or other restrictions.
  5. 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

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 documentation reviewed October 16, 2026. Retry delays are hypothetical, not Google requirements. This article includes no load tests or real API calls.