# How to Diagnose FAILED_PRECONDITION (400): User Location Is Not Supported in Google AI & Antigravity

- **URL:** https://dottheais.com/guides/fix-antigravity-failed-precondition-400-user-location-not-supported
- **Published:** 2026-12-06
- **Updated:** 2026-12-06
- **Topic:** Troubleshooting & Fixes

## Quick Answer

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.

## Key Takeaways

- 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:

```text
FAILED_PRECONDITION (code 400): User location is not supported for the API use.
```

This happens for three main reasons:

1. **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.
2. **Split-tunnel leak:** Your browser routes through the supported region, but desktop IDE background traffic to `aicode.googleapis.com` or `daily-cloudcode-pa.googleapis.com` goes direct.
3. **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:

```bash
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.com`
- `daily-cloudcode-pa.googleapis.com`
- `generativelanguage.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.

## Primary Sources

- [Google AI Available Regions Documentation](https://ai.google.dev/gemini-api/docs/available-regions)
