Gemini CLI Integration
Use UnoRouter with the Gemini CLI and any Google GenAI-compatible client. Access Gemini models alongside Claude and GPT.
Overview
Gemini CLI is Google's open-source coding agent that edits files and runs commands straight from your terminal. Set UnoRouter as its base URL and you reach Gemini, Claude, GPT, and every other model through one OpenAI-compatible key instead of a Google-only account.
Quick Config
Drop these values into the client. Your key auto-fills when you are signed in.
Base URL: https://api.unorouter.com
API Key: YOUR_API_KEYCompatibility
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 and set `GOOGLE_GEMINI_BASE_URL` to UnoRouter's 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 to start the session.
bashgemini
$env:GEMINI_API_KEY="YOUR_API_KEY"
$env:GOOGLE_GEMINI_BASE_URL="https://api.unorouter.com"
geminiRecommended models
Free models that work well here. Paste any model id into the client.
Gotchas
- If requests 404, you added a path to the base URL. `GOOGLE_GEMINI_BASE_URL` must be the bare host with no `/v1` suffix; the SDK appends the rest.
- If authentication fails, confirm `GEMINI_API_KEY` in `~/.gemini/.env` is your UnoRouter key and the file is read by your shell session.