Skip to main content

Gemini: 1M-Token Context, Thinking, Caching

One million tokens shared across input, thinking and output: what changes with Gemini 4 Argon, thinking_level, and when implicit caching saves money.

What do you think about this article?

Gemini: 1M-Token Context, Thinking, Caching
Google Gemini for Developersfedericocalo.dev

At a Glance

One million tokens shared across input, thinking and output: what changes with Gemini 4 Argon, thinking_level, and when implicit caching saves money.

Gemini: 1M-Token Context, Thinking, Caching

Short answer. The context window of gemini-4-argon is 1,048,576 tokens and it is unified: input, reasoning (thinking) tokens and output share it. In Gemini 3 and 2.5 models the budgets are instead separate: 1 million for input, about 64,000 for output (the 3.8 Flash page says 65,536). Three practical consequences. First: filling the window costs money — on 30 October 2026 a single request of one million input tokens is worth about 2.10 dollars with Argon and 0.79 with 3.8 Flash, on every call. Second: reasoning is billed as output, and is tuned with thinking_level (low, medium, high; the default is medium). Third: if you resend the same large prefix many times, implicit caching lowers the cost by itself, but only above a minimum token threshold and only if the prefix is identical.

Series "Google Gemini for Developers", article 4 of 6. I am not affiliated with Google. Sources consulted on 30 October 2026: long context, thinking, caching, pricing, Argon model page. The "tokens to pages" equivalences are my estimates, and I say so where I use them.

What "a million tokens" means in practice

A token is not a word: in many languages it is smaller than a word, because words are long and often split. As an order of magnitude of mine, not from the documentation, a million tokens is several hundred pages of continuous text. That is enough for a medium-sized codebase, a folder of contracts, the technical documentation of a machine. It is not enough for a corporate archive: forty thousand pages of manuals do not fit in one request, however big the window. To really measure your documents, do not trust a rule: measure the real tokens of your files before designing (the response reports token usage; I did not verify a pre-count method).

For requests to gemini-4-argon there is an operational detail that breaks code written for earlier models. If the sum of input and max_output_tokens exceeds 1,048,576, the API reduces the output to the space left. And the default output for synchronous requests is 65,536 tokens; with "long decode" mode it can reach 1,048,576. It means that with a 900,000-token input the maximum answer is about 148,000, and that whatever the model uses to reason takes space from the answer.

The cost of filling the window

Prices from the page consulted on 30 October 2026, per million input tokens: Argon 2 dollars through 30 November, then 4; 3.8 Flash 0.75 through 31 December, then 1.50. A request using the whole window:

  • Argon: 1.048576 × 2 ≈ 2.10 dollars; from December ≈ 4.19.
  • 3.8 Flash: 1.048576 × 0.75 ≈ 0.79 dollars; from January ≈ 1.57.

A hundred questions in a row on the same dossier, without caching, is 210 dollars with Argon (November) and 79 with the Flash. The sum must be done before deciding "let's put everything in the context".

Long context or selective retrieval: a trade-off

The long-context page is honest on a point marketing material omits: retrieving a single fact in a huge text is highly accurate, but when the question needs several scattered facts accuracy drops, and varies with the content. It adds that each query pays the whole input: getting a hundred facts at high accuracy may take a hundred requests, which caching can reduce. It advises not sending needless tokens, putting the question at the end of the prompt, and warns that longer inputs increase time to first token.

Everything in contextSelective retrieval (RAG)
BuildAlmost nothingIndex, chunking, ranking to maintain
Cost per questionHigh (all the input), reduced by cacheLow (only the passages)
Cross-cutting questions (compare A with B)StrengthWeakness: you need the right passage
Archive larger than the windowImpossiblePossible
Source traceabilityAsk for it in the promptNatural (you have the chunk)

The rule I would use: long context wins when the material is a closed set, queried many times with cross-cutting questions; retrieval wins when the archive grows or changes every day. And in both cases ask for the literal quotation of the passage, because it is the only way to catch an invention.

Thinking: reasoning you pay for

The control is thinking_level inside the generation configuration, with the values low, medium, high. Both Argon and 3.8 Flash start with thinking on at medium. The 3.8 Flash page specifies that the minimal level is not supported and returns an error. Reasoning tokens are billed as output (the output price includes them) even though the API returns only a summary of the thoughts; to receive it you set thinking_summaries to "auto", but the code must handle the case where it is empty.

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input=question,
    generation_config={"thinking_level": "low"},
)

