Gemini CLI
Gemini CLI Integration
Use UnoRouter with the Gemini CLI and any Google GenAI-compatible client.
Overview
Gemini CLI is Google's open-source coding agent that edits files and runs commands from your terminal. Set UnoRouter as its base URL to reach every model through one OpenAI-compatible key instead of a Google-only account.
Quick Config
Paste these into the client. Your key auto-fills when signed in.
text
Base URL: https://api.unorouter.com
API Key: YOUR_API_KEYCompatibility
Chat CompletionsStreamingTool callingImage input
Step-by-step setup
- 1Install Gemini CLI
Install the Gemini CLI globally with npm. On Windows, run this inside WSL.
bashnpm install -g @google/gemini-cli - 2Set environment variables
Create `~/.gemini/.env` with your UnoRouter API key. Set `GOOGLE_GEMINI_BASE_URL` to the bare base URL. The Gemini SDK appends its own path, so do not add `/v1`.
bash# ~/.gemini/.env GEMINI_API_KEY=YOUR_API_KEY GOOGLE_GEMINI_BASE_URL=https://api.unorouter.com - 3Launch Gemini
Run `gemini` in your project directory.
bashgemini
powershell
$env:GEMINI_API_KEY="YOUR_API_KEY"
$env:GOOGLE_GEMINI_BASE_URL="https://api.unorouter.com"
geminiRecommended models
Free models that work here. Paste any model id into the client.
glm-5.3-search:freeglm-5.3-think-search:freeglm-5.3-thinking:freeglm-5.3:freeqwen-3.8-27b:free
Gotchas
- A 404 means the base URL has a path on it. `GOOGLE_GEMINI_BASE_URL` must be the bare host with no `/v1` suffix; the SDK appends the rest.
- On auth failure, confirm `GEMINI_API_KEY` in `~/.gemini/.env` is your UnoRouter key and that your shell reads the file.