Gemini 4 Argon API: How to Migrate from Gemini 3.x

To use the Gemini 4 Argon API, change your model string to gemini-4-argon, upgrade the Google Gen AI SDK, and pick a thinking_level (low, medium or high). Then remove the parameters the model ignores or rejects: temperature, top_p, top_k and explicit context caching. You also need a paid-tier key, a max_output_tokens of at least 32,768, and HTTP timeouts measured in minutes, not seconds.

Google made Gemini 4 Argon available to developers on October 13, 2026. Introductory pricing runs until November 30, 2026, and the price doubles on December 1. This guide covers the model ID, pricing, a working first request in Python, JavaScript and curl, and a checklist for moving an existing Gemini 3.x app. All facts come from Google's API docs and announcement, checked on October 21, 2026. The code follows the official examples. We did not run a benchmark for this article.

Gemini 4 Argon API at a glance

ItemValue
Model IDgemini-4-argon (stable)
Inputs / outputText, image, video, audio, PDF in; text out
Context window1,048,576 tokens, shared by input, thinking and output
Default max output65,536 tokens (SDK and streaming), 32K for non-streaming REST
Long decodeUp to about 1M output tokens with background mode or SDK auto-continuation
Thinking levelslow, medium (default), high
Free tierNot available

Supported tools include function calling, structured outputs, code execution, Search grounding, Google Maps grounding, URL context, file search and computer use (preview). The model does not support the Live API, image or audio generation, or explicit caching. You can call it through Batch, Flex and Priority inference as well as standard requests.

Gemini 4 Argon pricing: intro rate vs December 1

Prices are per 1 million tokens, from the Gemini API pricing page. Output includes thinking tokens.

TierInput (to Nov 30 → from Dec 1)Output (to Nov 30 → from Dec 1)Cached input
Standard$2.00 → $4.00$10.00 → $20.00$0.10 → $0.20
Batch / Flex$1.00 → $2.00$5.00 → $10.00$0.05 → $0.10
Priority$3.60 → $7.20$18.00 → $36.00$0.18 → $0.36

Caching here means implicit caching only. It turns on automatically for prompts of at least 4,096 tokens. Search and Maps grounding each include 5,000 free requests per month, shared across Gemini 3 and later models, then cost $14 per 1,000.

For comparison, Gemini 3.1 Pro Preview costs $2.00 input and $12.00 output on Standard for prompts up to 200K tokens. Argon has no long-prompt price tier, but its December rates are higher.

Example cost calculation

Assume 2,000 requests per day, each with 20,000 input tokens and 8,000 output tokens (thinking included), and no cache hits. That is 40M input and 16M output tokens per day.

Model and periodInput costOutput costDaily total
Argon Standard, intro40 × $2 = $8016 × $10 = $160$240
Argon Standard, from Dec 140 × $4 = $16016 × $20 = $320$480
Argon Batch, intro40 × $1 = $4016 × $5 = $80$120
Gemini 3.1 Pro Preview, Standard40 × $2 = $8016 × $12 = $192$272

Your real bill depends on how many thinking tokens each request uses, and that changes with thinking_level. Measure output tokens on your own prompts before you budget for December.

How to call the Gemini 4 Argon API

You need a paid-tier API key from Google AI Studio. Store it in the GEMINI_API_KEY environment variable, and the SDKs pick it up automatically.

export GEMINI_API_KEY="<YOUR_GEMINI_API_KEY>"
pip install -U "google-genai>=2.30.1"
npm install "@google/genai@>=2.29.1"

These SDK versions are the minimum Google lists for automatic long decode. Older versions can still call the model, but they stop at the per-request output cap.

Python (generateContent)

from google import genai
from google.genai import types

client = genai.Client()

response = client.models.generate_content(
    model="gemini-4-argon",
    contents="Refactor this function to remove the global state: ...",
    config=types.GenerateContentConfig(
        max_output_tokens=65536,
        thinking_config=types.ThinkingConfig(thinking_level="medium"),
    ),
)

print(response.text)

JavaScript (Node.js)

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

const ai = new GoogleGenAI({});

const response = await ai.models.generateContent({
  model: "gemini-4-argon",
  contents: "Refactor this function to remove the global state: ...",
  config: {
    maxOutputTokens: 65536,
    thinkingConfig: { thinkingLevel: "medium" },
  },
});

console.log(response.text);

If you are moving your Node services at the same time, our Node.js 26 LTS upgrade checklist covers the runtime side.

REST with curl

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-4-argon:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{
    "contents": [{"parts": [{"text": "Explain the difference between a mutex and a semaphore."}]}],
    "generationConfig": {
      "maxOutputTokens": 32768,
      "thinkingConfig": {"thinkingLevel": "low"}
    }
  }'

Set maxOutputTokens explicitly on REST calls. Without it, a non-streaming REST request is capped at 32K tokens.

Interactions API and background jobs

Google's newer Interactions API is the main path in the "What's new in Gemini 4 Argon" guide. It keeps conversation state on the server with previous_interaction_id. It also supports background=True for long jobs that you poll instead of holding a connection open.

import time
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-argon",
    input="Write a migration plan for moving this monolith to services: ...",
    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)

