DIRTY STATIC / DISPATCH Tutorials19 NOV 2026 • 16 MIN READ
A huge industrial dial in a dark concrete control hall, its needle on the third of four positions glowing caution yellow, with hazard stripes on the floor
TutorialsINTELLIGENCE FOR THE MACHINE AGE

Choose Neon Thinking Levels For Coding Work

Gemini 4 Neon arrived on November 18, 2026 with four thinking levels and a default set to high. This tutorial maps low, medium, high and xhigh to coding work, shows how to set the level in Python and in raw REST, explains why thinking tokens bill as output, and gives you a small test you can run on your own tasks to keep the cheapest level that still passes.

Start reading ↓

Most teams will meet Gemini 4 Neon through a single line in a changelog and a new entry in a model list. The part that decides the bill and the wait time sits one layer down. Neon thinks before it answers, it thinks at high by default, and every thinking token bills at the output rate of $15 per million tokens.

That default makes sense for the work Google built Neon to do. Google places Neon between Hydrogen for everyday coding and Carbon for the hardest problems, and it points Neon at work across a whole repo, work with many tool calls, and dense documents that need care. Plenty of coding work is not that work. A short rename, a format fix and a routine test draft do not need the same depth as a tangled debug session. This tutorial gives each level a job, shows the exact setting in code, and ends with a test you can run before you trust any level as a default in your own codebase.

What You Will Build or Learn

You will end with a small Python helper that calls gemini-4-neon at any level you name, the same call in raw REST, and a routing table for coding work that you can paste into your own notes. You will also know the three traps that waste money or break requests on this model: sending minimal, sending the old budget field beside the level, and leaving a low output cap in place while the model spends it all on thought.

The deeper lesson is a habit. A thinking level is not a quality switch you set once and forget. It is a per job choice, like a timeout or a retry count. Code that names the level in one place, logs the cost beside it, and proves the choice on real tasks will age well as Google adds models and changes defaults. Code that inherits a default in silence will drift every time a vendor moves that default, and Neon proves the point on its own. A call copied from Argon or Carbon arrives with no level named and quietly starts at high on Neon, where those older models start at medium.

Four industrial levers in a row rising in height, each with a caution yellow grip, on a hazard striped base in a concrete room Four levels, four pulls. The taller the pull, the more thought the model spends before it writes a line. Illustration: Dirty Static

Before You Begin

Learn what each level means in Google words before you assign any of them to your work. The Google thinking guide describes low as fewer thinking tokens for faster responses on work with low complexity. It describes medium as a balance of reasoning quality and latency for work with moderate complexity. It describes high as deep reasoning for complex prompts, with multi step problem solving, formal code checks and tool use across turns named in the guide. It describes xhigh as the maximum thinking capacity for the hardest math, science, formal checks and long horizon software work. For Neon in its own launch guidance, Google sharpens the coding map: low for fast work at volume, medium for interactive coding, and xhigh only where high falls short, because xhigh uses more tokens and takes longer.

Two rejects belong in your notes before the first call. The level minimal returns an error on Neon and on every Gemini 4 model, per the Google thinking guide. The old thinking_budget field belongs to Gemini 2.5 and earlier models. Sending the level and the budget together returns an error on Gemini 3 and later models. One control at a time, and on Neon that control is the level. A second scope note matters for chat work. Thought signatures are the encrypted record of reasoning state that Google uses across turns. If you use chat sessions or append complete responses to your history, the SDK carries them for you. If you rebuild history by hand, pass the returned parts back whole, at any level, or later turns can lose context.

LevelGoogle guidance in shortCoding work it fits
lowFewest tokens among the four, fastest responses, low complexityQuick edits, boilerplate drafts, rename help, short summaries of a diff
mediumBalances quality and latency, moderate complexityInteractive coding, feature work in one area, test drafts, code explanations
highDeep reasoning, complex prompts, formal checks, tool use across turns. Default on NeonWork across many files, debugging with tests, agent runs with many steps
xhighMaximum capacity, hardest problems, long horizon software workArchitecture faults and stubborn bugs where high has shown a real shortfall

Step 1: Install the SDK and Set Your Key

Action: install the Google Gen AI SDK, create a key in Google AI Studio inside a paid tier project, and store the key in an environment variable. Use a placeholder in every note, log and screenshot you share. Never paste a real key into code that you commit.

macOS or Linux · Terminal

pip install --upgrade google-genai
export GEMINI_API_KEY="your key here"

Expected result: the install completes and the variable is set for this shell session. The SDK client in the steps below reads that variable on its own. The REST step reads the same variable in its header, so no step in this tutorial writes a real key into a request body.

Step 2: Make a Baseline Call With No Level Set

Action: run this call with no thinking setting at all. On Neon, no setting means high. This baseline is the number every later choice gets compared against.

from google import genai

client = genai.Client()

response = client.models.generate_content(
    model="gemini-4-neon",
    contents="Explain in two sentences why a test that passes alone can fail in a full suite run.",
)

print(response.text)
print(response.usage_metadata)

