Jump to content
CodeRelayHub

Gemini CLI

Gemini runs on its native protocol. Give the CLI the bare host and your token:

bash / zsh
export GOOGLE_GEMINI_BASE_URL=https://api.coderelayhub.com
export GEMINI_API_KEY=crh_paste_your_key_here
gemini

Gemini CLI also reads the same two values from ~/.gemini/.env:

.env (in ~/.gemini)
GOOGLE_GEMINI_BASE_URL=https://api.coderelayhub.com
GEMINI_API_KEY=crh_paste_your_key_here

Native-protocol rules

  • Use the bare host as GOOGLE_GEMINI_BASE_URL and do not append /v1beta.
  • For streaming, call :streamGenerateContent?alt=sse.
  • Gemini models are refused on /v1/chat/completions, and other families are refused on /v1beta.

Gemini model strings: gemini-3.1-pro · gemini-3.8-flash · gemini-4-argon · gemini-2.5-flash