Point Gemini CLI at Crazyrouter
Crazyrouter serves the Gemini-native API, so Gemini CLI works with a base URL override and your Crazyrouter key — no Google Cloud project required.

Manual configuration
Set GEMINI_API_KEY, GEMINI_MODEL and GOOGLE_GEMINI_BASE_URL together; in the current CLI release API-key mode still needs GEMINI_API_KEY even when settings.json is configured.
Environment (all three are required)
export GEMINI_API_KEY=sk-your-crazyrouter-key export GEMINI_MODEL=gemini-3.1-pro export GOOGLE_GEMINI_BASE_URL=https://api.crazyrouter.com
Gemini CLI uses the Gemini-native API, so the base URL is the root domain — no /v1, no /v1beta.
Or ~/.gemini/.env
GEMINI_API_KEY=sk-your-crazyrouter-key GEMINI_MODEL=gemini-3.1-pro GOOGLE_GEMINI_BASE_URL=https://api.crazyrouter.com
https://api.crazyrouter.com — This tool speaks a vendor-native protocol and appends its own path. Use the root domain exactly as shown — no /v1.
Recommended models
Live Crazyrouter prices, refreshed hourly. Any model in the catalogue works; these are the ones we'd start with.
FAQ
Which auth mode?
gemini-api-key. Skip the Google login flow entirely.
settings.json alone doesn't work
Known CLI behaviour: headless and some interactive paths still read GEMINI_API_KEY from the environment. Keep the env var set.
Can I use non-Gemini models?
Gemini CLI only speaks the Gemini protocol, so stick to Gemini models here; use Claude Code or Codex for other families.
Guides and comparisons
GuideAI Coding Tools ROI Calculator: Claude Code vs Codex CLI vs Gemini CLI Cost Analysis 2026
A comprehensive ROI framework for evaluating AI coding tools in 2026. Compare Claude Code, Codex CLI, and Gemini CLI on cost per task, productivity gains, and total cost of ownersh
ComparisonClaude Code vs Codex vs Gemini CLI: Which AI Coding Tool Wins in 2026?
An in-depth comparison of the three leading AI coding assistants — Claude Code, OpenAI Codex, and Gemini CLI. We compare features, pricing, performance, and show you how to use all
TutorialGemini CLI Complete Guide 2026: Installation, Workflows, and API Patterns
Install and evaluate Gemini CLI, compare it with Claude Code and Codex CLI, and connect reliable Gemini API workflows to your developer tools.
Podcast
AI Dev Tools: The Crazyrouter Podcast
Short episodes for developers on AI APIs, gateways, cost control and coding tools.
Latest episodes
EP196 · Oct 29, 2026 · 6:53
AI API Security Posture — Turn Controls Into Continuous Evidence
A practical guide to AI API security posture: inventory exposure, verify controls continuously, protect keys and data, constrain tools, and turn security assumptions into evidence that operators can act on.
EP195 · Oct 28, 2026 · 7:21
AI API Policy Drift — Detect When Production Rules Stop Matching Intent
A practical guide to policy drift in AI APIs: version routing and safety rules, detect stale enforcement, compare intended and observed behavior, and restore control before small gaps become incidents.