Expected result: the answer prints and the usage block prints with it. Find the thinking token count in that block. Google notes that a model can answer some simple requests with no thought parts at all, even with thinking on, so code that reads the count must handle a missing value without failing. Record the count and the wait time beside the prompt. You will want both when Step 6 builds your routing table.

Step 3: Set Low and Medium for Everyday Coding

Action: add a thinking config and set the level to LOW, then run the same prompt at MEDIUM. The Python form uses the config classes from the SDK, and the level values are the enum members the Google guide lists.

from google import genai
from google.genai import types

client = genai.Client()

response = client.models.generate_content(
    model="gemini-4-neon",
    contents="Draft a short commit message for a fix to a login timeout.",
    config=types.GenerateContentConfig(
        thinking_config=types.ThinkingConfig(
            thinking_level=types.ThinkingLevel.LOW
        )
    ),
)

print(response.text)
print(response.usage_metadata)

Expected result: the answer returns faster than the baseline on work of this size, with a lower thinking token count in the usage block. Change the single enum value to MEDIUM and run a prompt with more weight, such as drafting a test for a named function or explaining a module you name in the prompt. Google positions medium for interactive coding, and that is the right mental model. When you sit in the editor and wait for each answer before you type the next prompt, latency shapes the work as much as depth does. A level that answers well in half the time can be the better tool for that loop, even when high scores a touch higher on a hard set.

Step 4: Use High on Purpose and Reserve Xhigh

Action: wrap the call in a helper that takes the level as an argument, so routing lives in one place in your code. Then call that helper at HIGH for work across many files and at XHIGH only for a job where high has already missed.

from google import genai
from google.genai import types

client = genai.Client()

def ask(prompt, level):
    return client.models.generate_content(
        model="gemini-4-neon",
        contents=prompt,
        config=types.GenerateContentConfig(
            thinking_config=types.ThinkingConfig(thinking_level=level)
        ),
    )

review = ask("Review this module for race conditions and list each one you find with the file and line you base it on.", types.ThinkingLevel.HIGH)
hard = ask("Find why this retry queue loses jobs under load. Show your checks in order and name what would prove each one wrong.", types.ThinkingLevel.XHIGH)
print(review.text)
print(hard.text)

Expected result: both calls return, and the usage blocks show the gap in thinking tokens between the levels on prompts from your own work. high earns its place on debugging that must hold state across files and turns, on agent runs that plan a sequence of tool calls, and on formal checks where a missed edge case costs more than tokens do. xhigh takes longer to start and spends more tokens again. That trade is the point of the level, and it is why the level stays rare. Google reserves it for difficult multi step problems where high falls short, and the Neon launch guidance repeats that limit in almost the same words. If a job has not failed at high in a way you can point to, it has not earned xhigh yet.

One practical note from the migration guidance for this family. Difficult prompts can take several minutes. Set HTTP client timeouts of at least 15 minutes for Neon calls, or use background execution for long jobs, so a deep level does not die as a client timeout that looks like a model failure. Our guide to thinking levels in Gemini 4 Hydrogen covers the same timeout and cap traps in the sibling model, and the rules carry across with only the price and the default story changed.

Step 5: Set the Same Level in Raw REST

Action: for stacks without the Python SDK, send the level inside generationConfig in the request body. In REST the field is thinkingConfig and the level field inside it is thinkingLevel, written as a plain string in lower case.

macOS or Linux · Terminal

curl -s "https://generativelanguage.googleapis.com/v1beta/models/gemini-4-neon:generateContent" -H "Content-Type: application/json" -H "x-goog-api-key: $GEMINI_API_KEY" -d '{"contents": [{"parts": [{"text": "Summarize this release note in one line: The server now retries failed uploads twice."}]}], "generationConfig": {"thinkingConfig": {"thinkingLevel": "medium"}, "maxOutputTokens": 65536}}'

Expected result: a JSON response returns with the answer text and a usage block that carries the thinking token count. Change only the string to move between low, medium, high and xhigh. Note the output cap in the example. The field caps thinking and final output together, so raise it to 65,536 for agent work and lower the thinking level when you need to save tokens, as Google advises for this family. If a request body still carries a thinkingBudget field from Gemini 2.5 era code, remove it before you debug anything else. That leftover is the most common reason a sound Neon request returns as an error. The same warning applies to sampling fields left from older models. Coverage of the Neon migration guide notes that temperature, top_p and top_k are ignored when in range and rejected when out of range on Gemini 4 models, so drop them from new Neon call sites.

Step 6: Prove the Cheapest Level That Still Passes

Action: build a small test set from your own coding work. Pick ten to twenty tasks where you already know what a good result looks like: a bug with a failing test, a refactor with a clear spec, a review where the faults are known, and a set of small edits you do every week. Run each task at low, medium and high. Run xhigh only on the tasks where high missed. Score each result against your known good answer, run any code the model writes through your own tests, and record the thinking token count and the wait time beside each score.

