How to use Gemini CLI in China? (API proxy / relay setup) #22771
Unanswered
holysheep123
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Gemini CLI cannot connect to
generativelanguage.googleapis.comfrom China:Solution
Use an API relay service that proxies requests through overseas servers.
Option 1: One-command setup
Select Gemini CLI when prompted. It configures the API base URL and key automatically.
Option 2: Manual configuration
Set environment variables:
Or in
~/.gemini/settings.json:{ "apiBaseUrl": "https://api.holysheep.ai/gemini/v1beta", "apiKey": "your_key" }About the relay
HolySheep is an API relay supporting Gemini, Claude, and OpenAI APIs. Pay-as-you-go from ¥10 (~$1.4), no subscription.
The same relay also works for Claude Code, Codex CLI, Aider, Cursor, and other AI coding tools.
Hope this helps!
Beta Was this translation helpful? Give feedback.
All reactions