Tabbit
ResourcesBlogModels
Tabbit LogoTabbit

Tabbit — The AI Browser that Works for You

Topics

  • AI Browser Resources
  • Agentic Browser Resources
  • Browser Downloads and Install Guides
  • Browser Comparisons
  • AI Browser Alternatives
  • Browser Productivity Resources

Popular Guides

  • AI Browser
  • Agentic Browser Download
  • Best AI Browser 2026: Top 9 Tested & Ranked
  • AI Browser Download
  • Free AI Browser
  • Best AI Browser 2026
  • AI Browser Comparison 2026
  • AI Browser for Windows
  • AI Browser for Mac
  • Chrome Alternative 2026

Events

  • Tabbit Skill Competition
  • KPOP SBTI Fandom Personality Test
  • Tabbit Campus Creator Program
  • fifi's Picks: AI Skills for Research Papers
  • User Survey

About

  • Tabbit Blog
  • Press & Media
English
简体中文English
Prompt guide
OfficialGemini 4 Argon

Gemini 4 Argon: Long Decode continuation protocol and recovery workflow

Original source

Google AI for Developers / Gemini API documentation

AuthorGoogle

Source date2026-10-13

Tabbit curation2026-10-13

Read original

One-sentence takeaway

Argon Long Decode continues in 64K-token background hops. It requires background: true and an output budget above 65,536. Input, thinking, and output share context; every hop is billed.

Use cases

  • Suitable for complex math/science/research, formal proofs, difficult coding, and Agents that need more than 64K tokens; also suitable for evaluations where tools truncate output at the output cap.

  • Generally unsuitable for chat/QA/summaries/classification/extraction, which are usually under 32K; fixed-length writing; multi-turn short tool-call Agents; prompts near the input cap; and latency-sensitive tasks. Long Decode may take minutes.

  • Model: Gemini 4 Argon, gemini-4-argon.

  • APIs: Interactions API background execution; GenerateContent API client-side continuation; Interactions client-side continuation coming soon; examples are provided in Python/JS/REST.

  • Long Decode requires background: true and max_output_tokens > 65,536; start complex reasoning at 262,144; the maximum is 1,048,576 minus input. Use thinking_level: "high" for the hardest tasks; the default is medium for most coding/Agent tasks, and lowering thinking_level saves tokens.

Ready-to-use content

Long Decode server-side continuation protocol

  1. Create a background interaction with max_output_tokens > 65,536 and <= 1,048,576.

  2. The server runs the first hop, up to 64K tokens.

  3. It continues in 64K hops until the task is complete or the configured limit is exhausted.

  4. Each hop adds a model_output step to interaction.steps under the same ID.

  5. Poll or stream the interaction, then join all model_output text.

Python

import time
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-argon",
    input="Write a complete, rigorous proof of the prime number theorem.",
    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)

# Each hop adds a model_output step, so join the text of all of them.
text = "".join(
    content.text
    for step in interaction.steps
    if step.type == "model_output"
    for content in step.content
    if content.type == "text"
)
print(text)
print("Status:", interaction.status)
print("Usage:", interaction.usage)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

let interaction = await client.interactions.create({
  model: "gemini-4-argon",
  input: "Write a complete, rigorous proof of the prime number theorem.",
  background: true,
  generation_config: {
    max_output_tokens: 262144,
    thinking_level: "high",
  },
});

while (interaction.status === "in_progress" || interaction.status === "queued") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  interaction = await client.interactions.get(interaction.id);
}

// Each hop adds a model_output step, so join the text of all of them.
const text = interaction.steps
  .filter((step) => step.type === "model_output")
  .flatMap((step) => step.content ?? [])
  .filter((content) => content.type === "text")
  .map((content) => content.text)
  .join("");
console.log(text);
console.log("Status:", interaction.status);
console.log("Usage:", interaction.usage);

REST

# 1. Create the background interaction. It returns an ID right away.
ID=$(curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-4-argon",
    "input": "Write a complete, rigorous proof of the prime number theorem.",
    "background": true,
    "generation_config": {"max_output_tokens": 262144, "thinking_level": "high"}
  }' | jq -r '.id')