Expected result: a table you can defend to a teammate and to yourself next month. Most small edits and drafts will pass at low or medium. Work across many files will sort itself to high. At most a task or two will justify xhigh, and those tasks will name the routing rule for it. Price the table before you file it. Take one task class at volume, price its thinking tokens at $15 per million output tokens once at the high count and once at the lowest passing count, and multiply the gap by your monthly call count. That figure, in your own numbers, is what this setting is worth. Keep the test set and run it again when Google updates the model, because a level that passed last month is a claim about a model version, not a law.

An inspection station with printed code sheets under a magnifying lens, with caution yellow check marks The test set is the proof. A level earns its place on tasks you can score, not on a launch chart. Illustration: Dirty Static

For a worked example of the careful first run habit in a different surface, our tutorial on how to start Gemini 4 Neon in Copilot safely runs the same model inside an editor with a branch, approvals and a diff review as its fence. The API routing in this tutorial and the editor fence in that one pair well. One controls cost per call, the other controls blast radius per task.

Verification

Run these checks and record what you see. A call with no level set behaves as high and shows a thinking count on any prompt that needs thought. The same prompt at low returns with a lower count and a faster start. The REST call in Step 5 returns the same answer shape as the Python calls. Your test set table from Step 6 names, for each task class you run, the lowest level that passed, and your routing helper uses those levels and no others. Your client timeout allows a deep call to finish, and no call site in your code sends minimal or a budget field beside the level.

Finish with the money check from Step 6 stated in one line: the monthly saving between the high default and your routed levels, on your own task counts. If you cannot state that line, the routing is a guess, however tidy the code looks.

Troubleshooting

ProblemLikely causeFix
The request returns an error naming the thinking levelThe level was set to minimal, which no Gemini 4 model supportsUse low as the floor on Neon and remove any minimal value left from Gemini 3 era code
The request fails after a move from Gemini 2.5 codeThe body still carries thinkingBudget or thinking_budget, alone or beside the levelRemove the budget field and set the level alone, as in Steps 3 and 5
The response is empty or stops early with a token limit reasonThinking spent the whole output cap before answer text was producedRaise maxOutputTokens for that call, up to 65,536, or drop the level for that prompt
Costs jump after a move from Argon or Carbon with no code change in the promptNeon defaults to high where Argon and Carbon default to medium, so the same call thinks deeperSet the level in code on every Neon call site before you compare price or quality
xhigh feels slow and the bill climbs with no better answersThe level sits on prompts that do not need it and the model spends tokens for no gainReturn those call sites to high or lower and reserve xhigh for jobs where high failed in your test set
No thinking count appears on a simple promptThe model answered a low complexity request with no thought parts, which Google says can happenTreat a missing count as zero for logging and never fail a request because the thought fields are empty
A long chat loses context when the level changesHistory rebuilt by hand dropped the thought signatures that carry reasoning state across turnsUse a chat session, or append complete response objects to history, so the SDK passes the signatures back for you
A deep call dies as a timeoutThe client timeout is shorter than a difficult Neon prompt needsRaise the HTTP client timeout to at least 15 minutes or use background execution for long jobs

Next Steps

Keep the routing table beside your model config and review it after your first week of real Neon work. Two numbers will tell you if the table is right: how often a result needed a correction at its assigned level, and what each finished task class cost. Adjust one level at a time and run the test set again after each change, so you know which change moved which number.

When a task class outgrows Neon itself, the family gives you a clear next move in each direction. Hydrogen stays the cheaper default for everyday coding at $1.50 per million input tokens and $7.50 per million output tokens. Carbon stays the step up for architecture, deep debugging and security work where depth matters more than speed. Neon earns its middle place only on the tasks where your table shows Hydrogen falling short and Carbon costing more time than the job can spare. That is a narrower claim than any launch post makes, and it is the only one your own tests can prove.

Facts checked against Google Cloud thinking documentation, the Gemini API release notes and pricing coverage, and the Neon migration guidance on November 19, 2026. Prices and defaults are Google published values and can change. This procedure was verified against those documents and is not presented as a personal test run with a live key.

Sources

  • Google Cloud, Thinking documentation for the Gemini Enterprise Agent Platform, including the table of supported levels and defaults that lists Gemini 4 Neon as low, medium, high, xhigh with high as the default, checked November 19, 2026: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/thinking
  • Google, Gemini API release notes, pricing and Gemini 4 Neon model page, via launch coverage checked November 19, 2026. Neon listed as generally available on November 18, 2026, paid tier only, at $3 per million input tokens and $15 per million output tokens, with a shared window of 1,048,576 tokens
  • Google, Introducing Gemini 4 Neon, November 18, 2026, launch post claims and level guidance via coverage checked November 19, 2026, including the suggestion to reserve xhigh for hard multi step problems where high falls short
  • Neon migration guidance via coverage checked November 19, 2026, including the notes on explicit level setting when moving from Argon or Carbon, output caps, timeouts of at least 15 minutes, and sampling fields on Gemini 4 models
  • Hero, dial and evaluation images: Dirty Static illustrations
■

END OF TRANSMISSION

Stay curious. Question everything.

CONTINUE THE DESCENT

MORE FROM DIRTY STATIC ↘