"This API is not available in your current location" - Not working in USA (SJC) - tested with curl/python

  1. I have a server in SJC which is generating an error I wouldn’t expect one to make in US
  2. I can reproduce using python and curl - the curl output is below
  3. it happens with Gemma4 and 3.5-flash
  4. The ipinfo output is also below
  5. This has happened every now and then.. but its now happening for over 30 hours on this server and its unclear if it will fix itself

Curious what the root cause is and if there is a work around.

curl -X POST “https://generativelanguage.googleapis.com/v1beta/interactions” -H “x-goog-api-key: $GEMINI_API_KEY” -H ‘Content-Type: application/json’ -d ‘{
“model”: “gemma-4-31b-it”,
“input”: “Explain how AI works in a few words”
}’
{“error”:{“message”:“This API is not available in your current location. …”}}

curl ipinfo.io
{
“ip”: “173.249.xx.xx”,
“hostname”: “XXX.xxx.xxx.xxx”,
“city”: “San Jose”,
“region”: “California”,
“country”: “US”,
“loc”: “37.3394,-121.89..”,
“org”: “AS11878 tzulo, inc.”,
“postal”: “95110”,
“timezone”: “America/Los_Angeles”,
}

Hello @Royans_Tharakan ,

This could be specific to your IP address. Please report it on our Report IP problems page. Suggested workarounds which may help for now:

  • Try temporarily switching to a different network (e.g. try with the hotspot from your phone if available).

  • Try asking your host for a new IP.

  • Trying switching between IPv6 / IPv4.

I have a static IP for that server… IPV6 was already breaking… I had switched to IPV4 for that reason, and now that breaks as well.