Google Gemini API 400 Error

Hello, my n8n service running on Zeabur suddenly encountered a Google Gemini API error on May 28th: 400 User location is not supported for the API use. The official team said it’s not their problem. Does anyone have the same situation or could guide me on how to resolve it? Thank you~

Hi @oeccafe, welcome!
I think it’s either your geographic location or your server’s geographic location that is causing this error for you, not an n8n-related issue. Instead, I would recommend using an LLM inference provider. See the list below:

Hi @oeccafe

The error you’re seeing happens because Google is blocking the specific “internet address” (IP address) that your Zeabur server is using. Even if your server is in a supported country, Google sometimes misidentifies these cloud addresses as being from a restricted region or flags them as “bot-like,” which triggers the location error.

The easiest first step is to change where your service is hosted. If you are in a region like Hong Kong, you must move to the US or Japan. Even if you are already in a supported region, simply redeploying your service or moving it to a different server within that same region can sometimes give you a new IP address that Google doesn’t block.

If moving the server doesn’t work, there is a technical trick you can try in your Zeabur settings. By adding a specific environment variable (NODE_OPTIONS=--dns-result-order=ipv6first), you tell n8n to prefer a newer type of internet address called IPv6. Google’s filters for IPv6 are often less strict, and this has fixed the problem for many other users.

Another option is to use a “middleman” service. The Gemini node in n8n is stubborn and ignores most proxy settings, but the OpenAI node is more flexible. You can use a bridge service (like One API or a Cloudflare Worker) to translate Gemini’s language into OpenAI’s format. You then use the OpenAI node in n8n and point it toward that bridge to bypass the location check.

In short, this isn’t a problem with your account or your API key, but a “digital border” issue. I recommend trying the region change first, then the IPv6 setting, and finally the proxy bridge if you need a guaranteed fix.