How to Use Gemini 4 Argon in the Gemini API: Setup, Thinking Levels and Long Outputs Google made Gemini 4 Argon generally available to developers on October 13, 2026, offering a unified 1,048,576-token window shared across input, thinking and output, tunable thinking levels (low, medium, high), and single responses far longer than the previous 64K-token ceiling. The model is aimed at long multi-step work such as code migrations, agentic workflows and hard math and science problems, and is available only on the paid Gemini API tier or via a Google AI Ultra subscription. Introductory pricing runs at $2 per million input tokens and $10 per million output tokens through November 30, 2026, doubling to $4 and $20 from December 1. Google made Gemini https://mangodeveloper.com/articles/how-to-turn-on-personal-intelligence-for-gemini-in-android-auto 4 Argon generally available to developers on October 13, 2026. It is the company's most capable model in the Gemini API, aimed at long, multi-step work such as code migrations, agentic workflows, and hard math and science problems. Argon reasons for longer than earlier Gemini models, shares a single 1,048,576-token window across input, thinking and output, and can now write a single response far longer than the old 64K-token ceiling. This guide is for developers who want to call Argon from their own code. It walks through access requirements, the first request in Python, JavaScript and REST, how to choose a thinking level, how to generate very long outputs with background execution, and the changes you need to make if you are moving an existing app over from an older Gemini model. The model ID is gemini-4-argon. Its headline changes are a unified 1M-token limit for input and output together, long decode that lets one response run up to 1M tokens minus your input, tunable thinking levels low, medium and high, with medium as the default , and support inside the Antigravity agent in Gemini Managed Agents. Agentic video understanding is also generally available alongside it. Argon is not available on the free tier of the Gemini API, and it is not included in the Google AI Pro plan. You need one of two things: a Gemini API project on the paid tier, or a Google AI Ultra subscription for trying it in Google AI Studio and in Google Antigravity. Through November 30, 2026, Google is charging an introductory price of $2 per million input tokens and $10 per million output tokens, with thinking tokens billed as output. From December 1, 2026 the price rises to $4 and $20. Implicit caching discounts cached input by 95 percent, to $0.10 per million tokens during the introductory period and $0.20 afterward. Because Argon can spend a lot of tokens on thinking, budget for output costs carefully on hard prompts. You will also need Python with pip or Node.js with npm if you plan to use an SDK, or curl and jq for the REST examples. Open the API keys page in Google AI Studio. New users get a project and key created automatically; otherwise select Create API key. Select Set up billing on the API keys or Projects page and follow the Cloud Billing dialog. Google requires you to link a billing account, add a payment method and prepay a minimum of $5 or the local currency equivalent in credits. Store the key in an environment variable so the SDKs can find it without hard-coding it: BashCopy export GEMINI API KEY="YOUR API KEY" BashCopy shell pip install -U google-genai plaintext BashCopy shell npm install @google/genai markdown PythonCopy python from google import genai client = genai.Client interaction = client.interactions.create model="gemini-4-argon", input="Review this function for race conditions and suggest a safer locking strategy." print interaction.output text BashCopy shell curl " https://generativelanguage.googleapis.com/v1beta/interactions https://generativelanguage.googleapis.com/v1beta/interactions " \ -H "x-goog-api-key: $GEMINI API KEY" \ -H 'Content-Type: application/json' \ -X POST \ -d '{ "model": "gemini-4-argon", "input": "Explain the trade-offs between optimistic and pessimistic locking." }' The thinking level is your main control over quality, latency and cost. Low uses the fewest tokens and suits simpler or cost-sensitive work, though quality can drop on hard tasks. Medium is the default and is recommended for most jobs, including complex code and agents. High uses the most tokens and has the slowest first token, and is meant for the hardest reasoning, math, science and coding tasks. PythonCopy python interaction = client.interactions.create model="gemini-4-argon", input="Plan a step-by-step migration of this service from callbacks to async/await.", generation config={"thinking level": "medium"} By default a response is capped at 65,536 tokens. To go further, set background to true and max output tokens above 65,536. The server then generates the answer in hops of up to 64K tokens, continuing each hop where the last one stopped, and adds a model output step for every hop. PythonCopy python import time from google import genai interaction = client.interactions.create model="gemini-4-argon", input="Write full API documentation for the attached module.", 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 step in interaction.steps if step.type == "model output" for c in step.content if c.type == "text" print text If you set background to true but leave out max output tokens, the server still stops at 64K tokens, so always set both. Change the model string to gemini-4-argon. Review max output tokens. If your app sets a limit below 32K, raise it to at least 32,768, because Argon can spend more of the budget on thinking. To save tokens, lower the thinking level instead of the limit. Remove temperature, top p and top k. Argon ignores them. Remove explicit context caching. Calls that create or reference cachedContents are not supported on Argon. Implicit caching is on by default for prompts of at least 4,096 tokens. Raise HTTP client timeouts to at least 15 minutes, or use background execution, because hard prompts can take several minutes. Keep multi-turn and function-calling state on the server by passing previous interaction id rather than resending history yourself. Android developers can reach Argon in Android Studio https://mangodeveloper.com/articles/how-to-connect-claude-codex-or-antigravity-to-android-studio-rabbit-2-with-bring-your-own-agent through a paid-tier Gemini API key, or, with a Google AI Ultra subscription, by signing in to Antigravity in the latest Android Studio Canary. To connect an agent to local Android build tools from the terminal, install the official plugin for Antigravity, or initialize the Android CLI https://mangodeveloper.com/articles/how-to-trace-jetpack-compose-1-13-recompositions-automate-builds-android-cli-1-1 for any terminal agent: BashCopy shell agy plugin install android-cli-plugin BashCopy plaintext android init Requests to gemini-4-argon fail while other models work: check which tier your key belongs to. Argon is not offered on the free tier or through Google AI Pro, so the project needs billing set up. Answers end abruptly: the response probably hit max output tokens, which counts thinking and output together. Raise the limit, or lower the thinking level so less of the budget goes to reasoning. Output stops near 64K tokens: long decode needs both background set to true and max output tokens above 65,536. Requests time out: increase your client timeout to at least 15 minutes or switch to background execution and poll. Code that used caches.create breaks: explicit caching is not supported on Argon. Remove it and rely on implicit caching instead. Temperature changes have no effect: this is expected. Sampling parameters are ignored on Argon; use thinking level to steer behavior. No. It is not available on the Gemini API free tier or the Google AI Pro plan. You need the paid tier of the Gemini API, or a Google AI Ultra subscription to try it in AI Studio and Antigravity. Input, thinking and output share one window of 1,048,576 tokens. A single response can use up to 1M tokens minus your input when you enable background execution. Start with the default, medium. Then test low and high on your own prompts and keep the lowest level that still meets your quality bar. They will not cause errors, but Argon ignores temperature, top p and top k. Remove them to keep your requests clean. Originally published on Mango Developer https://mangodeveloper.com/articles/how-to-use-gemini-4-argon-in-the-gemini-api-setup-thinking-levels-and-long-outpu .