Content updated: 2026-06-09
Overview
Gemini CLI is Google’s command-line AI assistant. By configuring Crazyrouter’s native Gemini endpoint, you can directly use Gemini models (already validated in our production environment with real requests) from the command line.Configuration Method
Environment Variables
In its current version, Gemini CLI in API Key mode requires at leastGEMINI_API_KEY to be set explicitly. If you want to connect to Crazyrouter’s native Gemini endpoint, it is recommended to set these 3 environment variables:
~/.gemini/.env or the PowerShell profile.
Configuration File
Edit~/.gemini/settings.json:
- Do not keep the authentication method as
oauth-personal, or the CLI will continue to use Google login. - Do not write
modelas a string; in the current version,model.nameshould be used. - Only specifying
settings.jsonis sometimes insufficient—CLI mode may still require theGEMINI_API_KEYenvironment variable.
.gemini/.env Example
You can also write directly to ~/.gemini/.env:
Launch
Recommended Models
Crazyrouter supports both Gemini native API format and OpenAI-compatible format. Gemini CLI uses the Gemini native format. The
gemini-3.1-pro and gemini-api-key authentication methods, as well as GOOGLE_GEMINI_BASE_URL=https://api.crazyrouter.com documented here, have all been verified through real CLI requests.