Genace

User location is not supported for the API use. — Gemini API region error (Veo, Imagen, Nano Banana)

HTTP 400 FAILED_PRECONDITION Do not retry as-is

The exact error

Code: 400, Message: User location is not supported for the API use., Status: FAILED_PRECONDITION

What it means

The Gemini API rejected the request because of where the request came from, not because of what was in it. Google publishes a list of countries and territories where the Gemini API and Google AI Studio are available. The list covers the API as a whole, not individual models, so the same gate applies whether you call a text model or an image or video model such as Nano Banana, Imagen or Veo.

The location that counts is the machine that sends the request. Google states this directly for one case: on its regions page, it says Colab restrictions depend on where the Colab instance is, not where the user is. Community reports show the same pattern for servers:

  • In the Google AI Developers Forum thread 74773, a developer on the free tier got this error only from a VPS at Hetzner in Germany. The same calls worked from their own computer, and they were in Germany themselves.
  • In gemini-cli issue #1993, a US-based developer hit it from a Canadian dev server at Vultr. They reported that the CLI worked from US machines, and that the Canadian IP had worked until the Gemini 2.5 rollout.

Germany and Canada both appear on Google’s current list of available regions. Where the server’s country is on the list and the error still appears, one forum reply in thread 74773 suggests the cause is how Google geolocates the IP address. That is a user hypothesis, not a confirmed explanation from Google.

How to confirm it’s this

  • The response is HTTP 400 with status FAILED_PRECONDITION, and the message is the one shown at the top of this page. The gemini-cli prints the same message in its own [API Error: ... (Status: FAILED_PRECONDITION)] wrapper.
  • The same API key works from a different machine or network. Both reporters above confirmed this.
  • Check where your outgoing traffic appears to come from. For Colab, Google’s regions page suggests running !curl ipinfo.io to see the instance’s location. Run the equivalent from the shell of the server, container or VPN exit that makes the call. That shows a third-party geolocation, which may not match Google’s own.
  • In gemini-cli issue #1993, a contributor’s first question was whether GOOGLE_CLOUD_LOCATION was set. The reporter had not set it, and the issue was later closed as stale without a fix. Still, it is worth ruling out a location override in your environment.

Fix

  1. Find the real egress location. That means your VPS, your cloud function’s region, your VPN exit or your hosted automation platform, not your laptop.
  2. Compare it with Google’s available-regions list. If that location is not on the list, but you and your users are in supported countries, run the calls from infrastructure located in a supported country. A VPN on your development machine can cause the same error the other way round, when its exit sits outside the list.
  3. If you are not in a listed country, Google’s regions page points to the Gemini API in Gemini Enterprise Agent Platform as the alternative. The page also refers you to Google’s Terms of Service for access requirements. Routing traffic to appear to be somewhere else is not a fix.
  4. If the server’s country is listed and you still see the error, the forum reply in thread 74773 suggests reporting the IP through Google’s “Report IP problems” form. The original poster had not found a solution a month later, so do not count on this being quick.
  5. On a hosted platform, you may not control the egress. In n8n issue #14741, a user on n8n Cloud found that Gemini image-generation calls, which had worked for a week, started failing with a country restriction. An n8n team member explained that their cloud runs in Frankfurt and could not quickly move regions. They suggested using a different LLM or self-hosting.

Retry or not

No. The decision depends on the location of the calling machine, so an identical retry from the same host gets the same answer. Google’s errors page describes failed_precondition as a prerequisite that is not met. In thread 74773, the error persisted for over a month on the same server. An agent should fail fast, report the location problem, and only send the request again from a different, supported host.

When it’s not this

  • Image generation is not available in your country. This is also a 400 FAILED_PRECONDITION, but its wording is scoped to image generation. A Google Developer forums thread (187143) reports it for a Gemini image model. The same app worked in development in Turkey and failed once deployed to a server in France. Diagnose it the same way, by checking where the calling server is.
  • Billing prerequisites. Google’s errors page gives disabled billing as an example of failed_precondition. Same status, different unmet prerequisite, so read the message text before acting.
  • A free-tier quota of zero. This is a quota response, not a location response.
  • AI Studio access pages. Google’s regions page lists age requirements and account verification as other reasons you might be sent there. Those apply to AI Studio sign-in, not to this API response.

Error text last verified against the sources below on .

Where these facts come from