- Gemini API pricing as of November 8, 2026: Gemini 3.8 Flash costs $0.75 input and $3.75 output per million tokens, 3.1 Pro Preview costs $2 and $12 for prompts up to 200,000 tokens, and 4 Argon costs $2 and $10.
- Scheduled increases double Gemini 4 Argon on December 1, 2026, and Gemini 3.8 and 3.6 Flash on January 1, 2027, according to Google's pricing page.
- Explicit caching bills storage by the hour, so its break-even is a request rate that does not depend on prefix size: 2.5 per hour on 3.1 Pro Preview and 0.74 on 3.8 Flash.
- Thinking tokens bill at the output rate, and Google charges for the full thoughts while returning only summaries.
- The TypeScript calculator in this guide ran on Node 26.12.1 with no API calls, and a script checked 101 of its price cells against Google's page.
Gemini API pricing is metered per million tokens, and output prices on text models include thinking tokens. Google publishes the rates on its pricing page, and every figure here was read from that page on November 8, 2026. That page spans 34 model sections, most with several service tiers and footnotes. This guide reduces them to two tables, then works out what caching, thinking, and grounding do to a bill.
#Gemini API pricing by model
Gemini API pricing for text models as of November 8, 2026 runs from $0.10 input per million tokens on 2.5 Flash-Lite to $4 on 3.1 Pro Preview prompts over 200,000 tokens. Output prices include thinking tokens. These are paid Standard-tier rates in US dollars from Google's pricing page.
Prices last checked November 8, 2026. This table goes stale on December 1, 2026, when Gemini 4 Argon doubles and 2.5 Pro and 2.5 Flash requests reroute. It goes stale again on January 1, 2027, when 3.8 Flash and 3.6 Flash double.
Google's page says discounts and model availability are subject to change. Recheck it if a model loses its Preview label, a pricing tab appears on a model, or a scheduled date moves.
| Model | Free tier | Input | Output and thinking | Cached input | Storage per MTok per hour | Batch input and output |
|---|---|---|---|---|---|---|
| Gemini 4 Argon | No | $2.00 ($4.00 from Dec 1) | $10.00 ($20.00 from Dec 1) | $0.10 ($0.20 from Dec 1), implicit only | None | $1.00 and $5.00 ($2.00 and $10.00 from Dec 1) |
| Gemini 3.8 Flash | Yes | $0.75 ($1.50 from Jan 1) | $3.75 ($7.50 from Jan 1) | $0.075 ($0.15 from Jan 1) | $0.50 ($1.00 from Jan 1) | $0.375 and $1.875 ($0.75 and $3.75 from Jan 1) |
| Gemini 3.6 Flash | Yes | $0.75 ($1.50 from Jan 1) | $3.75 ($7.50 from Jan 1) | $0.075 ($0.15 from Jan 1) | $0.50 ($1.00 from Jan 1) | $0.375 and $1.875 ($0.75 and $3.75 from Jan 1) |
| Gemini 3.5 Flash-Lite | Yes | $0.30 | $2.50 | $0.03 | $1.00 | $0.15 and $1.25 |
| Gemini 3.1 Flash-Lite | Yes | $0.25 | $1.50 | $0.025 | $1.00 | $0.125 and $0.75 |
| Gemini 3.1 Pro Preview | No | $2.00 ($4.00 over 200K) | $12.00 ($18.00 over 200K) | $0.20 ($0.40 over 200K) | $4.50 | $1.00 and $6.00 ($2.00 and $9.00 over 200K) |
| Gemini 3 Flash Preview | Yes | $0.50 | $3.00 | $0.05 | $1.00 | $0.25 and $1.50 |
| Gemini 2.5 Pro (deprecated) | Yes | $1.25 ($2.50 over 200K) | $10.00 ($15.00 over 200K) | $0.125 ($0.25 over 200K) | $4.50 | $0.625 and $5.00 ($1.25 and $7.50 over 200K) |
| Gemini 2.5 Flash (deprecated) | Yes | $0.30 | $2.50 | $0.03 | $1.00 | $0.15 and $1.25 |
| Gemini 2.5 Flash-Lite | Yes | $0.10 | $0.40 | $0.01 | $1.00 | $0.05 and $0.20 |
Prices are per million tokens, written MTok above. Audio input costs more on 3.1 Flash-Lite ($0.50), 3 Flash Preview ($1.00), 2.5 Flash ($1.00), and 2.5 Flash-Lite ($0.30). Google limits the 2.5 models to accounts that already used them.
On December 1, 2026, gemini-2.5-pro requests reroute to 3.8 Flash and gemini-2.5-flash requests reroute to 3.5 Flash-Lite, each billed at the new model's rate. For 2.5 Pro users the input rate falls 40% in December and then rises when 3.8 Flash doubles in January.
#Audio, image, video, and embedding models
Specialized models bill audio, images, and video at their own rates, usually in tokens with a per-minute or per-image equivalent. The table lists paid Standard rates per million tokens unless a row says otherwise.
| Model | Free tier | Input | Output |
|---|---|---|---|
| 3.5 Transcribe Live | Yes | $3.50 or $0.005 per min (audio) | $21.00 or $0.004 per min (text) |
| 3.5 Transcribe | Yes | $2.00 or $0.003 per min (audio) | $12.00 or $0.002 per min (text) |
| 3.8 Live, 3.8 Live Extended Thinking, 3.1 Flash Live Preview | Yes | $0.75 text; $3.00 or $0.005 per min audio; $1.00 or $0.002 per min image and video | $4.50 text; $12.00 or $0.018 per min audio |
| 3.5 Live Translate | Yes | $3.50 or $0.0053 per min | $21.00 or $0.0315 per min |
| 2.5 Flash Native Audio | Yes | $0.50 text; $3.00 audio and video | $2.00 text; $12.00 audio |
| 3.8 Flash TTS | Yes | $0.50 ($1.00 from Jan 1) | $9.00 ($18.00 from Jan 1) |
| 3.8 Flash-Lite TTS | Yes | $0.50 ($1.00 from Jan 1) | $6.00 ($12.00 from Jan 1) |
| 3.1 Flash TTS Preview | Yes | $1.00 | $20.00 |
| 2.5 Flash Preview TTS | Yes | $0.50 | $10.00 |
| 2.5 Pro Preview TTS | No | $1.00 | $20.00 |
| Nano Banana 2.1 | No | $1.50 | $7.50 text and thinking; $30.00 images |
| 3.1 Flash Image | No | $0.50 | $3.00 text and thinking; $60.00 images |
| 3.1 Flash Lite Image | No | $0.25 | $1.50 text and thinking; $30.00 images |
| 3 Pro Image | No | $2.00 | $12.00 text and thinking; $120.00 images |
| 2.5 Flash Image (deprecated, shuts down Mar 15, 2027) | No | $0.30 | $0.039 per image |
| Omni 1.2 Flash | No | $1.50 | $9.00 text; $12.00 video |
| Omni 1.1 Flash (reroutes Dec 3) | No | $1.50 | $9.00 text; $17.50 video |
| Embedding 2 | Yes | $0.20 text; $0.45 image; $6.50 audio; $12.00 video | None |
| Embedding | Yes | $0.15 | None |
| Robotics ER 2 Preview | Yes | $1.00 ($2.00 from Jan 1) | $5.00 ($10.00 from Jan 1) |
| Robotics ER 2 Streaming Preview | Yes | $1.00 ($2.00 from Jan 1) | $5.00 ($10.00 from Jan 1) |
| Lyria 3.5 | No | None | $0.08 per full song |
| Lyria 3 | No | None | $0.04 per 30-second clip; $0.08 per full song |
| Gemma 4 | Yes | Free tier only | Free tier only |
#Free tier versus paid tier
The Gemini API free tier charges nothing for input and output on most Flash models, but Google can use that content to improve its products. The paid tier removes that use, adds context caching on more models, and opens 4 Argon and 3.1 Pro Preview. Free rate limits appear in AI Studio, not on the pricing page.
Moving to paid requires a linked billing account, and Google may require at least $5 of prepaid credit, depending on the billing plan it assigns. Spending tiers cap at $250, $2,000, and then $20,000 to $100,000 or more. When a prepaid balance reaches $0, every API key on that billing account stops working, and requests fail with HTTP 402.
Among the Gemini text models, free-tier caching is listed only on 3.8 Flash, 3.6 Flash, and 3 Flash Preview. Google Search grounding on the free tier is limited to 2.5 Flash and 2.5 Flash-Lite, at 500 requests a day. Failed requests with a 400 or 500 status are not billed, and Google's billing FAQ says requests to the GetTokens API are not billed.
Two parts of the source page are unclear. Several Batch, Flex, and Priority tabs say "Free of charge" in the Free Tier column, and Google's tier docs do not explain free access to those tiers. The tools table also lists 500 free search requests a day without separating Gemini generations, while each Gemini 3 model row says "Not available."
#Context caching: implicit and explicit
Implicit caching is on by default for 2.5 and newer models, adds no storage fee, and gives no guarantee of a hit. Explicit caching, in beta through generateContent on Gemini 3 and 2.5 models, gives a guaranteed reduced rate and bills storage by the hour. Gemini 4 Argon and later support implicit caching only.
#Implicit caching
Implicit caching needs a prompt of at least 4,096 tokens on 4 Argon, 3.8 Flash, 3.6 Flash, and 3.1 Pro Preview, and 2,048 on 2.5 Flash and 2.5 Pro. Google's table does not list a minimum for the Flash-Lite models or 3 Flash Preview. Put shared content first and send similar requests close together, then read usage.total_cached_tokens to confirm hits.
Agent loops on Gemini 4 have a separate rule. A request gets the full previous prompt cached only if it adds at least 2,050 tokens, and smaller additions reprocess the last 2,050 tokens at the input rate.
Google says most agent turns exceed that threshold. An agent loop still needs a stable prefix to hit the cache at all, so order context for reuse.
#Explicit caching and its storage charge
Explicit caching bills the cached read rate on each use, plus storage for the cache's whole lifetime. The default TTL is 1 hour, with no minimum or maximum, and you can delete a cache early. Implicit caching does not apply to a request that uses an explicit cache, and any extra input tokens in that request bill at the standard rate.
An explicit cache saves input price minus cached price on each request and costs storage every hour, so the prefix size cancels. The break-even is a rate, computed as storage / (input - cached).
| Model | Input | Cached | Storage | Break-even requests per hour | Longest average gap |
|---|---|---|---|---|---|
| 3.8 Flash and 3.6 Flash | $0.75 | $0.075 | $0.50 | 0.74 | 81 min |
| 3 Flash Preview | $0.50 | $0.05 | $1.00 | 2.22 | 27 min |
| 3.1 Pro Preview, up to 200K | $2.00 | $0.20 | $4.50 | 2.50 | 24 min |
| 3.1 Pro Preview, over 200K | $4.00 | $0.40 | $4.50 | 1.25 | 48 min |
| 2.5 Pro, up to 200K | $1.25 | $0.125 | $4.50 | 4.00 | 15 min |
| 2.5 Pro, over 200K | $2.50 | $0.25 | $4.50 | 2.00 | 30 min |
| 3.5 Flash-Lite and 2.5 Flash | $0.30 | $0.03 | $1.00 | 3.70 | 16 min |
| 3.1 Flash-Lite | $0.25 | $0.025 | $1.00 | 4.44 | 14 min |
| 2.5 Flash-Lite | $0.10 | $0.01 | $1.00 | 11.11 | 5 min |
The January 2027 doubling leaves 3.8 Flash at 0.74, because input, cached, and storage prices all double together.
Two billing details are unclear on Google's Gemini API pages: whether creating a cache bills the input tokens, and whether storage is prorated within an hour. Google Cloud's documentation for its separate Gemini Enterprise Agent Platform says creation bills at the standard input price and implicit caching has no storage cost. The calculator bills creation at the input rate and treats storage as continuous.
#Storage fees versus a write premium
A write premium charges once when an entry is created, and each hit extends the entry at no extra charge. Storage charges for every hour the entry exists, whether or not requests arrive. Anthropic's Claude API uses the first model and Gemini explicit caching uses the second, so request timing changes which one costs less.
The table compares a 100,000-token prefix for 8 hours, prefix cost only, on two models with the same $2 base input price as of November 8, 2026. Gemini is 3.1 Pro Preview. Claude is Sonnet 5.5 at $2.50 for a 5-minute write, $4 for a 1-hour write, and $0.10 for a read, per Anthropic's pricing page.
| Traffic over 8 hours | No cache | Gemini explicit, 8-hour TTL | Claude 5-minute | Claude 1-hour |
|---|---|---|---|---|
| 60 requests per hour | $96.00 | $13.40 | $5.04 | $5.19 |
| 2 requests per hour | $3.20 | $4.12 | $4.00 | $0.55 |
| Two bursts of 5 requests, 6 hours apart | $2.00 | $4.00 | $0.58 | $0.88 |
Gemini's figure combines $0.20 to create the cache, $3.60 of storage, and $0.02 per hit. At 2 requests per hour the storage alone exceeds sending the prefix uncached, because 2 is below the 2.5 break-even. The Claude API pricing guide derives the Claude columns.
Cheap storage changes the result on low-traffic prefixes. At 1 request per hour for 8 hours, an explicit cache on 3.8 Flash costs $0.535 against $0.60 with no cache. Implicit caching is the other Gemini advantage, since a miss costs exactly the input price while a Claude write costs 1.25x or 2x even if no read follows.
These numbers compare token for token, and token counts do not transfer between providers. Google says a Gemini token is about 4 characters, and Anthropic says 1M Claude tokens is about 2.5M characters on its current tokenizer. By those rules of thumb the same text produces about 1.6x as many Claude tokens, so count your own prompts on both before comparing bills.
#Batch, Flex, and Priority tiers
Batch and Flex cost half of Standard for input and output, and Priority costs 1.8x. The tiers differ on latency and on what happens to cached reads, which do not follow the same discount across models. Choose by how long a job can wait, then check the cached rate for your exact model on the pricing page.
| Tier | Input and output | Cached reads | How it runs |
|---|---|---|---|
| Standard | Base rate | Base rate | Synchronous |
| Batch | 50% of Standard | 50% on 4 Argon, 3.8 and 3.6 Flash, 3.5 and 3.1 Flash-Lite; base rate on 3.1 Pro Preview, 3 Flash Preview, and 2.5 models | Asynchronous, 24-hour target |
| Flex (preview) | 50% of Standard | Like Batch, except $0.02 on 3.5 Flash-Lite | Synchronous, best effort |
| Priority (preview) | 180% of Standard | About 180%, with $0.05 on 3.5 Flash-Lite | Synchronous, overflow drops to Standard |
Batch targets a 24-hour turnaround, and the batch API discount suits evals and backfills. Flex can return 503 or 429 errors with no automatic upgrade to Standard, so you need retries and timeouts of 10 minutes or more.
Priority overflow downgrades to Standard instead of failing. An invite-only Contributor tier lists half-price rates on 4 Argon, 3.8 Flash, 3.5 Flash-Lite, and 3.1 Pro Preview in exchange for using your content to improve Google's products.
#Long-prompt tiers at 200,000 tokens
Only Gemini 3.1 Pro Preview and 2.5 Pro have long-prompt tiers, and both switch at 200,000 prompt tokens. Above that line input, output, and cached reads all reprice, so 3.1 Pro Preview moves from $2 and $12 to $4 and $18. Flash, Flash-Lite, and 4 Argon list one rate at every prompt length as of November 8, 2026.
The boundary is a cliff if the higher rate covers the whole request. With 1,000 output tokens on 3.1 Pro Preview, a 200,000-token prompt costs $0.4120 and a 200,001-token prompt costs $0.8180.
Google's page writes these rates per prompt length and does not say whether the higher rate covers every token or only those past 200,000. It also does not say whether cached tokens count toward the limit. The calculator applies the higher rate to the whole request and counts cached tokens, which is the conservative reading.
#Thinking tokens bill at the output rate
Thinking tokens bill at the output rate, and Google charges for the full thoughts even though the API returns only summaries. Output prices on the pricing page already include them. A thinking-heavy answer can cost several times its visible output, so log total_thought_tokens on every response and report it separately from output.
Defaults vary by model. 3.1 Pro Preview and 3 Flash Preview default to high, while 4 Argon, 3.8 Flash, and 3.6 Flash default to medium. 3.5 Flash-Lite defaults to minimal, and 2.5 Flash-Lite ships with thinking off.
Google recommends lowering thinking_level instead of cutting max_output_tokens, because that limit covers thinking and output combined and a low value truncates responses.
On 3.1 Pro Preview, a 400-token answer costs $0.0048 in output without thinking. Add 3,000 thinking tokens and the same answer costs $0.0408, which is 8.5 times as much.
#Grounding and other tool fees
Grounding with Google Search on Gemini 3 and newer costs $14 per 1,000 search queries after 5,000 free queries a month, shared across those models. One prompt can run several queries, and each query bills. Gemini 2.5 bills per grounded prompt, at $35 per 1,000 after 1,500 free requests a day.
| Tool | Free allowance on paid tier | Then |
|---|---|---|
| Google Search, Gemini 3 and newer | 5,000 queries a month, shared | $14 per 1,000 queries; default cap of 1,500 a day per project |
| Google Search, Gemini 2.5 | 1,500 requests a day; Flash and Flash-Lite share one limit | $35 per 1,000 grounded prompts |
| Google Maps, Gemini 3 and newer | 5,000 requests a month, shared | $14 per 1,000 queries |
| Google Maps, Gemini 2.5 | 1,500 requests a day on Flash and Flash-Lite, 10,000 on Pro | $25 per 1,000 grounded prompts |
| Code execution | No separate fee | Generated code and results bill as output tokens, then as input tokens when reused |
| URL context | No separate fee | Retrieved content bills as input tokens |
| Computer use | No separate fee | Regular token rates |
| File search | No separate fee | Embeddings at the embedding model's rate; retrieved tokens at the model's rate |
One query costs $0.014, the same as 18,667 input tokens on 3.8 Flash. At the default cap of 1,500 queries a day, a 30-day month holds 45,000 queries, and the 40,000 past the free allowance cost $560.
File search charges for embeddings and for the tokens it retrieves, so the retrieval size in a RAG pipeline shows up directly on the bill. The vector database guide covers how to retrieve less.
#A tested Gemini API cost calculator
The calculator below takes the fields from a Gemini usage object and returns an itemized bill for paid Standard and Batch requests. It handles the scheduled price dates, the 200,000-token tier, thinking tokens, explicit cache storage, and billable search queries. It ran on Node 26.12.1 with no dependencies and no network code.
// gemini-bill.ts: turn Gemini API usage into a bill.
// Paid Standard-tier prices, USD per 1M tokens, read from Google's pricing page on November 8, 2026.
type Rate = { input: number; output: number; cached: number; storage?: number };
type Card = Rate & {
until?: string; // last day this price applies (ISO date)
longAt?: number; // prompt length above which `long` applies
long?: Rate;
batchCached?: number; // multiplier on cached reads under Batch (default 0.5)
batchStorage?: number; // multiplier on storage under Batch (default 1)
};
const proLong = (input: number, output: number, cached: number): Rate => ({ input, output, cached, storage: 4.5 });
export const MODELS: Record<string, Card[]> = {
"gemini-4-argon": [
{ until: "2026-11-30", input: 2, output: 10, cached: 0.1 },
{ input: 4, output: 20, cached: 0.2 },
],
"gemini-3.8-flash": [
{ until: "2026-12-31", input: 0.75, output: 3.75, cached: 0.075, storage: 0.5 },
{ input: 1.5, output: 7.5, cached: 0.15, storage: 1 },
],
"gemini-3.6-flash": [
{ until: "2026-12-31", input: 0.75, output: 3.75, cached: 0.075, storage: 0.5 },
{ input: 1.5, output: 7.5, cached: 0.15, storage: 1 },
],
"gemini-3.5-flash-lite": [{ input: 0.3, output: 2.5, cached: 0.03, storage: 1 }],
"gemini-3.1-flash-lite": [{ input: 0.25, output: 1.5, cached: 0.025, storage: 1, batchStorage: 0.5 }],
"gemini-3.1-pro-preview": [
{ input: 2, output: 12, cached: 0.2, storage: 4.5, batchCached: 1, longAt: 200_000, long: proLong(4, 18, 0.4) },
],
"gemini-3-flash-preview": [{ input: 0.5, output: 3, cached: 0.05, storage: 1, batchCached: 1 }],
"gemini-2.5-pro": [
{ input: 1.25, output: 10, cached: 0.125, storage: 4.5, batchCached: 1, longAt: 200_000, long: proLong(2.5, 15, 0.25) },
],
"gemini-2.5-flash": [{ input: 0.3, output: 2.5, cached: 0.03, storage: 1, batchCached: 1 }],
"gemini-2.5-flash-lite": [{ input: 0.1, output: 0.4, cached: 0.01, storage: 1, batchCached: 1 }],
};
export type Usage = {
prompt: number; // usage.total_input_tokens, cached tokens included
cached?: number; // usage.total_cached_tokens
output: number; // usage.total_output_tokens
thinking?: number; // usage.total_thought_tokens
cacheCreate?: number; // tokens sent to create an explicit cache
storedTokens?: number; // explicit cache size
storedHours?: number; // how long that cache lives
billableSearches?: number; // queries past the monthly free allowance
};
export type Options = { date?: string; batch?: boolean };
export type Lines = Record<"input" | "cached" | "output" | "create" | "storage" | "search", number>;
export function card(model: string, date = "2026-11-08"): Card {
const cards = MODELS[model];
if (!cards) throw new Error(`Unknown model: ${model}`);
return cards.find((c) => !c.until || date <= c.until)!;
}
export function bill(model: string, u: Usage, o: Options = {}) {
const c = card(model, o.date);
const { cached = 0, thinking = 0, cacheCreate = 0, storedTokens = 0, storedHours = 0, billableSearches = 0 } = u;
// The long-prompt card applies to the whole request, counting cached tokens as prompt tokens.
const r: Rate = c.longAt && u.prompt > c.longAt ? c.long! : c;
const io = o.batch ? 0.5 : 1;
const cacheMult = o.batch ? (c.batchCached ?? 0.5) : 1;
const storageMult = o.batch ? (c.batchStorage ?? 1) : 1;
const usd = (tokens: number, perMTok: number) => (tokens * perMTok) / 1e6;
const searchRate = model.startsWith("gemini-2.5") ? 35 : 14;
const lines: Lines = {
input: usd(u.prompt - cached, r.input * io),
cached: usd(cached, r.cached * cacheMult),
output: usd(u.output + thinking, r.output * io), // thinking bills at the output rate
create: usd(cacheCreate, r.input), // assumption: creation bills at the standard input rate
storage: usd(storedTokens * storedHours, (r.storage ?? 0) * storageMult),
search: (billableSearches * searchRate) / 1000,
};
return { lines, total: Object.values(lines).reduce((a, b) => a + b, 0) };
}
// Requests per hour above which an explicit cache beats no cache.
// Prefix size cancels out, so this is one number per model.
export function breakEvenHitsPerHour(model: string, date = "2026-11-08") {
const c = card(model, date);
return c.storage! / (c.input - c.cached);
}
const $ = (n: number) => `$${n.toFixed(4)}`;
if (import.meta.main) {
console.log("Explicit cache break-even, requests per hour");
for (const m of ["gemini-3.8-flash", "gemini-3-flash-preview", "gemini-3.5-flash-lite", "gemini-3.1-pro-preview"]) {
console.log(` ${m.padEnd(26)} ${breakEvenHitsPerHour(m).toFixed(2)}`);
}
// 100K-token prefix on 3.1 Pro Preview for an 8-hour day. Prefix cost only.
const prefix = 100_000;
console.log("\n100K prefix, gemini-3.1-pro-preview, 8 hours, prefix cost only");
for (const perHour of [2, 60]) {
const n = perHour * 8;
const none = n * bill("gemini-3.1-pro-preview", { prompt: prefix, output: 0 }).total;
const hit = bill("gemini-3.1-pro-preview", { prompt: prefix, cached: prefix, output: 0 }).total;
const setup = bill("gemini-3.1-pro-preview", {
prompt: 0, output: 0, cacheCreate: prefix, storedTokens: prefix, storedHours: 8,
}).total;
console.log(` ${String(perHour).padStart(2)}/hour: none ${$(none)} explicit ${$(setup + n * hit)} (setup and storage ${$(setup)})`);
}
console.log("\nThinking on gemini-3.1-pro-preview: 400 visible output tokens");
console.log(` no thinking ${$(bill("gemini-3.1-pro-preview", { prompt: 2_000, output: 400 }).lines.output)}`);
console.log(` 3,000 thinking tokens ${$(bill("gemini-3.1-pro-preview", { prompt: 2_000, output: 400, thinking: 3_000 }).lines.output)}`);
console.log("\nLong-prompt tier, gemini-3.1-pro-preview, 1,000 output tokens");
for (const prompt of [200_000, 200_001]) {
console.log(` ${prompt.toLocaleString("en-US")} prompt tokens: ${$(bill("gemini-3.1-pro-preview", { prompt, output: 1_000 }).total)}`);
}
const rag = { prompt: 15_150, cached: 6_000, output: 500, thinking: 1_500 };
console.log("\nRAG request: 15,150 prompt tokens, 6,000 cached, 500 output, 1,500 thinking");
console.log(` 3.8 Flash, November 2026 ${$(bill("gemini-3.8-flash", rag).total)}`);
console.log(` 3.8 Flash, January 2027 ${$(bill("gemini-3.8-flash", rag, { date: "2027-01-01" }).total)}`);
console.log(` 3.8 Flash, Batch, November ${$(bill("gemini-3.8-flash", rag, { batch: true }).total)}`);
console.log(` 3.5 Flash-Lite ${$(bill("gemini-3.5-flash-lite", rag).total)}`);
console.log(` 4 Argon, November 2026 ${$(bill("gemini-4-argon", rag).total)}`);
console.log(` 4 Argon, December 2026 ${$(bill("gemini-4-argon", rag, { date: "2026-12-01" }).total)}`);
console.log(` 4 Argon, December, 3 billable searches ${$(bill("gemini-4-argon", { ...rag, billableSearches: 3 }, { date: "2026-12-01" }).total)}`);
}Run it with node gemini-bill.ts. This is the real output:
Explicit cache break-even, requests per hour
gemini-3.8-flash 0.74
gemini-3-flash-preview 2.22
gemini-3.5-flash-lite 3.70
gemini-3.1-pro-preview 2.50
100K prefix, gemini-3.1-pro-preview, 8 hours, prefix cost only
2/hour: none $3.2000 explicit $4.1200 (setup and storage $3.8000)
60/hour: none $96.0000 explicit $13.4000 (setup and storage $3.8000)
Thinking on gemini-3.1-pro-preview: 400 visible output tokens
no thinking $0.0048
3,000 thinking tokens $0.0408
Long-prompt tier, gemini-3.1-pro-preview, 1,000 output tokens
200,000 prompt tokens: $0.4120
200,001 prompt tokens: $0.8180
RAG request: 15,150 prompt tokens, 6,000 cached, 500 output, 1,500 thinking
3.8 Flash, November 2026 $0.0148
3.8 Flash, January 2027 $0.0296
3.8 Flash, Batch, November $0.0074
3.5 Flash-Lite $0.0079
4 Argon, November 2026 $0.0389
4 Argon, December 2026 $0.0778
4 Argon, December, 3 billable searches $0.1198A separate script compared 101 Standard and Batch price cells for the 10 text models against the text of Google's page, and every one matched. No Gemini request was sent, so the token counts are assumptions and only the arithmetic is tested. The script does not price Flex, Priority, audio input, or image output, so read those rates from the tables above.
The RAG example shows where the money goes. On 3.8 Flash in November, the 1,500 thinking tokens and 500 output tokens cost $0.0075, about half of the request. Removing the thinking would save $0.0056, more than the $0.0041 that caching saves on the input line, so a reasoning model setting is the first thing to tune.
#Apply Gemini API pricing to your own traffic
Log usage for one day, group requests by shared prefix, and compute each prefix's requests per hour. Compare that rate with the break-even table before you create an explicit cache, because the rate decides whether storage pays and prefix size only sets the amount at stake. Then work through these steps:
- Rerun
bill()withdate: "2026-12-01"anddate: "2027-01-01", and budget for doubled rates on any Argon or 3.8 Flash route. - Below the break-even rate, skip explicit caching and rely on implicit caching. Move shared content to the start of the prompt, as the KV cache explainer describes.
- Above the break-even rate, create an explicit cache with the shortest TTL that covers the traffic window, and delete it when the window ends.
- Log
total_thought_tokensper route, lowerthinking_levelwhere quality holds, and confirm with LLM evaluation. - Move work that can wait to Batch after you check the cached rate for that model.
- Keep confidential data off the free tier, where Google can use your content to improve its products.
Gemini API pricing changes on fixed dates this winter, so set reminders for both. Check model release news for updates and browse the APIs and pricing topic for related guides.
Read about picking a coding model before you commit a route to one tier. The AI agent guide covers how loops multiply these per-request numbers, and the platforms directory lists other providers.
#Questions
How much does the Gemini API cost?
As of November 8, 2026, the Gemini API costs $0.75 input and $3.75 output per million tokens on Gemini 3.8 Flash, $2 and $12 on Gemini 3.1 Pro Preview for prompts up to 200,000 tokens, and $2 and $10 on Gemini 4 Argon. Argon doubles on December 1, 2026, and 3.8 Flash doubles on January 1, 2027.
Is the Gemini API free?
The Gemini API has a free tier with no token charges on most Flash models, including 3.8 Flash, but Gemini 4 Argon and 3.1 Pro Preview are paid only. On the free tier, Google may use your content to improve its products. Rate limits apply, and paid tiers need a linked billing account, often with at least $5 of prepaid credit.
Does Gemini charge for thinking tokens?
Yes. Thinking tokens bill at the output rate, and Google's pricing page labels output prices as including them. Google charges for the full thoughts generated even though the API returns only summaries. On Gemini 3.1 Pro Preview, 3,000 thinking tokens cost $0.036 at the $12 output rate as of November 8, 2026.
How does Gemini context caching pricing work?
Implicit caching runs by default and bills cached tokens at a reduced rate, with no storage fee and no guarantee of a hit. Explicit caching, available on Gemini 3 and 2.5 models, bills the same reduced read rate plus storage per million tokens per hour. On 3.1 Pro Preview that storage costs $4.50 as of November 8, 2026.
Is an explicit Gemini context cache worth it?
An explicit cache pays off when requests per hour exceed a model-specific break-even, which is the storage price divided by the difference between the input and cached prices. As of November 8, 2026, that is 2.5 requests per hour on Gemini 3.1 Pro Preview and 0.74 per hour on Gemini 3.8 Flash. Prefix size does not change it.
Does the Gemini API charge for Google Search grounding?
Yes. On Gemini 3 and newer models, the first 5,000 search queries each month are free across those models, then 1,000 queries cost $14 as of November 8, 2026. One prompt can trigger several queries, and each one bills. Gemini 2.5 models bill per grounded prompt at $35 per 1,000 after 1,500 free requests a day.
What is the difference between Batch and Flex on the Gemini API?
Both cost 50% of Standard for input and output as of November 8, 2026. Batch is asynchronous with a 24-hour target turnaround. Flex is a synchronous preview tier with best-effort availability, so requests can fail with 429 or 503 errors and need your own retries. Cached rates vary by model, so check the row for yours.