Skip to content
CheapLLM

Connect CheapLLM to Gemini CLI

Google's agent in the terminal. Step-by-step CheapLLM API setup for Gemini CLI to run Claude, GPT-6, Gemini, and DeepSeek up to 70% cheaper.

5 min readUpdated Nov 2026

1. Create a CheapLLM API key

Create a CheapLLM account and generate an API key (sk-clm-YOUR_API_KEY). One key unlocks all 49+ OpenAI, Anthropic, Google, and DeepSeek models at up to 70% off official API rates.

Base URL (Google Gemini API)
https://api.cheapllm.app

2. Install Gemini CLI

Install the official Google Gemini CLI globally via npm.

Terminal
npm install -g @google/gemini-cli

3. Configure ~/.gemini/settings.json

Select API-key auth and point Gemini CLI internal helper aliases to a CheapLLM-served Gemini model: The customAliases map keeps background helper calls (classifier, summarizer, edit-corrector) routed cleanly through CheapLLM.

~/.gemini/settings.json
{
  "security": {
    "auth": {
      "selectedType": "gemini-api-key"
    }
  },
  "model": {
    "name": "gemini-3.1-pro-preview"
  },
  "modelConfigs": {
    "customAliases": {
      "classifier": {
        "extends": "base",
        "modelConfig": {
          "model": "gemini-3.8-flash"
        }
      },
      "prompt-completion": {
        "extends": "base",
        "modelConfig": {
          "model": "gemini-3.8-flash"
        }
      },
      "fast-ack-helper": {
        "extends": "base",
        "modelConfig": {
          "model": "gemini-3.8-flash"
        }
      },
      "edit-corrector": {
        "extends": "base",
        "modelConfig": {
          "model": "gemini-3.8-flash"
        }
      },
      "summarizer-default": {
        "extends": "base",
        "modelConfig": {
          "model": "gemini-3.8-flash"
        }
      },
      "summarizer-shell": {
        "extends": "base",
        "modelConfig": {
          "model": "gemini-3.8-flash"
        }
      }
    }
  }
}

4. Export variables and run

Set GOOGLE_GEMINI_BASE_URL without /v1beta and your GEMINI_API_KEY, then launch gemini:

macOS and Linux
export GOOGLE_GEMINI_BASE_URL="https://api.cheapllm.app"
export GEMINI_API_KEY="sk-clm-YOUR_API_KEY"
gemini
Windows (PowerShell)
$env:GOOGLE_GEMINI_BASE_URL="https://api.cheapllm.app"
$env:GEMINI_API_KEY="sk-clm-YOUR_API_KEY"
gemini

Top models to run in Gemini CLI

All 49+ models →
ModelOfficial (in / out)CheapLLM (in / out)Savings
Claude Opus 5.5$4.00 / $20.00$2.80 / $14.00−30%
GPT-6.1 Sol$2.00 / $10.00$1.40 / $7.00−30%
Gemini 4 Argon$2.00 / $10.00$1.40 / $7.00−30%
DeepSeek V4 Pro 0813$0.11 / $4.44$0.078 / $3.11−30%
← All 55 setup guides