Skip to main content
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 least GEMINI_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:
Windows PowerShell:
If you would like this to take effect automatically each time you open the terminal, write it into ~/.gemini/.env or the PowerShell profile.

Configuration File

Edit ~/.gemini/settings.json:
Note:
  • Do not keep the authentication method as oauth-personal, or the CLI will continue to use Google login.
  • Do not write model as a string; in the current version, model.name should be used.
  • Only specifying settings.json is sometimes insufficient—CLI mode may still require the GEMINI_API_KEY environment variable.

.gemini/.env Example

You can also write directly to ~/.gemini/.env:

Launch

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.