The API usually works, and sometimes this happens. If we retry after a few minutes, it will work again. I checked and it is not rate limiting related or quota related.
Error generating content: Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:generateContent: [503 Service Unavailable] Deadline expired before operation could complete.
Welcome to the forum.
While this isn’t a fix, it will make this backend behavior a non-issue for your application: for http codes 429, 500 and 503, use retry with exponential backoff.
can anyone from the Google team help with this?
Server administrators could monitor more frequently. They know about the problem from the past: Internal Server Error for some requests to models/gemini-1.5-pro-latest - #3 by OrangiaNebula.
Hello, I was getting the 503 when serving the form-data from my phone, I removed the resizing/compressing I was doing and it worked again. Though if I mirrored my localhost with grok it would work fine so I really can’t conclude anything.
Just check try again without any modifications to the original Data of the image and see if it fixes it.