Gemini CLI (gateway)

Route Gemini CLI’s LLM calls through the Respan gateway for automatic logging, caching, and model switching. Only your RESPAN_API_KEY is needed.

Setup

1

Install Gemini CLI

$npm install -g @google/gemini-cli
2

Set environment variables

Add to your shell profile (.bashrc, .zshrc, or PowerShell $PROFILE):

$# Gemini API
$export GOOGLE_GEMINI_BASE_URL="https://api.respan.ai/api/google/gemini"
$export GEMINI_API_KEY="YOUR_RESPAN_API_KEY"

No separate Google API key needed — the Respan gateway handles provider authentication.

3

Run Gemini CLI

$gemini "your prompt"

All LLM calls now route through Respan.

Switch models

Once routed through the gateway, you can use any supported Gemini model.

$gemini --model gemini-3.5-flash
$gemini --model gemini-3.1-flash-lite
$gemini --model gemini-3.1-pro-preview

See the full model list.