Hello,
I’m receiving this error when calling the Gemini API directly from my Tencent Cloud server:
HTTP 400
FAILED_PRECONDITION
“User location is not supported for the API use.”
Environment:
- Tencent Cloud Lighthouse
- Server region: Seoul, South Korea
- Public IPv4: 43.155.220.89
- Ubuntu 24.04, Python 3.12.3
- Model tested: gemini-3-pro-image
- Python urllib.request.getproxies() reports no proxy configuration.
- IPinfo identifies the public IPv4 as Seoul, South Korea.
The same API key and model work on my Mac through a VPN connection. Both the deployed application and a standalone Python urllib request fail on the server with the location error above.
I believe the billing profile associated with my API credit purchases is registered in Hong Kong, but I have not verified the exact billing configuration.
Could you help clarify:
- Could the billing profile region cause this difference between local and server requests?
- Could Google be classifying the server’s IP as an unsupported location?
- What diagnostic information should I provide to investigate this?
I have attached a screenshot of the error. No API key is included.
Thank you.
