AI agents

Gemini 4 Argon API: migrating from Gemini 3, the shared 1M-token budget and long decode

What changes when you move to gemini-4-argon: ignored sampling params, no explicit caching, a shared 1M budget and long decode costs.

Kemo
Updated 8 min read
Mountain roads by Diego Jimenez
On this page
  1. What changed between the September and October announcements
  2. Four settings that behave differently from Gemini 3
  3. How long decode works
  4. What long outputs cost
  5. When not to use long decode

Google opened Gemini 4 Argon to paid API customers on 13 October, two weeks after a restricted launch to security partners (Google, The New Stack). The model ID is gemini-4-argon. The headline is a "1M token" limit, and that number has changed meaning since the first announcement: on 30 September Google described it as a 1M-token output cap, and it is now a single 1,048,576-token budget shared by input, thinking and output. Outputs beyond 64K tokens also come from a new mechanism, long decode, which works differently from a normal request.

If you are moving an app or an agent from Gemini 3.x, four things will bite: sampling parameters are ignored, explicit caching is gone, max_output_tokens now caps thinking as well as the answer, and long outputs need background execution and a polling loop. This article goes through each, with the code to change and the cost arithmetic behind long outputs.

What changed between the September and October announcements

The first Argon post, on 30 September, said the output limit had been expanded "to an industry-leading 1M tokens, up from the previous 64K tokens". The 13 October post calls it a "1M unified input-output token limit". The model page settles it: the context window, input and output combined, is 1,048,576 tokens, and the default maximum output is 65,536 tokens per synchronous request, up to the full window with long decode.

In practice, the space for the answer is whatever your prompt leaves. The New Stack's example: load 800,000 tokens of code and you have 200,000 left for thinking and output together (The New Stack). The same article notes that Claude Opus 5.5 is described with a 1M context window plus a separate 128,000-token output cap, so the two "1M" figures are not the same thing.

PropertyGemini 4 ArgonSource
Model IDgemini-4-argonModel page
Context window (input + thinking + output)1,048,576 tokensModel page
Output per synchronous request65,536 tokensLong decode docs
Inputs / outputText, image, video, audio, PDF / text onlyModel page
Thinking levelslow, medium (default), highLatest model guide
CachingImplicit onlyModel page
Not supportedLive API, image and audio generation, free tierModel page, Pricing

Four settings that behave differently from Gemini 3

Google's latest-model guide lists the changes for moving to Argon. These are the ones that change code.

temperature, top_p and top_k are ignored. The guide says to remove them, and "If provided, they are ignored." Nothing errors, so a pipeline that relied on temperature=0 for repeatable output quietly loses it. If you used low temperature to keep tests stable, assert on structure (structured output is supported) rather than exact text.

Explicit caching is not supported. "Explicit caching (cachedContents / caches.create) is not supported on Gemini 4 Argon." Remove the code that creates caches or passes cached_content. Implicit caching is on by default for prompts of at least 4,096 tokens and gives a 95% discount on cache hits, but you no longer choose what is cached, so put the stable part of your prompt (system instructions, the document, the tool definitions) first and keep it byte-identical between calls.

max_output_tokens caps thinking and answer together. It is a hard limit on both. The guide's advice is to keep the default of 65,536 for normal tasks and, if your app sets a limit below 32K, to raise it to at least 32,768. A low cap does not make the model think less; it cuts the response off, and at high thinking the visible answer can be empty (long decode docs).

Thinking is set by level, not budget. Use thinking_level with low, medium or high; the AI SDK provider docs note that thinkingBudget is not supported on these models. Google recommends running your evaluations at all three levels and picking the lowest one that meets your quality bar.

For a typical generateContent call with the google-genai Python SDK, the change looks like this:

summarise.pyDiff
  response = client.models.generate_content(-     model="gemini-3.1-pro-preview",+     model="gemini-4-argon",      contents=[document, question],      config=types.GenerateContentConfig(-         temperature=0.2,-         cached_content=cache.name,-         max_output_tokens=8192,+         max_output_tokens=32768,+         thinking_config=types.ThinkingConfig(thinking_level="medium"),      ),  )

How long decode works

A single model call still produces at most about 64K tokens. Long decode chains calls on the server: when one hop ends, the next starts where it stopped, each hop adds a model_output step to the same interaction, and this repeats until the model finishes or the budget runs out (long decode docs). You set the budget with max_output_tokens, which is cumulative across hops, not per hop.

On the Interactions API, long decode only happens with background: true and max_output_tokens above 65,536. Without background execution, values above 65,536 return a 400 error; with background execution and no max_output_tokens, output stops at 64K. Google says long decode without background execution is "coming soon". The AI SDK docs add that it is not available on the Vertex AI Interactions API.

Your serviceInteractions APIbackground: trueHop 1up to ~64K tokensHop 2resumes from hop 1Hop nuntil done or budget spentInteraction stepsmodel_output × ncreate,max_output_tokens> 65,536appendpoll by id, jointext
  • Your service → Interactions API: create, max_output_tokens > 65,536
  • Interactions API → Hop 1
  • Hop 1 → Hop 2
  • Hop 2 → Hop n
  • Hop n → Interaction steps: append
  • Your service → Interaction steps: poll by id, join text
