After using Gemini API fine through a Google Cloud Node JS function, I'm suddenly getting "User location is not supported for the API use." I am using a US-based (us-central1) Google Cloud function to call the code, and currently based in the UK. This has all worked fine until the last day. I now get:
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent: [400 Bad Request] User location is not supported for the API use.
Has anyone else had this when both the US and UK are listed as supported / any ideas why this might be happening please?
Very many thanks
Solved! Go to Solution.
Found the issue for anyone with the same: https://discuss.ai.google.dev/t/generate-object-error-user-location-is-not-supported-for-the-api-use...
Found the issue for anyone with the same: https://discuss.ai.google.dev/t/generate-object-error-user-location-is-not-supported-for-the-api-use...
Hey if anyone from Google is on here, this is a pretty shocking lapse in expected uptime and response from GCP. I have just completed moving my us-central1 GCP functions that use Gemini AI API to the us-west1 region and service is restored. The fact that this coincided with the generation of a new API key meant a lot of hours were wasted. I'd like to see some response from Google about how and why this occurred.
BTW: I've add a comment to the link above with some hints for deploying via firebase
Hi Chris,
I have updated my function to be hosted in multiple regions and when I call it I iterate between these regions. Every region reports the same issue for me 😕
Still working for me on us-west1 as off 33 minutes ago
I also have that behaviour.
I usually connect to Gemini REST API from Madagascar, but when I temporarily travel to UK, I get the error.
In 2024 and all this remote working enabled, there should not be such restrictions: I should be allowed to connect from anywhere temporarily.
At least, I am OK to enable a kind of roaming in my profile to declare that I am moving from my usual location, but just blocking the access is a no go.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |