Search docs...

Start typing to search documentation

Gemini
Gemini CLI

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.

text
Base URL: https://api.unorouter.com
API Key: YOUR_API_KEY

Sign in to auto-fill your API key

Compatibility

Chat CompletionsStreamingTool callingImage input

Step-by-step setup

  1. 1
    Install Gemini CLI

    Install the Gemini CLI globally with npm. On Windows, run this inside WSL.

    bash
    npm install -g @google/gemini-cli

    Sign in to auto-fill your API key

  2. 2
    Set 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

    Sign in to auto-fill your API key

  3. 3
    Launch Gemini

    Run `gemini` in your project directory to start the session.

powershell
$env:GEMINI_API_KEY="YOUR_API_KEY"
$env:GOOGLE_GEMINI_BASE_URL="https://api.unorouter.com"

gemini

Sign in to auto-fill your API key

Recommended models

Free models that work well here. Paste any model id into the client.

mistral-large-2512qwen3.5-9bmistral-medium-3.5qwq-32bqwen3.5-397b-a17b

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.
Generate API KeyModels