AI Error WikiSearch

Gemini API 503 UNAVAILABLE

Gemini API returns 503 UNAVAILABLE or a deadline message? Check the response, bound retries, and separate service overload from a client timeout.

Quick answer

Google's API reference describes 503 as a service that is temporarily overloaded or unavailable. If your response also says Deadline expired before operation could complete, preserve that exact wording and the request ID. A 503 response and a 504 deadline entry in logs are related clues, but do not assume every deadline has the same cause.

Exact message

503 UNAVAILABLE
Deadline expired before operation could complete

Google's guidance

The Gemini API error reference says to wait and retry a 503 with exponential backoff. Its troubleshooting guide recommends jitter and a maximum retry count. Set a sensible client deadline for the task, and check whether your SDK already retries before layering on another loop. For non-idempotent downstream work, inspect whether an earlier attempt produced an output before resubmitting it.

A reported case

On November 2, a paid image-generation user reported requests stalling for about two minutes before API 503 UNAVAILABLE, with 504 DEADLINE_EXCEEDED in AI Studio logs. The report includes that user's own counts and says the team was adding backoff. Those numbers describe one workload, not the whole Gemini API. If your 503 persists, keep the model, region, time, latency, request ID, and sanitized log for Google support. Check AI Studio API status separately from the Gemini app's status.

Frequently Asked Questions

Should I keep retrying until it works?

No. Use capped retries and backoff. A persistent 503 needs a recorded case and a later retry or support escalation, not an infinite loop.

Is 503 the same as 429 RESOURCE_EXHAUSTED?

No. 429 first calls for checking the model, project, and relevant limit. A 503 points to temporary service availability.

Does the Gemini app's green status settle an API 503?

No. The app and API have different status surfaces. The Gemini status guide explains the split.

Sources