Google's Gemini API is not available in China, Russia, or Iran. The restriction is enforced at the API level through IP geolocation. For developers who need Gemini CLI for code generation, analysis, or automation, using it from China requires a VPN that provides a clean, non-China IP address.
How Google Restricts Gemini Access
Google's approach differs from Anthropic and OpenAI. Rather than aggressively banning accounts, Google simply rejects API requests from restricted regions. You will see an error like "This API is not available in your region" rather than an account suspension.
However, persistent access attempts from China IPs can trigger broader Google Cloud account reviews. If your Google Cloud account shows a pattern of connections from China, it could affect your access to other Google Cloud services.
VPN Requirements for Gemini CLI
The requirements are similar to other AI CLI tools:
- TUN mode: Gemini CLI makes system-level API calls. Browser VPN extensions do not capture this traffic.
- Clean IP: Your VPN IP should resolve to Singapore (or another non-restricted country) in Google's geolocation database.
- Kill switch: Prevents accidental exposure of China IP during VPN reconnections.
- Consistent location: Avoid frequently changing server locations. Pick Singapore and stay on it.
Setup Steps
- Connect VPN (TUN mode + kill switch)
- Verify IP:
curl ifconfig.meshould show Singapore IP - Test API access:
gemini generate "hello world test" - If successful, proceed with normal development workflow
- Always close Gemini CLI before disconnecting VPN
Troubleshooting
If Gemini CLI returns "region not supported" errors:
- Verify your public IP is not from a restricted region
- Check that the IP is not on a commercial VPN blocklist
- Clear any cached authentication tokens and re-authenticate
- Ensure your Google Cloud project billing region is set to a non-restricted country
Key difference from Anthropic/OpenAI: Google's enforcement is less aggressive but still requires careful VPN configuration. The API check is per-request, so any single request from a China IP can fail and potentially flag your account for review.