Guides / gemini api cost

Gemini API cost and why output length dominates

Gemini API cost runs from $0.25 per million input tokens on Flash Lite to $2.00 on the Pro preview, with output spreads reaching 8.3 times input. That makes answer length the dominant lever here. Culpa, a local-first LLM cost, margin, and forecast ledger, splits input and output per call, so you can see which side is actually growing.

Why this happens

Gemini has the cheapest input rates in this book and the widest output-to-input spreads, which pulls in two directions. Cheap input makes long context genuinely affordable, so teams retrieve more. Expensive output relative to that input means every token of narration costs what eight input tokens would. Teams arrive with prompt-trimming habits from other providers, apply them here, and find the bill barely moves.

What this usually looks like

  • Trimming your prompt produced almost no change in spend.
  • Output tokens are a small share of your token count and a large share of your bill.
  • Retrieved context has grown steadily because input felt close to free.
  • Cost per call varies widely between requests, tracking response length rather than input size.

Free, no card, no account

Run the free Cost Leak Scan

It shows your most expensive conversation before you install anything.

Run the free Cost Leak ScanStart 14-day trial

Mistakes that cost the most

MistakeWhy it hurtsDo instead
Applying prompt-trimming habits from a different provider.Input starts at $0.25 per million here, so halving a long prompt saves very little.Constrain output first. Set max tokens and request a compact format, then measure the change.
Retrieving more context because input is cheap.Cheap isn't free, and across a batch a large context is a real number.Measure retrieval precision. Cutting unused context improves quality and cost together.
Asking the model to narrate its reasoning in every response.Narration is output tokens at up to 8.3 times the input rate, and it's rarely read.Request the answer only, and sample reasoning on a subset when you genuinely need it.

Run this check tonight

  1. Split your Gemini spend into input and output. The output share is usually the surprise.
  2. Measure median and 90th percentile output tokens per call. A wide gap means the format is uncontrolled.
  3. Check whether max tokens is set at all. On an eight-to-one spread it's the cheapest control available.
  4. Recompute your bill with output halved, then with input halved. Compare which is easier to achieve.
  5. Confirm cached input is in use. Every Gemini model here carries a roughly tenfold cached discount.

Five Gemini models, same tokens, different shapes

Illustrative example

1 million input and 200,000 output tokens priced across the Gemini line.

gemini-3.1-flash-lite: (1 x $0.25) + (0.2 x $1.50) = $0.25 + $0.30 = $0.55, ratio 6x
gemini-2.5-flash: (1 x $0.30) + (0.2 x $2.50) = $0.30 + $0.50 = $0.80, ratio 8.3x
gemini-2.5-pro: (1 x $1.25) + (0.2 x $10.00) = $1.25 + $2.00 = $3.25, ratio 8x
gemini-3.5-flash: (1 x $1.50) + (0.2 x $9.00) = $1.50 + $1.80 = $3.30, ratio 6x
gemini-3.1-pro-preview: (1 x $2.00) + (0.2 x $12.00) = $2.00 + $2.40 = $4.40, ratio 6x

2.5 Flash costs less than half of 3.5 Flash on identical work, yet carries the wider output ratio. The tier and the shape are separate decisions here, unlike on Anthropic.

Every number, with its confidence and source

FigureWhat it meansConfidenceSource
8.3xwidest output-to-input ratio across the Gemini line, on 2.5 Flashcalculated$2.50 output divided by $0.30 input per million on gemini-2.5-flash, from the price book, effective 2026-07-02.
$0.55 to $4.40cost of one million input and 200,000 output tokens across the five Gemini modelscalculatedFive calculations shown in the teardown, all from price-book rows effective 2026-07-02.

What a generic answer can’t know

A rate card gives you two numbers per model. It can't tell you your own output-to-input ratio, which decides which lever is worth pulling, or which feature produces the long responses. Culpa records both on your infrastructure, keeps your prompts and responses there, and counts the calls to run your plan.

Questions founders ask next

Which Gemini model has the widest output spread?

Gemini 2.5 Flash, at 8.3 times input, followed by 2.5 Pro at 8 times. The 3.x models sit at 6 times. So the newer line is flatter, and the older Flash tier is where response length matters most.

What is the cheapest Gemini model?

Gemini 3.1 Flash Lite at $0.25 per million input and $1.50 output, verified 2026-07-02. It's the cheapest input rate of any hosted model in this price book outside the open-weight tiers.

Do Gemini models charge for cache writes?

Not in this price book. Every Gemini model records a cached read rate at roughly a tenth of input, with no separate write charge, so caching here has no downside beyond the effort of ordering the prompt correctly.

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.

Keep reading


Sources: Gemini API pricing. Last reviewed 2026-08-01, rates effective 2026-07-02. Plain text version.