# 2. Poll until the status is no longer in_progress or queued.
#    The REST response has no output_text field, so join the text of every model_output step.
while true; do
  RESP=$(curl -s "https://generativelanguage.googleapis.com/v1beta/interactions/$ID" \
    -H "x-goog-api-key: $GEMINI_API_KEY")
  STATUS=$(echo "$RESP" | jq -r '.status')
  if [[ "$STATUS" != "in_progress" && "$STATUS" != "queued" ]]; then
    echo "$RESP" | jq -r '[.steps[]? | select(.type == "model_output") | .content[]? | select(.type == "text") | .text] | join("")'
    echo "$RESP" | jq '{status, usage}'
    break
  fi
  sleep 5
done

Output limit

Run modeOutput limit
background: false (streaming or non-streaming)65,536 tokens; greater values return 400, and Long Decode is not yet available
background: true, no max_output_tokens set65,536 tokens
background: true, max_output_tokens greater than 65,536The configured value, up to 1,048,576 minus input tokens

You must explicitly set max_output_tokens > 65,536. Check that the Agent or evaluation tool uses the same setting. A lower value, such as 8,192, may stop before thinking is complete.

Choose a run mode

ConfigurationBackground InteractionsClient continuation GenerateContent
InitiatorGoogle serverGoogle GenAI SDK / your own code
Tokens per requestmax_output_tokens within one interaction64K streaming, 32K non-streaming
RuntimeUp to 24h20m
StorageRequires store:trueServer stores none
UseEasiest Long DecodeFiner retry/backoff/error/recovery control

Background Interactions are the simplest option. Client continuation is available through GenerateContent. Interactions advanced client-side continuation is coming soon.

Test or workflow steps

  1. Limit the task to complex reasoning, code, or Agent work; fix the ID, input, and acceptance criteria.

  2. Decide whether more than 64K is needed. Do not enable it by default for ordinary chat/QA/summary/classification/extraction.

  3. Use Interactions with background: true, store: true, and a suitable maximum; start complex reasoning at 262,144, with a maximum of 1,048,576 minus input.

  4. Use thinking_level: "high" for the hardest tasks; use the default medium for most coding/Agent work; lowering it saves tokens.

  5. Poll in_progress/queued until a terminal state; join all model_output steps under the same ID; read usage.

  6. For streaming, set stream: true and thinking_summaries: "auto"; save interaction.created ID and every event_id.

  7. On disconnect, call interactions.get with the last event_id and continue; read through the end, then check status. Use an HTTP read timeout of 15–20m.

  8. Handle terminal states: read completed; execute tools and return results for requires_action; increase the maximum and retry for incomplete; retry failed, and for repeated failures submit the interaction ID where supported; read usage and confirm billing for cancelled.

  9. Record input/thinking/output/cached/total tokens per hop. Do not use total_input_tokens as the context size; estimate prompt + total_output_tokens + total_thought_tokens.

