About this tool
Estimate Gemini API spend across text, cached, long-context, image and audio tokens, per request and per month.
This calculator converts a Gemini API request's token mix into a dollar figure using Google's per-million-token billing: cost = (input tokens ÷ 1,000,000) × input rate + (output tokens ÷ 1,000,000) × output rate. It also applies the two rules that trip up back-of-envelope estimates — the long-context tier that raises both the input and output rate for the whole request once a prompt crosses the threshold, and the context-cache discount that bills reused tokens at a quarter of the standard input rate plus an hourly storage charge. Images and audio are converted to tokens first, at 258 tokens per 768px image tile and 32 tokens per second of audio.
Open Gemini API Cost Calculator on AltFTool — it loads instantly in your browser.
Enter the values you already know.
Fine-tune the options to match your scenario.
Read the result and use it in your planning or reporting.
Switches to the long-context rate for the entire request, the way Google bills it, instead of pro-rating.
Images and audio are tokenised before pricing, so a vision or voice feature is costed correctly.
Every per-million-token rate is an input, so the tool stays accurate when list prices move.
Per million tokens, priced separately for input and output. Multiply your prompt tokens by the input rate per million and your generated tokens by the output rate per million, then add them. Output is normally several times more expensive than input, so completion length usually drives the bill more than prompt length.
On Gemini 2.5 Pro the rate steps up once a single prompt exceeds 200,000 tokens, and the higher rate applies to the entire request rather than only the tokens above the line. Keeping a prompt just under that threshold, or splitting it, can roughly halve the input cost of that call.
Cached input tokens are billed at about a quarter of the standard input rate, but the cache also carries a storage charge per million tokens per hour it stays alive. Caching pays off when the same large context is reused across many requests in a short window; at low request volume the storage charge can exceed the token saving.
An image whose longest side is 384 pixels or less counts as a single 258-token tile. Larger images are cropped into 768×768 tiles that each cost 258 tokens, so a large screenshot can easily cost a thousand tokens or more. Audio is billed at 32 tokens per second.
Add the Gemini API Cost Calculatorwidget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/gemini-api-cost-calculator"
title="Gemini API Cost Calculator — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/gemini-api-cost-calculator?utm_source=embed&utm_medium=widget">AltFTool — free online tools</a></p>