Gemini CLI

Point Google's Gemini CLI at this platform's Gemini-compatible endpoint with GOOGLE_GEMINI_BASE_URL and GEMINI_API_KEY

Gemini CLI is Google's AI assistant for the terminal; it speaks the Gemini API. These steps were checked against Gemini CLI 0.68.0 (released 2026-11-10) and the official configuration docs.

Get an API key#

Create one at qd.zsopc.com/dashboard/keys (sk-gpushare- plus 64 hex characters; you can re-reveal it on its detail page at any time).

Setup#

npm install -g @google/gemini-cli

export GOOGLE_GEMINI_BASE_URL="https://qd.zsopc.com"   # no /v1beta
export GEMINI_API_KEY="sk-gpushare-xxx"
export GEMINI_MODEL="gemini-3.1-pro-low"

Put these three lines in ~/.zshrc / ~/.bashrc. Gemini CLI also reads .env files, but only the first one it finds, and in an untrusted workspace it loads only key-type variables, so the base URL may be skipped.

Then pin the auth method in ~/.gemini/settings.json (merge it in if the file already exists):

{
  "security": { "auth": { "selectedType": "gemini-api-key" } }
}

Run gemini; if the interactive UI asks how to authenticate, pick Use Gemini API key. Non-interactive use: gemini -p "hello".

Key points:

  • GOOGLE_GEMINI_BASE_URL takes just the domain; Gemini CLI adds the v1beta version itself, so requests go to https://qd.zsopc.com/v1beta/models/{model}:.... The address must be HTTPS.
  • The variable only applies to the gemini-api-key auth method, which is why selectedType goes in settings.json; without it, non-interactive mode may fail with Invalid auth method selected.

Choosing a model#

Gemini CLI speaks the native Gemini protocol, so use Gemini models:

JobModel
Default / hard tasksgemini-3.1-pro-low, gemini-4-argon
Fast, cheapergemini-3.8-flash

Model precedence: the -m / --model flag > the GEMINI_MODEL environment variable > model.name in settings.json > the default auto. auto resolves to Google's own model names, so always name an ID from our catalog explicitly; full list in Models.

Some of Gemini CLI's internal helper calls (completion, classification and the like) always use Google model names such as gemini-2.5-flash-lite. This platform maps those legacy names to the matching catalog model and bills them as that model.

Things to know#

  • When a model errors, Gemini CLI asks by default whether to switch to a fallback model; the fallback is billed through this platform as well.
  • privacy.usageStatisticsEnabled (default true) controls Gemini CLI's own usage statistics; set it to false in settings.json if you don't want them sent.
  • Gemini CLI can also connect MCP servers. For this platform's image, video and music tools, see MCP media tools.

Troubleshooting#

SymptomWhat to check
Still calling Google's address / asks you to sign inGOOGLE_GEMINI_BASE_URL isn't set in this terminal, or selectedType in settings.json isn't gemini-api-key
401 UNAUTHENTICATEDWhether GEMINI_API_KEY holds the full sk-gpushare- key (76 characters)
400 NOT_FOUNDThe model ID isn't in the catalog — use a Gemini model from the table above
503 UNAVAILABLEThe model has no channel on the native Gemini protocol — switch to a Gemini model
402 RESOURCE_EXHAUSTEDBalance exhausted. Every key shares one account balance — top up on the Top up page

Full error reference: Gemini SDK and Error codes.

Other clients#

  • Claude Code — Anthropic's terminal coding assistant
  • Codex CLI — OpenAI's terminal coding assistant
  • Gemini SDK — call the Gemini protocol from your own code