Blog / Gemini CLI

How to Reduce Token Usage in Gemini CLI

Gemini CLI's Auto routing and automatic caching quietly move your token spend in opposite directions. Here's how to check which model actually ran, and why chasing manual caching can cost more than it saves.

Published August 11, 2026

Retro terminal screen glowing on a keyboard, representing a Gemini CLI session
Photo by Rafael Minguet Delgado on Pexels

Gemini CLI’s pitch is that it handles the model-picking for you — Auto routing decides per request whether the task needs Gemini 3 Pro or can run on Flash, so in theory you never have to think about it. In practice “you never have to think about it” is exactly how a bill gets away from you. I started actually reading what Auto was routing to, instead of assuming it was always doing me a favor, and the picture changed fast.

None of this requires changing how you use Gemini CLI day to day. It’s mostly about knowing which of its automatic behaviors are actually saving you money and which ones just sound like they are.

1. Check which model Auto actually picked

Auto routing comes in two flavors — Auto (Gemini 3), which distributes requests between gemini-3-pro-preview and gemini-3-flash-preview, and Auto (Gemini 2.5), which does the same between the older Pro and Flash pair. It’s a genuinely useful default: Pro-level reasoning for complex work, Flash for everything else, without you manually switching. But “the system decided this was complex enough for Pro” is a decision with a price tag attached, and it’s worth running /model occasionally to see what’s actually being selected rather than assuming Auto always lands on the cheap option. If you’re running a long batch of small, repetitive edits, pinning to Flash manually via /model or the --model flag keeps every one of them off Pro pricing instead of leaving it to the router’s judgment call each time. One caveat worth knowing: neither /model nor --model overrides the model used by sub-agents, so a manual pin doesn’t necessarily apply to every part of a multi-step run.

2. Know which login method actually caches

Gemini CLI’s automatic token caching only applies if you’re authenticated with a Gemini API key or Vertex AI — logging in with a personal or Workspace Google account routes through the Code Assist API instead, which doesn’t currently support cached content at all. If cache savings matter to your usage pattern, that’s a reason to pick API key or Vertex AI auth over the Google-account login, not just a footnote in the docs.

3. Don’t confuse the free caching with the rented kind

This is the one that actually costs people money. Gemini’s implicit caching — the kind Gemini CLI uses automatically — is free, needs no setup, and just requires your prompt to share enough of a prefix with a recent request (2,048+ tokens on Gemini 2.5 models, 4,096+ on Gemini 3.5 Flash) to qualify. Explicit caching is a different thing: something you’d wire up manually through the API, and it bills a per-hour storage fee on top of the reduced read cost — charged whether or not anything actually reads from that cache. On a Flash-tier model, that storage runs about $1.00 per million tokens per hour; cache a million tokens through the explicit API and forget to clear it, and you’ve spent roughly $24 in pure storage rent by the next day, independent of use. Gemini CLI itself doesn’t push you toward explicit caching, but if you’re building something on top of the Gemini API and reach for it assuming it’s just “the caching feature,” check your request volume first — it only pays for itself if you’re reading from that cache often enough to cover the rent.

4. Reserve Pro-tier reasoning for tasks that need it

Thinking tokens are billed as output tokens, at the output rate — the same structure as extended thinking in Claude, and just as easy to underestimate. Current per-million pricing puts Gemini 3.1 Pro Preview at $2.00 input / $12.00 output for prompts under 200K tokens, next to Gemini 3.5 Flash at $1.50/$9.00, Gemini 3.6 Flash at $1.50/$7.50, and Gemini 3.1 Flash-Lite at $0.25/$1.50. A task that pushes Pro into a lot of internal reasoning is paying that $12 output rate for tokens you never see printed, on top of whatever the visible response costs.

5. Use /stats as a checkpoint, not a curiosity

Running /stats shows your session’s token usage alongside cached-token savings, which makes it useful for two different things: catching a session that’s quietly grown expensive, and confirming your caching setup is actually working rather than assuming it is. Checking it mid-session, before a long agentic run, tells you something a post-hoc check can’t — whether you’re about to blow past what the task is worth while there’s still time to change course.

6. Move scripted, bulk work off the interactive session

If part of what you’re doing is genuinely batchable — generating similar output across many files, running the same prompt against a dataset — that doesn’t belong in an interactive Gemini CLI session at standard rates. The Batch API processes asynchronous requests at a flat 50% discount on both input and output tokens, the same discount Claude Code’s Batch API offers for the equivalent case — genuinely non-interactive, non-urgent work sitting inside an interactive loop is money left on the table either way.