One interaction id, many hops; the client polls and joins every model_output step.

A background interaction can run for up to 24 hours. Google says that after the first 64K tokens, roughly ten minutes in, output arrives in chunks of about 5,000 tokens and pauses between chunks are normal. HTTP read timeouts should be at least 15 to 20 minutes per stream (long decode docs).

A polling loop that handles every status

The interaction's status tells you what to do next. completed means join the model_output steps. incomplete means the budget ran out, possibly while thinking, so the text may be empty. requires_action means a tool call is waiting. failed covers server errors and runs over 24 hours. cancelled means you cancelled it, and you still pay for the work done (long decode docs).

long_decode.pyPython
import sysimport time from google import genai client = genai.Client()  # reads GEMINI_API_KEY job = client.interactions.create(    model="gemini-4-argon",    input=open(sys.argv[1], encoding="utf-8").read(),    background=True,    store=True,    generation_config={        "thinking_level": "high",        "max_output_tokens": 262_144,  # cumulative across hops    },)print("interaction", job.id, file=sys.stderr)  # persist this id deadline = time.monotonic() + 3 * 3600while job.status in {"queued", "in_progress"}:    if time.monotonic() > deadline:        # A local timeout does not stop the remote run: resume or cancel by id.        sys.exit(f"still running: {job.id}")    time.sleep(10)    job = client.interactions.get(id=job.id) if job.status == "incomplete":    sys.exit(f"budget spent before the model finished: {job.id}; raise max_output_tokens")if job.status != "completed":    sys.exit(f"{job.status}: {job.id}") text = "".join(    part.text    for step in job.steps    if step.type == "model_output"    for part in step.content    if part.type == "text")print(text)print(job.usage, file=sys.stderr)

The request fields (background, store, generation_config.thinking_level, max_output_tokens) and the response fields (status, steps, model_output, usage) come from Google's Interactions API reference and long decode docs. The SDK method names interactions.create and interactions.get follow a DEV Community migration guide whose author says the code was syntax-checked but not run against the model, and neither was ours. Check both against the current SDK.

If you stream instead of polling, save the interaction id from the interaction.created event and the last event_id you processed. After a dropped connection, reconnect with last_event_id and read to the end of the stream before you check the status (long decode docs).

What long outputs cost

Argon has no prompt-size tiers. Until 30 November it is on an introductory price; from 1 December the standard rate doubles (Gemini API pricing):

Argon's price doubles on 1 DecemberUS dollars per million tokens, standard tier
Argon, to 30 NovArgon, from 1 DecGemini 3.1 Pro Preview, prompts ≤200K
05101520InputOutput (incl. thinking)Cached input

Source: Google, Gemini Developer API pricing (ai.google.dev), October 2026

Argon's price doubles on 1 December
Argon, to 30 NovArgon, from 1 DecGemini 3.1 Pro Preview, prompts ≤200K
Input242
Output (incl. thinking)102012
Cached input0.10.20.2

Batch and Flex are half the standard rate (1 in and 5 out during the introductory period), which suits long, non-urgent jobs.

With long decode, every hop is billed in full, including hops that are all thinking, and each hop re-reads the prompt plus everything generated so far. Implicit caching gives that repeated input the 95% discount (long decode docs). Here is the arithmetic for a 12,000-token prompt that produces 150,000 output tokens in hops of 65,536, at introductory prices. These are our calculations from Google's published rates, not measured bills:

HopInput readOutput
112,00065,536
277,53665,536
3143,07218,928
Total232,608150,000

Output costs 150,000 × 10 / 1M = 1.50. Input costs between about 0.47, if nothing hits the cache (232,608 × 2 / 1M), and about $0.05, if everything after the first prompt does. Output dominates, and the thinking tokens count as output. From 1 December, double both.

When not to use long decode

Google's own guidance is narrow: use it for hard maths, science, research, formal proofs and the hardest coding or agent tasks. Most chat, Q&A, summarisation, classification and extraction finishes under 32K tokens. Agents that make many short tool calls should not use it, because large outputs fill the shared window quickly. The model also does not follow length targets such as a word count (long decode docs).

A 1M window that holds input, thinking and output is a budget you spend, not an output size you get.

On quality, wait for numbers that are not Google's. Its launch table puts Argon first on DeepSWE v1.1 at 77.9%, but behind GPT-6 Astra and Claude Opus 5.5 on Terminal-Bench 4.0 (57.4% against 58.2% and 66.4%) and last of four on FrontierSWE v2 at 55.0% (Google DeepMind, MarkTechPost). All are vendor-reported. The New Stack also notes that Artificial Analysis evaluated the 30 September version, not necessarily the model released on 13 October.

Discussion

Join the discussion

Sign in with Google, Apple or an email code to comment and reply.

More in AI agents

One practical article a week

Follow k13 in any RSS reader. No account needed.