Original evidence and data

  • Long Decode is limited to Argon, with more than 64K and up to 1,048,576 tokens in a shared context; input/thinking/output share that context.

  • The server automatically generates and combines 64K hops, with model_output steps under the same ID.

  • background must be true and max_output_tokens must be greater than 65,536; the maximum is 1,048,576 minus input. Without a setting, the default is 65,536.

  • With background false, streaming and non-streaming output is 65,536; a larger value returns 400, and background Long Decode is unavailable.

  • Background runtime is up to 24h; GenerateContent continuation allows 64K streaming / 32K non-streaming and has a 20m runtime; the server stores no data.

  • For streaming recovery, save the interaction ID and events; use interactions.get with stream: true and the last event_id; replay missed events after completion.

  • Terminal states are completed, requires_action, incomplete, failed, and cancelled, with the handling described above.

  • max_output_tokens includes thinking and visible output. Start long coding/Agent tasks at the 65,536 default; for complex reasoning/math/science/proofs, use background with 262,144.

  • interaction.usage fields are total_input_tokens, total_cached_tokens, total_output_tokens, total_thought_tokens, and total_tokens. In step.stop/status_update streams, values are cumulative; read the latest value rather than adding them.

  • In the repeated-context example, with a 1,000-token prompt and 200,000 tokens of thinking/output across four hops, inputs are 1,000, 66,536, 132,072, and 197,608, for a total of 397,216. With a 95% implicit-cache discount, effective context is approximately 201,000.

  • Every token in every hop is billed, including thinking-only tokens. Intro cached input is $0.10 per 1M tokens; ordinary input is $2.00 per 1M tokens. Cancelled/failed interactions are billed for completed work.

  • To stop a running interaction: Python uses client.interactions.cancel(id=interaction.id), JavaScript uses client.interactions.cancel(interaction.id), and REST uses POST /v1beta/interactions/{id}/cancel.

  • Related links: GenerateContent API Long Decode, Background execution guide, Thinking, Latest Gemini 4 Argon model page.

Scope and limitations

  • It does not directly raise ordinary synchronous output to 1,048,576; use background plus 64K hops.

  • The 1,048,576-token limit is shared by input/thinking/output, so output is reduced by input.

  • max_output_tokens includes thinking and visible output. high only provides more room; the model decides how much to use. Fixed token/word targets are not supported.

  • Repeated context means total_input_tokens can exceed the actual context; do not use it directly for compression/trimming.

  • Background execution requires store: true. The page does not provide another storage schema; do not invent one.

  • Complex tasks can take minutes. Use a 15–20m streaming HTTP timeout and keep the normal connection open between 5K-token chunks; the first 64K takes about the first 10m, with later chunks of about 5,000 tokens.

  • With background false, Long Decode is unavailable; values above 65,536 fail. Future support is noted.

  • The model does not follow a token/word target; Long Decode is not a length controller.

Reproduction notes

  1. Create gemini-4-argon with background: true, store: true, max_output_tokens: 262144, and thinking_level: "high"; record the ID.

  2. Poll the endpoint/SDK until terminal, join model_output, and save usage.

  3. Test the same input at 65,536, 262,144, and near 1,048,576 minus input; record completion, truncation, failure, thinking, and output.

  4. Run a streaming test: save the ID/events, disconnect/reconnect with the last event_id, read to the end, confirm replay, and concatenate the final result.

  5. Construct and record each terminal state; do not treat incomplete empty text as success.

  6. Record tokens/cost per hop; separate the 95% implicit-cache discount from uncached input.

Curated by Tabbit

Prompt material is summarized from public sources and Tabbit editorial notes. Check the original licensing and intended use before copying it.

Gemini 4 Argon

Use in Tabbit

Gemini 4 Argon

Related prompts

OfficialGoogle AI / Google Cloud Blog2026-10-14

Gemini 4 Argon: Google Cloud Enterprise Agent Access Workflow

OfficialGoogle AI / Google Developers Blog2026-10-13

Gemini 4 Argon: Robotics Reasoning and Manipulation Workflows

OfficialGoogle AI for Developers / Gemini API documentation2026-10-13

Gemini 4 Argon: Google Gemini API Shared Context and Model Capability Configuration

OfficialGoogle AI / X / Google Gemini2026-10-13

Gemini 4 Argon: A Multistep Deliverables Workflow in the Gemini App

Gemini 4 Argon

Related reviews

OfficialGoogle Blog (Google DeepMind / Google Developer tools)2026-09-30

Gemini 4 Argon: Google’s Official Release, Access Scope, and Capability Boundaries

OfficialGoogle DeepMind2026-10-13

Gemini 4 Argon Model Card: Safety Evaluation Methods, Threat Models, and Limitations

MediaArtificial Analysis

Gemini 4 Argon (High): Artificial Analysis Independent Benchmarks, Reliability, and Cost

MediaDevin Blog (Cognition)2026-10-13

Gemini 4 Argon: Cognition's FrontierCode Coding Test and Devin Environment