ThinkFacility

Error messages

User location is not supported for the API use.

The message

User location is not supported for the API use.
Gemini API as of September 26, 2026 read September 26, 2026Gemini APIGemini400

What it means

Google's Gemini API decided your request came from a country or territory where the free API and AI Studio aren't offered. It judges by where the traffic leaves from.

What to do

Check the public IP of the machine making the call against Google's list of available regions. If it has to run from outside them, Google points to the Gemini API on its paid Cloud platform.

From the API directly, the reply is a 400:

{
  "error": {
    "code": 400,
    "message": "User location is not supported for the API use.",
    "status": "FAILED_PRECONDITION"
  }
}

Gemini CLI prints the same text in its own frame:

✕ [API Error: User location is not supported for the API use. (Status: FAILED_PRECONDITION)]

What "location" means here

Google keeps a list of countries and territories where the Gemini API and AI Studio are offered. When we read it on September 26, 2026 it had 230 entries, including the US, Canada and the UK. Mainland China, Hong Kong, Macao, Russia, Iran, Belarus and Cuba weren't on it.

Your account's country doesn't decide it. The request's origin does, and the clearest statement of that is Google's own note for Colab users: restrictions apply "based on the region that the Colab instance is in, not the region that the user is in." That's why a lot of these reports come from people who live in a supported country.

The cases that confuse people

A server somewhere else. A US founder reported on the Gemini CLI tracker that the same AI Studio key worked from US machines and failed from a dev server in Canada. Another team's production servers at a San Jose host all started failing one day while the same key kept working from their development machines. Neither thread got an explanation from Google, and the second was closed as a duplicate of the first.

A VPN you forgot about. One Gemini CLI user in Boston hit it after using a VPN abroad. Any VPN, corporate proxy or relay whose exit is outside the list will do it.

Your key looks fine. A September 2026 report found that listing models with the same key returned 200 while generateContent failed from the blocked server. So a quick "is my key valid" call doesn't rule this out.

What you can do

Find the public IP the request actually leaves from (curl ipinfo.io on that machine, the check Google gives Colab users) and see where it geolocates. If it's in a listed country and the error persists, that's the case the San Jose and Canada threads describe, and changing the server's region is the practical fix.

If the code has to run from an unsupported country, Google's regions page says to "try the Gemini API in Gemini Enterprise Agent Platform," its Google Cloud offering, as the route for people outside the list. The RankPulse team costed that route (they called it Vertex AI) as pay-per-use and needing a Cloud project with billing.

Routing requests through a proxy in a supported country is what some of these threads fall back on. Read the Gemini API terms before doing that with a key you'd mind losing.

For AI Studio in the browser, the same page names two account causes besides region: being under 18, or not having verified your age on the Google Account.

Other lines the same feature prints

Match yours against these if the one at the top of the page is not quite it. They come from the same code and mean related things.

  • 400 User location is not supported for the API use.
  • API Error: User location is not supported for the API use. (Status: FAILED_PRECONDITION)
  • FAILED_PRECONDITION (code 400): User location is not supported for the API use
  • "status": "FAILED_PRECONDITION"