Gemini API returns FAILED_PRECONDITION: User location is not supported for the API use

Hello Google AI team,

I’m experiencing an issue with the Gemini API.

When I send a request to the Gemini API using an API key created in Google AI Studio, I receive the following error:

HTTP 400
FAILED_PRECONDITION
User location is not supported for the API use.

My setup:

  • Server location: Netherlands

  • Public IP detected by an IP lookup service: 179.254.127.171

  • IP geolocation reports: Frankfurt, Germany

  • API endpoint: https://generativelanguage.googleapis.com/v1beta/models/gemini-flash-latest:generateContent

  • Authentication: API key created in Google AI Studio

I receive the same location error when making a direct cURL request from the server, without using my bot’s proxy. Therefore, the issue does not appear to be caused by the bot itself.

Could you please help me determine why the API considers my location unsupported, even though Germany and the Netherlands are listed as supported regions?

Could this be related to IP geolocation, IPv4/IPv6 routing, or my Google Cloud project configuration?

Thank you for your help.

Hello @kazikar ,

Please try the below steps:

  • Make sure you’re in one of the supported regions.

  • Turn off any VPN, proxy or iCloud Private Relay, and connect directly.

  • Make sure you’re 18 or older and have verified your age.

  • Try a different network, for example your phone’s hotspot.

If none of these help, please share the details using this form so we can investigate further: Gemini API & Google AI Studio Location Issue Report .