Random Gemini 400 errors on Cloudflare Workers traced to HKG datacenter routing
sujingshen · x · 2026-10-12
A developer's writeup on random "User location is not supported" 400 errors when calling Gemini from Cloudflare Workers.
- Root cause: Gemini checks the egress IP of the machine making the request—the datacenter the Worker runs in—not the API key's region or the end user's location. Mainland China and Hong Kong are unsupported; requests routed to HKG fail.
- Why intermittent: Cloudflare routing varies. A Korean developer alternated between NRT (works) and HKG (fails); a Melbourne user hit a Worker 4,600 miles away in HKG; similar reports from the Philippines and Vietnam.
- Pitfall: Cloudflare AI Gateway does not fix it—same region error.
- Diagnosis: check the datacenter code at the end of the cf-ray response header (e.g. -HKG).
More from Infra
- OpenAI chip head Richard Ho on Jalapeno: why Broadcom beat Nvidia and AMD as partner — richardjnieva · 2026-10-12
- Bittensor's TPN Labs ships first model TPN005, cutting base size ~40% with 32k context intact — const_reborn · 2026-10-12
- Microsoft to scale in-house Maia AI chips to multi-gigawatt inference by 2027 — The Decoder · 2026-10-12
- Microsoft plans huge deployment of its own AI chips to cut costs — pstAsiatech · 2026-10-12
- Ragged KV cuts Looped LM inference FLOPs by 25% with no retraining — DanielKhashabi · 2026-10-12
- NVIDIA's ELR removes the one-loop tax: Koi-4B scores 18 at one loop, 29 at four loops — nvidia · 2026-10-12