The trickiest detail: max_output_tokens includes thinking tokens. If the model exhausts the limit while reasoning, the status is incomplete and the text may be missing. The page recommends lowering thinking_level, not tightening the limit. A calculation with a declared hypothesis: if a task generates on average 5,000 reasoning tokens and you make 10,000 requests, that is 50 million extra output tokens: 187.50 dollars with 3.8 Flash at 3.75 per million, 500 dollars with Argon at 10 (November). Thinking at high on simple tasks is money thrown away; on a long planning task it is the part that gives value.

Implicit caching: discounts with no code, under three conditions

Implicit caching is on by default for 2.5 and newer models. It works with stateful and stateless conversations and the saving is passed on automatically. Conditions: a minimum token threshold (4,096 for Argon, 3.8 Flash, 3.6 Flash and 3.1 Pro Preview; 2,048 for 2.5 Flash and 2.5 Pro); an identical prefix (put the large common content first, the question last); requests close in time. For Argon and later, in a conversation the previous request is cached in full only if the new one adds at least 2,050 tokens; otherwise the last 2,050 are reprocessed at full price. You see cached tokens in usage.total_cached_tokens. Important: explicit caching is supported neither by Argon nor by Interactions; to use it you need generateContent with the 3 and 2.5 models. The discount percentage is not on the page I read, so I do not write it: measure it on your own cached tokens.

Four cases, where the window opens something that was not there before

Technology: reviewing a whole repository

Who and what they did by hand. A developer inheriting an undocumented service spends days reading modules to understand who calls what. What changes. If the source fits in about 400,000 tokens, they load it at the top of the prompt and ask cross-cutting questions ("which modules write to the orders table?"). Without caching, each question costs 400,000 × 0.75 / 1,000,000 = 0.30 dollars with 3.8 Flash or 0.80 with Argon (November); fifty questions: 15 or 40 dollars. What goes wrong. The model may omit one caller among many (retrieval of several facts loses accuracy): the list obtained is a starting point, not proof of absence. For changes you still need a text search in the code and the tests.

Everyday life: the thesis and the notes

Who and what they did by hand. A graduating student rereads two hundred pages of draft three times to check that citations, figure numbers and definitions are consistent. What changes. She loads the draft and bibliography (hypothesis: 150,000 tokens) and asks for inconsistencies: it costs 150,000 × 0.75 / 1,000,000 ≈ 11 cents per check. What goes wrong. Two things. An unpublished draft is intellectual property: on the free tier the terms allow the content to be used to improve products. And if the model finds no inconsistencies it does not mean there are none: an incomplete list is the expected behaviour, not an error.

Small business: the engineering office and the tender specification

Who and what they did by hand. A surveyors' office of four people receives for a tender a 400-page specification and must compare it with its own bill of quantities and the standard contract, looking for conflicting clauses: days of a senior technician's work (hypothesis). What changes. The three documents fit together in the window, which with selective retrieval is hard because the conflict is between documents. Cost per pass with 3.8 Flash: a few tenths of a dollar. What goes wrong. An unflagged penalty clause is professional liability: the output is a list of points to verify with the paragraph quoted, checked by a technician; none of these documents goes into an unpaid service, because tender documents may contain the client's confidential information.

Large enterprise and healthcare: a hospital's internal protocols

Who and what they did by hand. Staff search the internal procedures (hundreds of PDF documents) for the current version of a protocol; the quality office answers requests. What changes. An internal service loads the body of current protocols, a closed set that updates on few dates, and answers citing document, version and page; the fixed prefix exploits implicit caching. If the corpus exceeds the window, you switch to retrieval. What goes wrong. The protocols contain no patient data, but the questions can: a filter is needed to stop identifying data being pasted, because health data is a special category under the GDPR. If use slides from "find the protocol" to "what should I do with this patient", it enters clinical decision support, and I did not verify whether that falls under medical-device regulation: it is a question for the regulatory office, before the code. Where data resides and which contractual guarantees exist for a European body I did not verify.

What I did not verify

  • The equivalence between tokens and pages: it is my estimate, yours depends on language and format.
  • The implicit-cache discount percentage and the storage price of explicit caching: they do not appear in the pages I read.
  • The knowledge cutoff of Argon and 3.8 Flash: the model pages do not give it.
  • Long-context retrieval benchmarks for the current models: none read at the source.

The series

  1. Gemini for Developers: Models and Pricing
  2. Gemini API: Key, SDK and the Interactions API
  3. Functions, structured JSON and Google Search
  4. This article
  5. Tiers, limits and data privacy
  6. After Gemini CLI: Antigravity, gemini-api and the comparison

Sources consulted on 30 October 2026

Commenti

Caricamento commenti...

Sign in to comment

Discuss this article in the community

Join the Telegram group to discuss with other developers, ask questions and share your experiences.

Did you like this article?

Explore other content on the blog or discover my projects