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.
How do I fix the exit region when Gemini says user location is not supported?
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
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
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.
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
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.
Open: 1 spot per week
One labeled sponsor for this topic each week; this week's spot is open. See open weeks →
All tools for “Fix Gemini API User location is not supported” →
Related fixes
- Stop a Cursor agent loopHow to fix a Cursor agent loop (same edit, or work after Stop)Fix →
- Claude Code vs Codex vs Cursor ~$20 plansClaude Code vs Codex vs Cursor $20 plan limits: how to pick without burning the weekFix →
- Scan a vibe-coded app for leaked API keysCheck a vibe-coded app for leaked API keys before you share itFix →
- Add an MCP server to Claude Code, Cursor, or CodexHow to add an MCP server to Claude Code, Cursor, or CodexFix →
See also AI tools launched today on the daily board.
NewAIToolsToday Daily
Top 3 AI launches, one model or news item that matters, and one simple fix. A 5-minute read, every weekday.