Long outputs arrive in hops of up to 64K tokens, and each hop adds a model_output step. Join the text of every model_output step to get the full answer.

If you set background: true but leave out max_output_tokens, the server stops after 64K tokens.

Migrate to Gemini 4 Argon from Gemini 3.x

Gemini 4 Argon API migration flow from model ID change to thinking level evaluation
Gemini 4 Argon migration in six steps
View PlantUML source
@startuml
skinparam shadowing false
skinparam defaultFontSize 15
skinparam ActivityBackgroundColor #EEF4FF
skinparam ActivityBorderColor #3B6FD8
start
:Set model to gemini-4-argon;
:Upgrade SDK
(google-genai 2.30.1+);
:Remove temperature, top_p,
top_k, cached_content;
:Raise max_output_tokens
to 32,768 or more;
:Raise HTTP timeout
or use background mode;
:Test low / medium / high;
stop
@enduml

Work through these changes in order. Each row comes from Google's migration notes.

Old settingWhat happens on ArgonWhat to do
temperature, top_p, top_k, candidate_countIgnored, no errorDelete them so your config shows real behavior
cachedContents / caches.create / cached_contentNot supported, returns an errorRemove; rely on implicit caching
thinking_budgetMapped to the nearest thinking_level, with a warningSwitch to thinking_level
max_output_tokens below 32KThinking can use up the cap and cut off the answerSet at least 32,768
Short HTTP timeouts (30–120 s)Hard prompts can take several minutesUse background mode or a longer timeout
Resume with continuation_token but same cap400 INVALID_ARGUMENTRaise max_output_tokens when resuming

Find old parameters in your code

Run this from your project root to list every place that still sends the removed settings:

grep -rnE "temperature|top_p|top_k|topP|topK|candidate_count|cached_content|cachedContent|caches\.create|thinking_budget|thinkingBudget" \
  --include="*.py" --include="*.js" --include="*.ts" .

Not every hit matters, because other models in the same codebase may still use these settings. Change only the calls that will point at gemini-4-argon.

Set a longer HTTP timeout

The two Google guides give slightly different numbers. The Interactions guide says at least 15 minutes, and the generateContent guide says at least 20 minutes. Use 20 minutes to cover both. In the Python SDK, the timeout is in milliseconds:

from google import genai
from google.genai import types

client = genai.Client(http_options=types.HttpOptions(timeout=20 * 60 * 1000))

Behind a reverse proxy or serverless function, check its timeout too. A 60-second gateway limit will cut the request before the SDK does. For those setups, background mode with polling is the safer choice.

Keep thought signatures in multi-turn calls

For multi-turn chats and function calling with generateContent, send back the full conversation history, including the thought signatures the model returned. If you build the history by hand and keep only the text parts, you drop those signatures. The simplest fix is to use the SDK chat helpers, or to move to the Interactions API with previous_interaction_id.

Choose a thinking level

LevelCost and speedGood fit
lowFewest tokens, lowest latencyClassification, extraction, short answers
medium (default)BalancedMost coding and agent tasks
highMost tokens, slowest first tokenHard math, science, difficult debugging

Google recommends running your evaluation set at all three levels and keeping the lowest one that meets your quality bar. Because output price includes thinking, this choice affects cost more than any other setting. For automation pipelines that call a model from scripts, the same approach applies as in our guide to running Claude Code headless with n8n on macOS: log the token usage of each run so you can compare.

FAQ

Is there a free tier for the Gemini 4 Argon API? No. Google's model and pricing pages say Gemini 4 Argon is not available on the free tier. You need a paid-tier key in Google AI Studio.

What is the Gemini 4 Argon model ID? Use gemini-4-argon. It is the stable version listed on the model page as of October 21, 2026.

Why does my temperature setting have no effect? Gemini 4 Argon ignores temperature, top_p, top_k and candidate_count. Control output with thinking_level and your prompt instead.

Why do I get an error about cached content? Explicit caching (caches.create and cached_content) is not supported on this model. Remove it. Implicit caching applies automatically to prompts of 4,096 tokens or more.

When does Gemini 4 Argon pricing go up? The introductory rate ends on November 30, 2026. From December 1, 2026, Standard input rises from $2 to $4 and output from $10 to $20 per 1M tokens.

Summary

Switch the model string to gemini-4-argon, upgrade the SDK, delete sampling and explicit caching settings, raise max_output_tokens to at least 32,768, and lengthen your timeouts or use background mode. Then test all three thinking levels and recalculate your budget for the December 1 price change.

Written on October 21, 2026, based on Google's documentation as of that date. Prices and limits can change, so check the pricing page before you commit to a budget. If you also build voice features, see how OpenAI prompt-to-voice creates a custom voice from text.

References

  • Gemini 4 Argon model page — ai.google.dev (checked Oct 21, 2026)
  • What's new in Gemini 4 Argon (Interactions API) — ai.google.dev (checked Oct 21, 2026)
  • What's new in Gemini 4 Argon (generateContent) — ai.google.dev (checked Oct 21, 2026)
  • Gemini API pricing — ai.google.dev (checked Oct 21, 2026)
  • Gemini 4 Argon is now available for developers (Oct 13, 2026) — blog.google (checked Oct 21, 2026)