Gemini CLI with ShareQuota
Gemini CLI reads a base URL and a key from the environment. Two exports and it is talking to the proxy, which serves the Google dialect on its own path.
Gemini CLI honours GOOGLE_GEMINI_BASE_URL and GEMINI_API_KEY. Set the first to the local endpoint and the second to your sq- key and the tool sends its generateContent requests to the proxy, which forwards them to the Gemini account you connected — or translates them for another provider when the model id says so.
Setup
- 1Start the proxy and connect a planRun the binary, open the dashboard, and sign in to your Google account, or paste a Gemini API key.
- 2Export the two variablesSet the base URL and the key in your shell profile. The dashboard’s one-click switch sets the same two for you.
- 3Run gemini with a model idStart gemini with a routed model. A gemini- prefixed id lands on the Gemini connection; a provider prefix routes elsewhere.
What to set
export GOOGLE_GEMINI_BASE_URL="http://localhost:20130"export GEMINI_API_KEY="sq-your-internal-key"gemini --model gemini/gemini-3.1-pro-previewWorth knowing
- One pair is unfinished: a Gemini subscription login streamed through the Anthropic dialect answers 501. Gemini CLI speaks the Google dialect, so it is not affected; the limitations page lists it.
To undo it
Remove the entries above, or turn the integration off in the dashboard and the backup is restored. Nothing else was written.
Questions
Whichever you connected. The free tier is real quota too, and the proxy will spend it before failing over to another connection.
Checked against the tool’s own documentation on 2026-09-13. Settings move; if a field has been renamed, the docs link above is the source.