It’s always DNS…
Thanks Vishal
It’s always DNS…
Thanks Vishal
Working here too, what is of concern is that the service just dropped out of operation. We have an app in Beta at the moment so was not a huge issue. However, we are looking at going live very soon and should something like this happen it would be very bad for us. Will there be better support and information for this service?
Yes its sorted now, thanks for posting the updates. But we had paying customer complain on this as our service was not accessible. This was very bad, there should be some alternative or HA something which can stop this level of impact.
After running Gemini in prod for 2 weeks, my app just went down due to this issue. In fact, it’s still not working almost 6h later.
I’m using the official python SDK and doesn’t look like I can configure the endpoint. I’m trying to move my prod servers to a different region, but this is outrageous for a “stable” api.
I am trying to make requests to the GoogleGenerativeAI js sdk and started hitting this error today. The requests work from localhost but run into this error when made from cloudflare workers. Are there any known issues with this and if so is there a fix or workaround?
Welcome to the forums!
The problem in your case is that Cloudflare doesn’t guarantee the location of their servers. So if you’re using the free tier of AI Studio, you are subject to location restrictions (particular around Europe). Upgrading your key to a paid tier (at least for deployment) will work around this issue in most cases, and you can continue to use a key that is attached to the free tier for your local development and testing.
Thanks! In my case traffic was being routed through Hong Kong, so using smart placement solved the isssue.
Same here. Do you know of any solutions?
I’m facing the same issue again… ![]()
What is the solution for those not using any SDK, but a raw REST API?
It was working fine for the last few months, and out of sudden it’s broken now.
I’m just calling https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-001:generateContent, I’m not selecting regions, the app keeps running in the same server, hosted in Germany.
Same issue here, eventhough in “availability zone”
tier 1, server in los angeles.
Strange. running this shows ok in both cases (from server and from client accessing the server)…
curl -X POST
-H “Content-Type: application/json”
-H “x-goog-api-key: Your API Key”
-d ‘{
“contents”: [{
“parts”: [{
“text”: “Write a short poem about the ocean.”
}]
}]
}’
“https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent”
Using LibreChat so going to figure out why, there. Maybe the error message is off about it being related to IP
location.
Same issue. I don’t know how to change regions,hosted in California USA
INFO:httpx:HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp-image-generation:generateContent “HTTP/1.1 400 Bad Request”
ERROR:main:处理图片生成请求时发生错误: 400 FAILED_PRECONDITION. {‘error’: {‘code’: 400, ‘message’: ‘User location is not supported for the API use.’, ‘status’: ‘FAILED_PRECONDITION’}}
INFO: 192.168.90.109:37004 - “POST /gemini/generate-image HTTP/1.1” 500 Internal Server Error
Same here since late Mar. 20 or early 21 JST here in Tokyo, Japan. With the same Gemini API key, my code in the JP server returns the 400 error, but it does work in GAS.
As of 2025 March. 26th, this is still an issue.
My VPS instances from both Tokyo and Singapore region cannot access the gemini API.
We are getting the same 400 error.
Error in message processing: GoogleGenerativeAIFetchError: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse: [400 Bad Request] User location is not supported for the API use.
having same issue, location - Kazakhstan
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:streamGenerateContent?alt=sse: [400 Bad Request] User location is not supported for the API use.
We are suddenly seeing HTTP 400 User location is not supported for the API use from Germany. Worked last week.
Since we are using Langchain, I am not sure I can set the region directly.
Error: Failed to generate character portrait: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:generateContent: [400 Bad Request] Image generation is not available in your country.
App are hosted in the US. I am using the Blaze plan to pay for Gemini. Users from Spain. In the development environment, it works perfectly. In production, that error occurs.
Please, Google team, you are doing a great job with Gemini, but this is a known issue that has not been correctly resolved for months. For people like us who do not have the technical knowledge to change the region (users trying vibe coding in Firestone Studio, for example), this represents a rejection of the application and Google’s solutions in agentic code. We want to use the Gemini API; the product is good and cutting-edge, but this complicates matters. There is a lack of a registry of APIs (experimental or not, and with their exact names), including the expected and applied dates of deprecations, new ones, etc. I also haven’t found exactly which countries its use is supposed to be limited to. All of this is vague and generates uncertainty about present and future functionality. In my case, for no apparent reason and without prior notice, it has stopped working, showing that error. Thank you!
We came to the conclusion that our German IP (at Hetzner) is within a range that has previously been assigned to Iran, and was blocked due to stale geolocation data at Google.
As a workaround, we began contacting the API using an alternative IP.
In particular, in case it can help someone: We simply use IPv6 instead.
Hello there! I am also on Hetzner (server located in Finland) and just hit a brick wall to solve this issue.
How do you use IPv6 to contact the gemini api ? by the way I am relying on the Python SDK to perform a call to the Gemini 2.5 TTS (preview).