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.

Run a free scan

Mistakes that cost the most

MistakeWhy it hurtsDo 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

  1. Find which endpoint your client is configured against and write it down.
  2. Take one real response and list every usage field it carries.
  3. On a reasoning model, check whether a thinking-token count is among them.
  4. Reconcile a month of Gemini spend against the invoice and note where the drift concentrates.
  5. 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.

Input: 10 x $1.25 = $12.50
Visible output alone: 4 x $10.00 = $40.00, for a recorded total of $52.50
Output including thinking tokens: 10 x $10.00 = $100.00, for a real total of $112.50
A ledger holding only the visible answer reads $52.50 against a $112.50 invoice
The missing 6 million tokens are 53% of the bill and none of them reached a user

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

FigureWhat it meansConfidenceSource
$52.50 to $112.50modelled monthly Gemini cost recorded from visible output alone against the full billed totalestimatedBoth 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 seescalculated$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.

1

Change one base URL.

Or drop in the Python or TypeScript library.

2

Find your most expensive conversation.

In the first session, not the first week.

3

Cost your next feature before you ship it.

Base URLhttp://localhost:4545/v1Your traffic keeps flowing if Culpa ever stops.

Why the bill went up

Example dashboard

Calls 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

$0$20$40$60$8024262830020406
user_384report_generatorconv_91fprompt_v1894,220 tokens3 retries$6.81

Most expensive users

user_384$38.42
user_119$21.07
user_562$14.90
user_204$8.30
user_871$5.10

Next week forecast

Best$180
Median$240
p90$310
p99$395

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.

Run a free scan

Keep reading


Sources: Gemini API pricing. Last reviewed 2026-08-02. Plain text version.