I keep running into a location-based error when trying to work with Google’s Gemini AI model through their Python SDK. Here’s my simple test code:
import google.generativeai as genai_client
import os
genai_client.configure(api_key=os.getenv('GEMINI_API_KEY'))
ai_model = genai_client.GenerativeModel('gemini-pro')
result = ai_model.generate_content('Hello world test message')
print(result.text)
Every time I run this, I get hit with:
User location is not supported for the API use.
I’m located in Austria and can’t find clear info about geographical restrictions in their main docs. Has anyone else faced this issue? The error traceback shows it’s a FailedPrecondition exception with a 400 status code.
After digging around, I discovered there’s actually a hidden list of supported regions buried deep in their documentation. Turns out many European countries including Austria aren’t supported yet, which isn’t mentioned prominently anywhere on their main marketing pages. Pretty frustrating since there’s no clear warning upfront about these limitations.
Anyone know if there are workarounds or if they’re planning to expand coverage soon?