How much the Gemini API costs: 3.8 Flash and 3.7 Flash calculated on examples

A price table for Gemini 3.8 Flash and 3.7 Flash and three calculations with formulas: a chatbot, bulk classification and a long document, with and without cache.

6 min · · экономия · models

The Gemini API price is made up of four numbers: the cost of a million input tokens, a million output tokens, cache reads and cache writes. Below are those numbers for Gemini 3.8 Flash and 3.7 Flash in Zukko as of October 18, 2026, and three calculations with formulas: a chatbot, bulk classification and work with a long document. "Gemini API pricing" and "Gemini API cost" mean the same thing here: what you will pay for a given volume of work.

Prices as of October 18, 2026

Prices in $ per 1M tokens:

ModelInput / outputCache: read / writeOfficial input / outputContextStrength index
gemini-3.8-flash0.125 / 0.60.013 / 0.1250.75 / 3.751M41
gemini-3.7-flash0.125 / 0.60.013 / 0.1250.75 / 3.751M38

What the table shows. Both models cost the same, so the choice between them comes down to the strength index (Intelligence Index from Artificial Analysis): 3.8 is higher. Both accept text only as input; image input is not marked for them in the catalog. Cache writes are not billed separately for Gemini: the request that puts a prefix into cache is charged at the ordinary input price (0.125), while later cache reads are much cheaper (0.013). The current list and prices are at GET https://api.zukko.pro/v1/models; providers change prices often, so calculate against a fresh table.

The formula

The cost of a request adds up like this:

fresh input x input price + cache read x read price + cache write x write price + output x output price

Divide tokens by 1,000,000 and multiply by the price per million. For Gemini the "cache write" term is zero: the gateway sees only cache reads, and only if the provider reports them in the response. Whether a prefix gets cached is up to Google (caching has its own conditions, such as a minimum prefix length; see the Gemini API docs), so the cached calculations below are a best-case estimate. Check in the "Usage" section of the dashboard that cache reads actually show up. More on the mechanics: prompt caching, reads and writes and the documentation on key limits and cache.

Scenario 1: a support chatbot

Say 30,000 messages a month. Each request has a 2,000-token system prompt (shared by all, lands in cache), 1,000 tokens of fresh input (history and question) and a 400-token answer.

  • Cached input: 30,000 x 2,000 = 60M tokens x 0.013 = $0.78
  • Fresh input: 30,000 x 1,000 = 30M x 0.125 = $3.75
  • Output: 30,000 x 400 = 12M x 0.6 = $7.20
  • Total: 0.78 + 3.75 + 7.20 = $11.73 per month

Without cache all input (90M tokens) goes at the input price: 90 x 0.125 = 11.25, plus output 7.20, total $18.45. The difference is $6.72, and only reading the shared prefix produces it. Note that in this scenario output costs the most: short answers are cheaper than long ones, all else equal.

Scenario 2: classifying requests

Say 200,000 requests. Each prompt is a 500-token instruction (always the same) plus a 300-token customer message; the answer is a label of 10 tokens.

Without cache:

  • Input: 200,000 x 800 = 160M x 0.125 = $20.00
  • Output: 200,000 x 10 = 2M x 0.6 = $1.20
  • Total: $21.20

With the instruction cached:

  • Cached input: 200,000 x 500 = 100M x 0.013 = $1.30
  • Fresh input: 200,000 x 300 = 60M x 0.125 = $7.50
  • Output: $1.20
  • Total: $10.00

For bulk tasks the benefit of cache is especially visible because the shared part repeats hundreds of thousands of times. There is one condition: the shared instruction goes first in the request and does not change between messages. If the instruction is shorter than the provider's caching threshold there will be no discount; check on the first hundred requests.

Scenario 3: a long document

Say you have a 500,000-token document (it fits the 1M context) and 10 questions about it in a row. First a summary request: 3,000 output tokens. Then 10 questions of 200 tokens with 500-token answers, each as a separate "document + question" request.

First request: 0.5 x 0.125 + 0.003 x 0.6 = 0.0625 + 0.0018 = $0.0643.

Without cache each question sends the document again: 0.5002 x 0.125 + 0.0005 x 0.6 = 0.062525 + 0.0003 = about 0.0628. Ten questions: $0.628, about $0.69 in total with the first request.

With cache the document is read at 0.013: 0.5 x 0.013 + 0.0002 x 0.125 + 0.0005 x 0.6 = 0.0065 + 0.000025 + 0.0003 = about 0.0068. Ten questions: $0.068, about $0.13 in total.

Takeaway: as long as you ask questions about one big document, cache turns every next request into pennies. But this works only if the request prefix stays unchanged: the document goes first and only the question at the end changes.

How to calculate your own case

  1. Find the average number of input and output tokens. You can estimate input beforehand with count_tokens, and the real numbers appear in the API response in the usage field.
  2. Pick out the part of the request that repeats and put it first.
  3. Multiply by volume and plug in prices from the table.
  4. Run 100 requests and compare your calculation with the spend in the dashboard.

An example request in the OpenAI format:

bash
from openai import OpenAI

client = OpenAI(base_url="https://api.zukko.pro/v1", api_key="fetch_your_key")
r = client.chat.completions.create(
    model="gemini-3.8-flash",
    messages=[{"role": "user", "content": "Classify the request: 'My order did not arrive'"}],
    max_tokens=20,
)
print(r.choices[0].message.content, r.usage)

You can create a key in the dashboard. To start, set a daily dollar limit on the key so a bug in a loop does not drain the balance. Connecting from Russia is described in Gemini in Russia via API: payment by SBP, MasterCard or crypto.

FAQ

Why do 3.8 Flash and 3.7 Flash have the same price?

In the Zukko catalog on October 18, 2026 they cost the same: 0.125 for input and 0.6 for output. The strength index differs (41 and 38), so at equal price it is sensible to start with 3.8 and test on your tasks.

Is a cache write billed separately?

No. For Gemini the gateway counts only cache reads (0.013) when the provider reports them; the request that creates the cache is billed at the ordinary input price of 0.125.

Does Gemini 3.8 Flash accept images?

In the Zukko catalog image input is not marked for 3.8 Flash and 3.7 Flash, so plan on text only for them.

Can I limit spending in advance?

Yes. Each key gets a daily and monthly limit in dollars and a list of allowed models; all of this is set in the dashboard on the keys page.

zukko

Pay 25×
less

for Claude Code & ChatGPT

One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.

Get API keyDocumentation

api.zukko.pro · fetch_*

Gemini API pricing: 3.8 Flash and 3.7 Flash cost · Zukko