Connect Gemini CLI to 211API
Two environment variables and you're connected: Gemini CLI requests are relayed through 211API — ideal for high-frequency, low-latency light calls.
Prerequisites
- A 211API account with an API Key created in the console (starts with
sk-). - Node.js 18 or later installed locally.
Step 1 · Install Gemini CLI
npm install -g @google/gemini-cliStep 2 · Set environment variables
Point the API key and endpoint at 211API. macOS / Linux (bash / zsh):
# Add to ~/.zshrc or ~/.bashrc for persistence
export GEMINI_API_KEY="sk-your-211API-key"
export GOOGLE_GEMINI_BASE_URL="https://www.211api.com/v1"Windows (PowerShell):
$env:GEMINI_API_KEY = "sk-your-211API-key"
$env:GOOGLE_GEMINI_BASE_URL = "https://www.211api.com/v1"
# Persist at user level:
# setx GEMINI_API_KEY "sk-your-211API-key"Note
Available models and exact names follow the 211API console "Models" list. If the tool supports specifying a model, fill in the name from that list.
Step 3 · Launch & verify
Start Gemini CLI in your project directory and ask a simple question to confirm the pipeline:
cd your-project
gemini
# Inside the session:
Describe this project's structure in one sentenceA normal response means you're connected. Call logs, token usage and multiplier details are visible in the 211API console in real time.
FAQ
Still hitting the official endpoint — Confirm GOOGLE_GEMINI_BASE_URL is active in the current terminal session (setx needs a new terminal), and check it isn't overridden by another config file.
401 auth failure — Make sure GEMINI_API_KEY holds a key created in the 211API console, not a Google AI Studio key.