Gemini CLI
This service supports the Gemini-compatible interface required by Gemini CLI.
Prerequisites
Gemini CLI is installed via npm, so you need:
Node.js 18+npm(usually installed with Node.js)
Install Node.js from the official page: https://nodejs.org/en/download
- macOS / Windows: download and install the
LTSrelease - Linux: use the distro-specific method listed on that page
On macOS with Homebrew:
brew install nodeVerify your environment:
node -v
npm -vInstall
npm install -g @google/gemini-cliVerify the install:
gemini --versionConfigure
Gemini CLI supports three environment variables for connecting to a custom gateway:
| Variable | Description |
|---|---|
GOOGLE_GEMINI_BASE_URL | Gateway root URL, replaces the default Google endpoint |
GEMINI_API_KEY | Your API key |
GEMINI_MODEL | Default model to use |
Configuration example:
export GOOGLE_GEMINI_BASE_URL="https://codex.openai.com"
export GEMINI_API_KEY="codex_your_api_key"
export GEMINI_MODEL="gemini-2.5-pro"Use the service root in GOOGLE_GEMINI_BASE_URL, not a full API path. Gemini CLI appends the API paths automatically.
To make this permanent, add the export statements to your shell profile (~/.zshrc or ~/.bashrc), then reload it with source ~/.zshrc.
Launch
geminiVerify
Start a conversation in Gemini CLI. If you receive a normal response, the setup is working.
If you see an auth error, check that GEMINI_API_KEY is correct and GOOGLE_GEMINI_BASE_URL points to the right service address.