Gemini 4 Argon can write a single response of up to about 1 million tokens, but not by default. Argon went generally available on the paid Gemini API on October 13, 2026 as gemini-4-argon, and synchronous requests default to 65,536 output tokens. To go further, you use Google’s long-decode recipe: an Interactions API call with background: true and a max_output_tokens above 65,536. The ceiling is shared, too. Input, thinking and output all fit in one 1,048,576-token window, so your output budget is 1,048,576 minus your prompt.
A response that long breaks three assumptions most API stacks rely on: a call finishes in seconds, the body fits in memory, and one request has a small, predictable cost. This guide covers the window math, cost and spend limits, Google’s long-decode code, timeouts, caps, storage, and how to test it all in Apidog. For the model overview, see what Gemini 4 Argon is; for request shapes, see the Gemini 4 Argon API guide.
One 1M window, shared by input, thinking and output
Google’s Argon model page describes a “unified 1M context window”: 1,048,576 tokens that input, thinking and output all draw from. So 1M isn’t an output allowance stacked on top of a separate input window. It’s one budget:
- A 1,000-token prompt leaves 1,047,576 tokens for thinking plus visible output.
- A 200,000-token prompt leaves 848,576.
- An 800,000-token codebase leaves 248,576.
Some early headlines called the 1M figure a “16-fold larger context window.” That still misses. Gemini 3.1 Pro Preview and Gemini 3.8 Flash already accept 1,048,576 input tokens. What grew is how much of the window one response can fill: from a 65,536-token cap to nearly all of it.
| Model | Max output per response | Context or input window |
|---|---|---|
| Gemini 4 Argon | 65,536 default; up to 1,048,576 minus input with long decode | 1,048,576, unified (input + thinking + output) |
| Gemini 3.1 Pro Preview | 65,536 | 1,048,576 input |
| Gemini 3.8 Flash | 65,536 | 1,048,576 input |
| GPT-6 Astra | 128,000 | 1,050,000 (922K max input) |
| Claude Opus 5.5 | 128K (300K on Batch with a beta header) | 1M |
Note the first row. Argon’s synchronous default, 65,536, is lower than the 128K that GPT-6 Astra and Claude Opus 5.5 allow on a normal call. The difference is the background long-decode path, which reaches about 8x their synchronous cap. Google’s reason for the headroom is depth of reasoning: the launch post says the model can “generate hundreds of thousands of tokens in a single trajectory.” For how other vendors handle long runs, see Claude Opus 5.5’s 18-hour tasks and the GPT-6 Astra API guide.
What a maxed-out response costs
Price the ceiling first. Per the Gemini API pricing page, as of October 15, 2026, Argon output, thinking included, bills at $10 per 1M tokens through November 30, 2026, and $20 from December 1. Input is $2, then $4.
- Tiny prompt, about 1M output: roughly $10 through November 30, roughly $20 after.
- 200,000-token prompt plus the full 848,576 output: 0.2M x $2 = $0.40 input and 0.848576M x $10 = $8.49 output, so $8.89 now. From December 1 it’s $0.80 + $16.97 = $17.77.
Thinking tokens count against you twice: they bill as output, and they use the same window. A short visible answer can still carry a large output bill. The Gemini 4 Argon pricing guide covers more scenarios, including implicit caching at 95% off on prompts of 4,096 tokens or more.
Batch and Flex bill output at half ($5, then $10), but Google’s guide doesn’t say long decode runs on Batch, so price long decodes at Standard rates.
The spend limit one call can fill
The rate-limits page adds a spend-based limit over a rolling 10-minute window: $10 on Tier 1, $50 on Tier 2, $200 on Tier 3. One maxed long decode at the rate through November 30 is about $10, a whole Tier 1 window. From December 1 it’s about $20, double what Tier 1 allows in 10 minutes.
Tier 1 only needs linked billing. Tier 2 needs $100 of cumulative Google Cloud spend, counted 3 days after your first payment. If long decodes are part of your plan, budget for Tier 2 before December. Per-model RPM, TPM and RPD aren’t in the docs; they show on AI Studio’s rate-limit page for your project.
Google’s long-decode recipe
Long decode is how you get past 65,536. Google’s developer guide describes three steps:
- Call the Interactions API with
background: trueandgeneration_config.max_output_tokensabove 65,536 (up to 1,048,576 minus your input). - The model writes in hops of up to 64K. The server runs the continuation hops for you, and each hop adds a
model_outputstep tointeraction.steps. - Poll the interaction until it finishes, then join the text from every
model_outputstep.
Leave out max_output_tokens and a background call stops at 64K. Here’s Google’s Python example (google-genai SDK), with the model in a variable and the result written to disk:
import os, time
from google import genai
MODEL = os.environ.get("GEMINI_MODEL", "gemini-4-argon")
client = genai.Client()
interaction = client.interactions.create(
model=MODEL,
input="Write a test plan for every endpoint in a payments API.",
background=True,
generation_config={"max_output_tokens": 262144, "thinking_level": "high"},
)
while interaction.status in ("in_progress", "queued"):
time.sleep(5)
interaction = client.interactions.get(id=interaction.id)
text = "".join(
c.text
for s in interaction.steps if s.type == "model_output"
for c in s.content if c.type == "text"
)
with open("response.txt", "w", encoding="utf-8") as out:
out.write(text)
Two details matter. If a joined response reads as if it stops mid-thought, check that you collected every model_output step, not only the last one. And keep interaction.id: background runs depend on stored interactions, so if your poller crashes you fetch the same interaction again instead of starting a new one and paying twice. Client-side continuation through generateContent is another documented option; Google lists client-side continuation on Interactions as “coming soon.”
Timeouts at every hop
Background mode moves the long wait off a single HTTP connection and into your polling loop. Synchronous calls still wait: Google says hard prompts take minutes and recommends background mode or HTTP timeouts of at least 15 minutes. Check every hop either way:
| Hop | What to check | Symptom when it’s wrong |
|---|---|---|
| HTTP client | Read and total timeouts of 15+ minutes on synchronous calls | Failures on hard prompts only |
| Reverse proxy | Read timeout | Requests cut off at the proxy’s limit |
| API gateway | Maximum request duration | Requests fail at the same elapsed time every run |
| Load balancer | Idle timeout | Drops while the model is still thinking |
| Serverless function | Maximum execution time | The poll loop dies before the interaction finishes |
If long jobs always fail at the same elapsed time, some hop has a hard limit. For long decodes, save the interaction ID with the job and poll from a scheduled worker instead of holding a request open.
Cap output on purpose
The 1M ceiling is a limit, not a target. Google’s guidance: keep the 65,536 default for standard tasks. If your app sets a cap under 32K, raise it to at least 32,768, because thinking eats the budget; lower the thinking level instead of starving the answer. For complex reasoning or coding, use background mode with 131,072 or 262,144. Argon’s thinking levels are low, medium (the default) and high; there’s no minimal.
Then pick the cap from the cost you’ll accept per call:
| Output cap | Worst case through Nov 30 ($10/1M) | From Dec 1 ($20/1M) |
|---|---|---|
| 65,536 (default) | $0.66 | $1.31 |
| 131,072 | $1.31 | $2.62 |
| 262,144 | $2.62 | $5.24 |
| 500,000 | $5.00 | $10.00 |
| 1,000,000 | $10.00 | $20.00 |
A response that hits the cap stops early, so treat it as incomplete. Raise the cap for that one job, or continue in a follow-up turn with previous_interaction_id.
Store and parse huge outputs without buffering
A million tokens is megabytes of text per response. A few rules keep that from taking down a worker:
- Write the output to a file or object storage, as the example does, not into a database row or a log line.
- Keep the interaction ID with the job record. A blind retry generates, and bills, the output again.
- Ask for JSON Lines when you need structure, so each line parses on its own instead of waiting for one giant document to close.
- Check column and message-size limits in your database and queue before an 800K-token answer hits them.
Test it in Apidog before you run a 1M job
Rehearse the whole flow at a small budget first. Download Apidog and work through three checks.
Run a multi-hop job. Store GEMINI_API_KEY and GEMINI_MODEL (set to gemini-4-argon) as environment variables. Save a POST https://generativelanguage.googleapis.com/v1beta/interactions request with "model": "{{GEMINI_MODEL}}", "background": true and "generation_config": {"max_output_tokens": 131072, "thinking_level": "medium"}. In a test scenario, extract the interaction ID into a variable, then poll it in a loop with a wait step, using the get-interaction call from Google’s Interactions docs. The worst case at this cap is 131,072 x $10/1M = $1.31.
Assert on what comes back. Check that the status has left queued and in_progress, count the model_output steps, and confirm the joined text isn’t empty. On a synchronous generateContent call, assert that usageMetadata.candidatesTokenCount plus thoughtsTokenCount stays at or under your cap, and that the computed cost stays under your ceiling at $10 per 1M output tokens. The Argon API guide has a cost script.
Find your timeout. Send one hard synchronous prompt directly with a 15-minute client timeout, then send it through your own gateway. If the direct call finishes and the gateway call doesn’t, the elapsed time Apidog reports tells you which limit to raise.
FAQ
Is Gemini 4 Argon’s 1M a context window or an output limit? Both, as one budget. Argon has a unified 1,048,576-token window for input, thinking and output. With long decode, output can use whatever your prompt leaves.
How much does a 1M-token Argon response cost? About $10 of output through November 30, 2026, and about $20 from December 1, plus input. On Tier 1, $10 is also the entire rolling 10-minute spend limit.
Can I generate a 1M-token response now? Yes, on a paid tier: the Interactions API with background: true and max_output_tokens up to 1,048,576 minus input. Argon has no free API tier; see is Gemini 4 Argon free.
Do I need streaming for long Argon responses? Google’s documented route is background mode plus polling, not one long-held connection. For synchronous hard prompts, Google says to set HTTP timeouts to at least 15 minutes.
How does Argon’s output limit compare to GPT-6 Astra and Claude Opus 5.5? Both cap synchronous output at 128K; Anthropic allows 300K on Batch with a beta header. Argon’s synchronous default is 65,536, but long decode reaches about 8x their synchronous cap.
Your next step
Set GEMINI_MODEL to gemini-4-argon, run one 131,072-token background job, and confirm your code joins every model_output step and survives a multi-minute poll. Check your spend tier before December 1, when a maxed decode doubles to about $20. Then save the flow as a test scenario in Apidog so every model or cap change reruns it.