7. Skip the screenshot when you mean a specific element

Gemini CLI can take image input the same as any multimodal agent, which makes it tempting to hand it a screenshot for a UI fix and let it figure out the selector. That’s an extra interpretation step it has to get right before it can act, and a wrong guess costs you the retry — and the tokens for the exchange that led up to it.

That’s the exact gap UICuts fills: point at any element on a live page and it copies out the real selector, computed styles, and DOM structure as text, ready to paste into Gemini CLI instead of a screenshot. Same idea whether you’re driving Gemini CLI, Cursor, or anything in the OpenClaw family of agents — no image tokens, no guessing.

Key lessons learned

  • Auto routing is convenient, not automatically cheap — it can and does pick Pro when it judges a task complex enough, so check /model rather than assuming Flash by default.
  • Free (implicit) caching and rented (explicit) caching are not the same feature. Gemini CLI gives you the free one automatically; the paid one only makes sense at real volume.
  • Thinking tokens on Pro-tier models bill as output tokens — the same trap as extended thinking in Claude Code, just under a different name.

The Auto-routing/model-choice lever shows up under a different name in almost every agent: Claude Code has manual /model switching, Cursor has Agent mode versus Chat, Windsurf has its own frontier-vs-lighter-model tradeoff, and OpenCode leans on provider flexibility to do the same job manually. If you want the full dollar-and-cents breakdown of how caching, thinking tokens, and model tiers add up in practice, Stop Burning Your Tokens in Claude Code covers the same math for Anthropic’s models. Full details on Gemini’s routing and caching behavior are in Gemini CLI’s own model docs and Google’s caching documentation if you want the primary source.

Install UICuts free if UI feedback is part of your Gemini CLI workflow — thirty seconds to install, no account required.

Frequently asked

Does Gemini CLI cache tokens automatically? +

Yes, if you're authenticated with a Gemini API key or Vertex AI — that's implicit caching, on by default for Gemini 2.5 and newer models, and Google passes the discount through automatically whenever a request hits the cache. It does not work if you're logged in with a personal or Workspace Google account, since the Code Assist API behind that login path doesn't support cached content.

What's the difference between implicit and explicit caching in Gemini CLI? +

Implicit caching is automatic, free to enable, and requires no setup — it just needs your prompt to share enough of a prefix with a recent one (2,048+ tokens on Gemini 2.5 models, 4,096+ on Gemini 3.5 Flash). Explicit caching is something you'd set up manually through the API, and it comes with a per-hour storage rental fee charged whether or not anything reads from the cache. Gemini CLI's built-in caching is the implicit, free kind — you don't need to reach for explicit caching unless you're building a high-volume integration on top of the API yourself.

Does Gemini CLI's Auto routing always pick the cheaper model? +

No — it picks whichever model it judges the prompt needs, which for a genuinely complex task is Gemini 3 Pro, priced well above Flash. Auto is a reasonable default, but if you're doing a long run of simple, repetitive edits, manually pinning to Flash with /model keeps every one of those requests off Pro pricing instead of hoping the router agrees they're simple.

Are thinking tokens billed differently in Gemini CLI? +

They're billed as output tokens, at the output rate — same principle as Claude's extended thinking. On a reasoning-heavy model like Gemini 3.1 Pro Preview, that means a task that triggers a lot of internal reasoning can cost noticeably more than the visible response length would suggest.

Can I use the Batch API from inside Gemini CLI? +

Not directly — Gemini CLI is an interactive tool, and the Batch API is for asynchronous requests sent outside that loop. It matters if you're also scripting bulk Gemini usage elsewhere (generating docs for many files, running the same prompt across a dataset): route that through the Batch API for the 50% discount instead of paying interactive rates for non-interactive work.

Is Gemini CLI free to use? +

There's a free tier either way you authenticate: 1,000 requests/day signed in with a personal Google account, or 250 requests/day on an unpaid API key restricted to Flash models. Google AI Pro raises that to 1,500 requests/day and Ultra to 2,000, both still bounded by a daily request ceiling rather than a token budget.

Keep reading

Less guessing.
Faster fixes!

Stop burning time on vague prompts and AI retries that miss the point.

Start using UICuts

Free plan available · No credit card · 30-second setup