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.
Paste this into your coding agent:
Help me set up the Respan gateway with the Gemini CLI integration.
Follow https://www.respan.ai/docs/integrations/gateway/gemini-cli.mdSetup
Install Gemini CLI
npm install -g @google/gemini-cliSet environment variables
Add to your shell profile (.bashrc, .zshrc, or PowerShell $PROFILE):
# Gemini API
export GOOGLE_GEMINI_BASE_URL="https://gateway.respan.ai"
export GEMINI_API_KEY="YOUR_RESPAN_API_KEY"No separate Google API key needed. The Respan gateway handles provider authentication.
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-previewSee the full model list .