The 2026 change to the Gemini CLI free tier
Read this first. Google changed the free use of Gemini CLI in 2026. The Gemini CLI quota page says: "Unpaid tier and Google One users: Gemini CLI was replaced by Antigravity CLI on June 18th, 2026."
Google's announcement says that Gemini CLI stays available through paid Gemini API keys and for enterprise customers.
- Google login on the free tier: no longer served by Gemini CLI for consumer accounts.
- Gemini API key with a custom base URL: the Gemini CLI configuration reference still documents
GOOGLE_GEMINI_BASE_URL. With this variable, Gemini CLI sends its requests to the URL that you set, not to Google. - Free Gemini API keys: Google AI Studio still lists a free tier for the Gemini API. FreeLLMAPI can use those keys, together with keys from other providers.
This guide uses the second method. FreeLLMAPI answers the requests and sends each one to a free model in your pool.
Step 1: Install FreeLLMAPI and Gemini CLI
Install both
curl -fsSL https://freellmapi.co/install.sh | bash
npm install -g @google/gemini-cliOpen http://localhost:3001. Add at least two free provider keys on the Keys page. A free Google AI Studio key is a good first key. Copy your unified key from the same page.
Step 2: Point Gemini CLI at the gateway
Set two environment variables and start Gemini CLI. The base URL is the server origin, without /v1beta. Gemini CLI adds the API path itself.
macOS or Linux
export GOOGLE_GEMINI_BASE_URL=http://localhost:3001
export GEMINI_API_KEY=<unified-key>
geminiWindows PowerShell
$env:GOOGLE_GEMINI_BASE_URL="http://localhost:3001"
$env:GEMINI_API_KEY="<unified-key>"
geminiWhen Gemini CLI asks for an authentication method, select Use Gemini API key. To save the choice, set it in ~/.gemini/settings.json:
~/.gemini/settings.json
{
"security": {
"auth": {
"selectedType": "gemini-api-key"
}
}
}GEMINI_API_KEY. A Gemini CLI issue reports that version 0.44.x fails with "Invalid auth method selected" when GOOGLE_API_KEY is used with GOOGLE_GEMINI_BASE_URL. If GOOGLE_API_KEY is set, remove it with unset GOOGLE_API_KEY.Step 3: Map Gemini model names to free models
Gemini CLI asks for Gemini model names, for example gemini-2.5-flash. FreeLLMAPI does not send these names to Google directly. It resolves them through the Gemini family map on the Keys, Agents tab. Map each family (Pro, Flash and Flash-Lite) to Auto or to a pinned catalog model.
- With Auto, the router selects a free model for each request. When one provider sends a 429 error, it tries the next one.
- Catalog ids also work as model names. Start Gemini CLI with
gemini -m <catalog-id>, or setGEMINI_MODEL. - Gemini CLI is an agent with tools. Map the families to models with tool calling and a large context window.
The first table shows the free Gemini models in the catalog today. The second table shows other free models that you can map to a Gemini family.
| Model | Free on | Context | Free limits (best offer) | Tools | Vision |
|---|---|---|---|---|---|
| Gemini 3.8 Flash | Google AI Studio | 1M | Recurring provider quota | Yes | Yes |
| Gemini Flash (latest alias) | Google AI Studio | - | 10 req/min 20 req/day 250,000 tokens/min ~3M | Yes | Yes |
| Gemini 3.7 Flash | Google AI Studio | 1M | 10 req/min 20 req/day 250,000 tokens/min ~3M | Yes | Yes |
| Gemini 3.6 Flash | Google AI Studio | 1M | 10 req/min 20 req/day 250,000 tokens/min ~3M | Yes | Yes |
| Gemini 3.5 Flash | Google AI Studio | 1M | 10 req/min 20 req/day 250,000 tokens/min ~3M | Yes | Yes |
| Gemini 3.8 Live | Google AI Studio | - | 10 req/min 20 req/day 250,000 tokens/min ~3M | Yes | Yes |
| Gemini 3.8 Live Extended Thinking | Google AI Studio | - | 10 req/min 20 req/day 250,000 tokens/min ~3M | Yes | Yes |
| Gemini 3.5 Flash Lite | Google AI Studio | 1M | 15 req/min 20 req/day 250,000 tokens/min ~3M | Yes | Yes |
Showing 8 of 14 matching free models. See all models.
Live data from the FreeLLMAPI catalog (version 2026.11.19, checked 19 November 2026). Free limits change often. The catalog is checked every day.
| Model | Free on | Context | Free limits (best offer) | Tools | Vision |
|---|---|---|---|---|---|
| GLM 5.3 | UnoRouter | 1M | 1 req/min 1 req/min per model | Yes | No |
| GLM 5.3 Flash | NVIDIA NIM, UnoRouter | 1M | 40 req/min 40 RPM | Yes | Yes |
| Qwen3.8 Flash Next | AMD Radeon Cloud | 262K | Recurring daily account allowance | Yes | No |
| Qwen3.8 Flash | ElectronHub | 1M | $0.25/week shared recurring credit | Yes | Yes |
| GPT-5.6 Luna | ElectronHub | 1M | $0.25/week shared recurring credit | Yes | Yes |
| Dots3 Note Preview | Kilo Gateway, OpenRouter | 512K | 20 req/min 50 req/day 50 req/day account-wide (1,000 after a $10 purchase) | Yes | Yes |
| DeepSeek V4 Flash | AMD Radeon Cloud, BazaarLink, ElectronHub | 1M | 10 req/min 50 req/day Shared rate limit | Yes | No |
| Qwen3.8 27B | ElectronHub, Groq, OVH AI Endpoints | 262K | 30 req/min 250 req/day 70,000 tokens/min ~6M | Yes | Yes |
Showing 8 of 104 matching free models. See all models.
Live data from the FreeLLMAPI catalog (version 2026.11.19, checked 19 November 2026). Free limits change often. The catalog is checked every day.
Gemini free tier limits
Google's rate limit page says that limits apply per project, not per API key. More keys in one project do not give more quota. Google also says that limits are not guaranteed and that you can see your current limits in Google AI Studio. Preview models have lower limits.
A free Gemini Flash key allows few requests per day. One Gemini CLI task can send many requests. Add keys from other providers, so the router can continue when the Gemini quota stops. The native surface supports generateContent, streamGenerateContent with ?alt=sse, countTokens and the models list.
FreeLLMAPI accepts the key in the x-goog-api-key header, as a Bearer token or in Gemini's ?key= query parameter. Prefer a header, because a key in a URL can leak into shell history and proxy logs.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Gemini CLI opens a Google login | The auth type is not set to Gemini API key | Select Use Gemini API key, or set security.auth.selectedType |
| "Invalid auth method selected" | GOOGLE_API_KEY is used with a custom base URL | Use GEMINI_API_KEY and unset GOOGLE_API_KEY |
| Requests go to Google, not to the gateway | GOOGLE_GEMINI_BASE_URL is not set in this shell | Export the variable, then start gemini again |
404 on model calls | The base URL includes /v1beta | Use the origin http://localhost:3001 only |
| Tool calls fail | The Gemini family maps to a model with weak tool calling | Map the family to a model from the tables above |
| "All models rate-limited after N attempts" | All keys are at their limit | Add keys from more providers, or wait for the cooldowns |
Frequently asked questions
Is Gemini CLI still free?
Google ended free Gemini CLI use with a Google login for unpaid and Google One users on 18 June 2026. The CLI still supports a custom base URL, so it can run on a free gateway such as FreeLLMAPI.
How do I use Gemini CLI with a custom endpoint?
Set GOOGLE_GEMINI_BASE_URL to the endpoint origin and GEMINI_API_KEY to its key, then select Use Gemini API key. The endpoint must speak the native Gemini API on /v1beta.
Can Gemini CLI use models that are not Gemini?
Yes, through FreeLLMAPI. The gateway maps the Gemini Pro, Flash and Flash-Lite family names to Auto or to any catalog model, for example a Qwen or GLM model.
What are the Gemini API free tier limits?
Google sets the limits per project, not per key, and shows the current values in Google AI Studio. The table on this page shows today's free Gemini models and their limits from the FreeLLMAPI catalog.
Why do I get 'Invalid auth method selected'?
A Gemini CLI issue reports this error in version 0.44.x when GOOGLE_API_KEY is used with GOOGLE_GEMINI_BASE_URL. Use GEMINI_API_KEY and unset GOOGLE_API_KEY.
Related guides
- free gemini api
- Gemini API quota exceeded (429 RESOURCE_EXHAUSTED)
- How to use Claude Code for free
- Use Codex CLI with free models
- Best free coding model APIs
Sources
- Gemini CLI docs: configuration reference (checked 20 November 2026)
- Gemini CLI docs: authentication (checked 20 November 2026)
- Gemini CLI docs: quota and pricing (checked 20 November 2026)
- Google Developers Blog: transitioning Gemini CLI to Antigravity CLI (checked 20 November 2026)
- Gemini CLI issue 27550: auth with a custom base URL (checked 20 November 2026)
- Google AI Studio: rate limits (checked 20 November 2026)
- FreeLLMAPI docs: native Gemini API (checked 20 November 2026)