How to Diagnose FAILED_PRECONDITION (400): User Location Is Not Supported in Google AI & Antigravity
Google AI and Antigravity determine your region using both your Google account country and Google's internal IP geolocation—which often disagrees with generic GeoIP sites. Check the exact two-letter country code Google sees via YouTube's INNERTUBE_CONTEXT_GL field, and verify your routing covers aicode.googleapis.com and daily-cloudcode-pa.googleapis.com.
- Generic IP-check websites frequently report a different country than Google's internal geolocation database.
- You can inspect Google's exact perceived country code in one terminal command using YouTube's INNERTUBE_CONTEXT_GL response.
- Antigravity API traffic hits aicode.googleapis.com and daily-cloudcode-pa.googleapis.com—split-tunnel configs often miss these domains.
- After changing account region or network exit, allow propagation time if the connection briefly flapped.
Why This Error Happens Even in Supported Regions
Developers frequently hit:
FAILED_PRECONDITION (code 400): User location is not supported for the API use.
This happens for three main reasons:
- Google's geolocation disagrees with third-party IP databases: An exit IP may show Kazakhstan or South Korea on standard lookup sites while Google's own table still maps that ASN/subnet to an unsupported region.
- Split-tunnel leak: Your browser routes through the supported region, but desktop IDE background traffic to
aicode.googleapis.comordaily-cloudcode-pa.googleapis.comgoes direct. - Google account region mismatch: Your Google Payments / Play country profile is still pinned to an unsupported country.
Step 1: Check the Exact Country Code Google Sees
Run this one-liner from your terminal to inspect Google's own INNERTUBE_CONTEXT_GL country detection:
curl -4 -sS https://www.youtube.com/ | grep -oE '"INNERTUBE_CONTEXT_GL":"[A-Z]{2}"' | head -n 1
If it returns an unsupported country code, the issue is your network exit—not the IDE.
Step 2: Verify Split-Tunnel Domains
If you use per-domain routing on your workstation, make sure both Antigravity endpoints route through the same supported interface:
aicode.googleapis.comdaily-cloudcode-pa.googleapis.comgenerativelanguage.googleapis.com
Step 3: Check Google Account Country Association
Verify your Google account's region settings in your Google Account profile and wait a few hours if your IP briefly dropped and triggered a temporary region cache.
Frequently Asked Questions
Why does Claude work on my connection while Google AI returns FAILED_PRECONDITION 400?
Anthropic and Google maintain separate IP geolocation databases and account-region checks. An IP subnet accepted by Anthropic can still be mapped to an unsupported country inside Google's internal ASN database.
Primary Sources & Verification
- Google AI Available Regions Documentation — Google AI for Developers