Google released Gemini 4 Neon on 18 November 2026. It sits between Gemini 4 Hydrogen (fast, everyday work) and Gemini 4 Carbon (the hardest, long-horizon problems), and Google pitches it as the model for complex coding, knowledge work and science tasks where you want strong reasoning without Carbon’s latency and cost.

This guide shows how to call Neon from Python with the official google-genai SDK, how to pick a thinking level, how to generate very long outputs, and what to change if you are migrating from another Gemini model. Everything below is based on Google’s What’s new in Gemini 4 Neon developer guide and the launch post.

Gemini 4 Neon at a glance

Item Value
Model ID gemini-4-neon
Thinking levels low, medium, high (default), xhigh
Context window 1,048,576 tokens, shared by input, thinking and output
Synchronous output cap 65,536 tokens per request
Price (paid tier) $3.00 per 1M input tokens, $15.00 per 1M output tokens (thinking tokens count as output)
Cached input Implicit caching, 95% discount ($0.15 per 1M tokens)
Availability Paid tier of the Gemini API only, via generateContent and the Interactions API

Two points matter straight away. First, there is no free tier for Neon, so your API key must belong to a billing-enabled project. Second, Neon shares one large token window across input, reasoning and output, so the way you set max_output_tokens matters more than it did with older models.

Step 1: Install the SDK and set your key

pip install -U google-genai
export GEMINI_API_KEY="your-paid-tier-key"

The client reads GEMINI_API_KEY from the environment, so you do not have to pass it in code.

Step 2: Your first request

The quickest way to try Neon is the Interactions API. This is the minimal example from Google’s guide:

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-neon",
    input="Explain the difference between optimistic and pessimistic locking, with a short Python example of each.",
)

print(interaction.output_text)

By default Neon runs at the high thinking level with a 64K synchronous output limit. For many apps you can stop here and simply swap your model string.

Step 3: Choose the right thinking level

The thinking level is your main dial for quality, speed and spend. Google’s guidance boils down to this:

  • low – fewest tokens and lowest latency. Good for fast chat and high-throughput processing.
  • medium – interactive coding, live UI prototyping and latency-sensitive tool calls.
  • high (default) – the recommended setting for most complex coding, agent and multimodal tasks.
  • xhigh – deepest reasoning, most tokens. Keep it for hard multi-step engineering, analysis or science problems where high falls short.

Set it with generation_config:

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-neon",
    input="Audit this retry queue for race conditions and propose a safer lock strategy:\n\n" + open("queue.py").read(),
    generation_config={
        "thinking_level": "xhigh",
    },
)

print(interaction.output_text)

A practical way to pick a level is to run your own evaluation prompts at all four levels, with a generous max_output_tokens so answers are not cut off, then choose the lowest level that meets your quality bar. That keeps both latency and cost down.

A small helper for routing work

If your app handles different kinds of requests, you can route them to different levels:

from google import genai

client = genai.Client()

LEVELS = {
    "chat": "low",
    "ui": "medium",
    "code": "high",
    "deep": "xhigh",
}

def ask_neon(prompt: str, kind: str = "code") -> str:
    interaction = client.interactions.create(
        model="gemini-4-neon",
        input=prompt,
        generation_config={"thinking_level": LEVELS.get(kind, "high")},
    )
    return interaction.output_text

print(ask_neon("Summarise this changelog in three bullets: ...", kind="chat"))

Step 4: Generate outputs longer than 64K tokens

A single synchronous response is capped at 65,536 tokens. For longer work, such as a full migration spec or a large test suite, Google recommends background execution. Set background=True and raise max_output_tokens above 65,536; the server then continues in 64K-token hops.

import time
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-neon",
    input="Write a complete migration plan and pytest suite for moving this service from Flask to FastAPI.",
    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(
    content.text
    for step in interaction.steps
    if step.type == "model_output"
    for content in step.content
    if content.type == "text"
)

print(text[:2000])
print("Status:", interaction.status)
print("Usage:", interaction.usage)

One gotcha from the docs: if you set background=True but don’t set max_output_tokens, the server still stops at 65,536 tokens.

Step 5: Set sensible output limits

max_output_tokens caps thinking tokens plus answer tokens together. Google suggests:

  • Standard tasks: keep the 65,536 default or leave the field out.
  • Old apps with low caps (for example 8,192): remove the cap or raise it to 65,536. If you want to spend less, lower the thinking level instead of starving the answer.
  • Long, multi-step jobs: use background mode with 131,072 or 262,144 tokens.

Also raise your HTTP client timeout. Google notes that hard prompts can take several minutes and recommends background execution or timeouts of at least 15 minutes.

Migrating to Neon

From Gemini 4 Carbon, Argon or Hydrogen

No request schema changes are needed. Change the model ID to gemini-4-neon and check your thinking level: Neon defaults to high and supports xhigh (like Hydrogen), while Carbon and Argon default to medium and stop at high. Make sure the project is on the paid tier.

From Gemini 3.x and earlier

This is a bigger move. Google’s checklist includes:

  1. Drop sampling parameters. Remove temperature, top_p and top_k. In-range values are ignored; out-of-range values return a 400 error.
  2. Stop using explicit context caching. Neon does not support cachedContents or caches.create. Implicit caching runs automatically for prompts of at least 4,096 tokens.
  3. Replace minimal thinking. Neon rejects minimal with an error; test medium and high instead.
  4. Declare tools natively. Don’t ask the model to print home-made JSON tool calls with no declared tools, as that can return MALFORMED_FUNCTION_CALL. Use function calling or structured outputs.
  5. Preserve conversation state. Use previous_interaction_id for multi-turn and tool-calling sessions, or return thought signatures unchanged if you manage history yourself with generateContent.
  6. Re-check token estimates. Every processed token is billed, including thinking tokens.

What about the benchmarks?

Google’s launch post lists many leaderboard results and cost-per-task comparisons. They are Google’s own reported numbers, so treat them as a reason to test Neon on your workload rather than as a guarantee. A quick A/B run of your existing prompts against Hydrogen and Neon at high will tell you more than any leaderboard.

Key takeaways

  • Use model ID gemini-4-neon on a paid-tier project; there is no free tier.
  • Start at the default high thinking level and only reach for xhigh when needed.
  • Remember that max_output_tokens covers thinking plus answer tokens, and use background=True for outputs beyond 64K.
  • When coming from Gemini 3.x, remove sampling parameters and explicit caching, and declare tools natively.

For the full specification, see Google’s Gemini 4 Neon developer guide.