Same issue here. Using Firebase cloud functions from us-central1.
Getting this error:
Error generating embeddings: GoogleGenerativeAIFetchError: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/text-embedding-004:embedContent: [400 Bad Request] User location is not supported for the API use.
What should we do @Logan_Kilpatrick? Should we switch regions to something else or will it be fixed sometime soon? Thankfully my app isn’t publicly launched yet.
I retract my previos claim about regions.
I have updated my function so it is hosted in several regions [‘us-central1’, ‘europe-west1’, ‘us-west1’];
All the listed regions report the same issue:
Can it be related to the GCP billing instance location. My country - Lithuania - is listed among supported countries, but perhaps there was some sort of update?
The same issue here - when running from Cloud Function in us-central1 - Gemini API.
Moving to us-west1 solved the issue, but it would be great to get an update on when this will be resolved.
I’m using a billed account. As others have mentioned, switching the region helps. If free tier would be the reason, I think all regions would be affected.
We’re working internally on a fix. In the meantime, I would be wary of removing your us-central1 function unless you are confident that your users will upgrade their apps quickly. You could make your us-central1 function proxy to your us-west1 function to keep old clients happy.
So glad I came across this discussion thread. Was going crazy trying to figure out why my GCP Cloud Run function (in us-central1) calling Gemini AI API suddenly stopped working. Am I to understand that I need to move my GCP function to us-west1? Is that a temporary workaround?
As Thomas said, there is a fix that is in the works.
Moving the function to another region if you can do this quickly and the rest of your operations won’t be impacted could be considered a temporary workaround, yes. This isn’t feasible in many cases because the endpoint might be hardcoded in your app or webapp. As Thomas suggested, you may wish to setup a proxy in us-central1 as part of your workaround in such cases.
Hey everyone, thanks so much for your patience here. This issue should be fixed now. Please let me know if you’re still running into any issues accessing the Gemini API from a GCP service located in us-central1.