After weeks of solid performance, starting yesterday I received sporadic “User location is not supported for the API use.” After about an hour of this, the API went to solid errors. My VPS is in Dallas, Texas. At this point the “Make your first request” demo on the Quickstart fails with the same message.
What is going on? Thanks!
1 Like
Hi @John_Koenig, Welcome to forum!!
Can you please confirm how you are calling the API? (Colab, locally, via Cloud Run, etc?)
Also, can you share what error code it is throwing?
Thanks
1 Like
I am calling the API using the “Get Started” code:
curl “https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=[MYKEYHERE]”
-H ‘Content-Type: application/json’
-X POST
-d ‘{
“contents”: [
{
“parts”: [
{
“text”: “Explain how AI works in a few words”
}
]
}
]
}’
When I execute this (Ubuntu LTS24) from IP 104.128.239.110 (Dallas, Texas) I receive this result:
{
“error”: {
“code”: 400,
“message”: “User location is not supported for the API use.”,
“status”: “FAILED_PRECONDITION”
}
}
The code works from other IP addresses. When I reflect my calls through a proxy server, everything works fine.
The issue has been magically resolved. All the same environment and code. But now the spurious error message is gone and the proper response is received.
I am encountering the exact same scenario, It was working, and all of a sudden stop working and then back again working.
Trying to figure out the issue. until then moving out of this, this is not reliable 100 percent for now
1 Like
Same, this issue happens intermittently for me. My Gemini requests come from Cloud Run (through async python using litellm) and route private IP traffic to a serverless VPC connector.