Submit a toolSubmit

Gemini API says User location is not supported. Fix the request’s exit region

HTTP 400: User location is not supported for the API use. Move the caller’s exit IP to a supported region, or report a misclassified IP. Short answer: 5 steps. 1) Confirm it is the location FAILED_PRECONDITION, not billing; 2) Check the machine that sends the request; 3) Compare that IP’s country to the official list; 4) If the country is listed but still fails, report the IP; 5) Retest with a minimal generateContent call from the fixed network.

Last updated: · This page is the decision checklist; the tools list for “Fix Gemini API User location is not supported” is a separate URL.

The problem: HTTP 400: User location is not supported for the API use. Move the caller’s exit IP to a supported region, or report a misclassified IP.

How do I fix the exit region when Gemini says user location is not supported?

  1. Confirm it is the location FAILED_PRECONDITION, not billing

    Read the message: User location is not supported for the API use is different from free-tier/billing FAILED_PRECONDITION or 403 PERMISSION_DENIED for project verification. Don’t retry blindly—400 location and billing errors won’t clear with backoff. Error codes: https://ai.google.dev/gemini-api/docs/api-errors

  2. Check the machine that sends the request

    Location is judged from the exit IP of the process that hits generativelanguage.googleapis.com: your laptop, a cloud VM, a proxy, or a Colab runtime—not the country shown in your browser. In Colab, Google notes the Colab instance region matters; you can check with curl ipinfo.io. Available regions: https://ai.google.dev/gemini-api/docs/available-regions

  3. Compare that IP’s country to the official list

    Open Google’s available-regions page for the Gemini API / AI Studio. If the exit country isn’t listed, run the call from a supported region (different network, hotspot, or a server in a listed country). Turn off VPN, proxy, or Private Relay that egresses elsewhere.

  4. If the country is listed but still fails, report the IP

    Cloud egress can be mis-geolocated. Follow Google’s troubleshooting guidance for AI Studio / Gemini API location issues and use their location issue report form with the public IP that fails. Troubleshooting: https://ai.google.dev/gemini-api/docs/troubleshooting

  5. Retest with a minimal generateContent call from the fixed network

    From the corrected exit, call a current model with a one-line prompt. Only after that succeeds, put the same key back into your app or agent. Creating a new key in the same project does not change regional eligibility.

Which tools are best to fix Gemini API User location is not supported?

Available regions

Official Gemini API / AI Studio country and territory list; Colab uses the instance region.

API errors

Maps failed_precondition and other codes so you don’t retry a location block like a 429.

Troubleshooting guide

Project restriction, verification, and recovery steps when access is blocked.

Google AI Studio

Create keys and confirm the project can call models once egress is in a supported region.

All tools for “Fix Gemini API User location is not supported” →

Related fixes

See also AI tools launched today on the daily board.