Hello,
I am experiencing a persistent 400 FAILED_PRECONDITION error when using the Gemini API:
User location is not supported for the API use.
My setup:
-
Gemini API / Google AI Studio
-
API key created in Google AI Studio
-
Gemini API enabled in my Google Cloud project
-
Requests are sent from my own VPS
-
VPS public IPv4:
83.171.225.4 -
IP geolocation: Paris, France
-
Country: France (FR)
-
ASN: AS41745
-
ISP/Organization: Baykov Ilya Sergeevich / fortis.host
France is listed as a supported country for the Gemini API.
I tested the API directly from the VPS using curl, without n8n or any SDK.
For example:
curl -4 -s "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_KEY"
returns:
400 FAILED_PRECONDITION: User location is not supported for the API use.
I also tested using the x-goog-api-key header and received the same error.
DNS and HTTPS connectivity to generativelanguage.googleapis.com work correctly.
I also tested the same VPS with Anthropic’s API, and Anthropic works successfully from this server.
Could you please check whether the IP 83.171.225.4 or its IP range is incorrectly classified or restricted for Gemini API access?
If the IP has stale or incorrect geolocation/reputation data on Google’s side, could you please advise whether it can be corrected?
Thank you.