Guide Troubleshooting & Fixes Published 1 min read

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

Quick Answer & Key Takeaways

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:

  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:

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.

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

Related Articles

Guide

The Reasoning Overthinking Trap: Why Medium Effort Often Beats Extra High

Leaving coding agents permanently on Extra High reasoning wastes rate limits and triggers overthinking—such as hand-writing raw XML for an Excel file instead of invoking a library. Match effort to task complexity, compress context before hitting 250k–300k tokens, and instruct agents to use real CLI tools for binary document formats.