Guides / track llm cost gemini
How to track LLM cost on Gemini
Gemini can be reached two ways, through its native API or through an OpenAI-compatible endpoint, and the two carry usage in different fields. Culpa, a local-first LLM cost, margin, and forecast ledger, reads whichever shape arrives, and the route you chose decides which counts are available to price, thinking tokens most of all.
Why this happens
Most providers offer one response shape. Gemini offers two doors into the same models, and they don't describe usage the same way. The native shape carries a usage block with its own field names, including a count for thinking tokens and a model version that can differ from what you asked for. The compatible endpoint speaks the OpenAI shape instead. Whether a given field survives that translation is a property of the endpoint rather than of your ledger, which makes it something to check rather than assume.
What this usually looks like
- Nobody can say which Gemini endpoint your application actually calls.
- You run a thinking model and no reasoning-token count appears anywhere in your data.
- Streamed Gemini responses parse inconsistently across your tooling.
- Your Gemini costs reconcile on short prompts and drift on long or reasoning-heavy ones.
Free, no card, no account
Run the free Cost Leak Scan
It shows your most expensive conversation before you install anything.
Mistakes that cost the most
| Mistake | Why it hurts | Do instead |
|---|---|---|
| Assuming both Gemini routes report identical usage detail. | They carry different field names, and a field that never arrives can't be priced by anyone. | Check a real response from your own route and list which counts it actually contains. |
| Ignoring thinking tokens on a reasoning model. | They bill like output while never reaching a user, so leaving them out understates the expensive half. | Confirm a reasoning count reaches your ledger, and if it doesn't, reconcile against the invoice to size it. |
| Expecting Gemini caching to bill like Anthropic caching. | Gemini charges for storage time rather than for written tokens, so no token count can represent it. | Track cache storage as its own line. It's real spend that token accounting structurally can't see. |
Run this check tonight
- Find which endpoint your client is configured against and write it down.
- Take one real response and list every usage field it carries.
- On a reasoning model, check whether a thinking-token count is among them.
- Reconcile a month of Gemini spend against the invoice and note where the drift concentrates.
- Check whether you're paying for cache storage that no token figure represents.
What thinking tokens do to a reconciliation
Illustrative example
A reasoning workload on Gemini 2.5 Pro at real rates of $1.25 per million input and $10.00 output, sending 10 million prompt tokens and producing 4 million tokens of visible answer plus 6 million thinking tokens in a month. Volumes are modelled.
Over half the spend can sit in tokens nobody reads. Whether your route reports them is the difference between a reconciliation that closes and one that drifts by more than the visible answer costs.
Every number, with its confidence and source
| Figure | What it means | Confidence | Source |
|---|---|---|---|
| $52.50 to $112.50 | modelled monthly Gemini cost recorded from visible output alone against the full billed total | estimated | Both endpoints at real Gemini 2.5 Pro rates per million from the price book, effective 2026-07-02. A range because the token volumes and the thinking share are modelled. |
| 53% | modelled share of a reasoning workload's bill sitting in tokens no user ever sees | calculated | $60.00 of thinking-token output divided by the $112.50 modelled total, from the teardown arithmetic. |
What a generic answer can’t know
Google bills for thinking tokens whether or not your tooling counted them, and it has no idea which of your features asked the model to think. Sizing that needs your own per-feature counts against the invoice. Culpa keeps them on your infrastructure, where your prompts and responses stay, and counts the calls to run your plan.
Questions founders ask next
Which Gemini endpoint should I point Culpa at?
Either works, and the practical question is which usage fields your traffic needs. If you run reasoning models, confirm that a thinking-token count reaches your ledger on the route you picked, because that's where the largest share of an unreconciled bill tends to hide.
Do Gemini thinking tokens cost money?
They bill as output on the providers in this price book, so on a model where output costs eight times input they're expensive and invisible at the same time. A user never sees them, which is exactly why they go uncounted.
How does Gemini cache billing differ?
Gemini charges for how long cached content is stored rather than for the tokens written into it. That's a real cost with no token count behind it, so it belongs on its own line rather than inside a per-token figure.
On your infrastructure
Culpa runs on your infrastructure. Your prompts and responses never leave it. Culpa counts calls to run your plan, and it fails open, so if it ever breaks your app keeps running.
How Culpa works
Find the culprit. Not just the total.
Your dashboard shows what you spent. It stops short of who spent it. Culpa shows the conversation, the user and the feature behind it.
Your prompts stay local.
Culpa runs on your own infrastructure. What you send to a model reaches us at no point.
Every dollar has a name.
Follow any charge to the conversation, the user, the feature and the customer behind it.
See the bill before it lands.
Cost your next feature before you ship it. You get the likely bill and the worst case, at best, median, p90 and p99.
Three steps to your first answer.
Change one base URL.
Or drop in the Python or TypeScript library.
Find your most expensive conversation.
In the first session, not the first week.
Cost your next feature before you ship it.
Why the bill went up
Example dashboardCalls traced
418,209
across 3 projects
Spend this week
$378.41
+ $182 vs last week
Failed calls
312
74% retried, and you paid for all of them
+ $182 this week traced to one culprit
Spend over 14 days
Most expensive users
Next week forecast
Graded against reality. Accuracy shown as results land.
Free, no card, no account
Run the free Cost Leak Scan
It shows your most expensive conversation before you install anything.
Keep reading
Sources: Gemini API pricing. Last reviewed 2026-08-02. Plain text version.