TellWorldAI World Archive

Home›Practice›Practice

Practice

Getting started with Gemini 4 Neon: quickstart, new features and model choice

How to call Gemini 4 Neon through the Interactions API, pick a thinking level, generate outputs past 64K tokens, and migrate from earlier Gemini models.

If you want to call Google's newest Gemini 4 Neon from your own code, this guide covers the first request, how to choose among its four thinking levels, how to generate outputs longer than 64K tokens, and what to change when you move from an earlier Gemini model.

What Gemini 4 Neon is

Gemini 4 Neon uses the model ID gemini-4-neon. Google places it between Gemini 4 Hydrogen and Gemini 4 Carbon for high-frequency complex work such as software engineering, knowledge work and science. Google describes it as frontier-level intelligence with fast end-to-end task completion [1]. Input, thinking and output tokens share one window of 1,048,576 tokens, so your material, the model's internal reasoning and the final answer all count against the same limit [1].

For model selection, Google's guidance is to use Neon for complex engineering, knowledge work and science; use Carbon for the hardest architecture, debugging, science and security problems; and keep Hydrogen as the default for everyday coding and agentic work [1]. The Choosing a model guide compares models side by side and includes multi-model code examples, and the model card lists token limits, capabilities and full specifications [1].

What you need before you start

Neon is available only on the paid tier of the Gemini API. You can also try it in Google AI Studio with a Google AI Pro or Ultra plan [1]. You can call it through generateContent or through the Interactions API [1]. This guide uses the Interactions API throughout, which also supports previous_interaction_id for multi-turn conversations.

Pricing is $3.00 per million input tokens and $15.00 per million output tokens, flat across the full 1M context window. Thinking tokens are billed as output, and every token the model processes is billed [1]. Implicit caching applies by default to prompts of at least 4,096 tokens and discounts cached input by 95%, to about $0.15 per million tokens [1].

Your first request

The Python quickstart needs only a client and one call. With no other settings, the model runs at the high thinking level with a 64K synchronous output limit [1].

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-neon",
    input="Build an interactive single-file HTML token bucket rate-limiter simulator with live sliders for burst size and request traffic."
)

print(interaction.output_text)

If your app is an interactive chat, latency shapes what the user feels; if you batch large documents, the cost of each request is multiplied many times. The right thinking level often differs between these cases, so choose based on your own workload.

The answer is in interaction.output_text. Without the SDK, send a POST request to https://generativelanguage.googleapis.com/v1beta/interactions and pass your key in the x-goog-api-key header [1].

Choosing a thinking level

thinking_level controls how much the model reasons before it answers, so it is the main lever for quality, latency and token use. Neon accepts four values and defaults to high [1]:

  • low: the fewest tokens and the lowest latency, suited to fast chat and high-throughput processing.
  • medium: lower token use and faster replies, suited to interactive coding, live UI prototyping and latency-sensitive tool calls.
  • high: the default and Google's recommended starting point for most work, including complex coding, agentic execution, tool calling and multimodal knowledge work.
  • xhigh: the deepest reasoning and the most tokens, reserved for hard multi-step engineering, analysis and science problems where high falls short. It adds latency and token use [1].

Google suggests starting with high and reserving xhigh for problems where high is not enough [1]. A practical test is to run your evaluation at all four levels with a high max_output_tokens, then keep the lowest level that meets your quality bar [1]. The following call sets xhigh for a concurrency review [1]:

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-neon",
    input="Audit this payment retry queue for race conditions and rewrite the lock acquisition logic.",
    generation_config={
        "thinking_level": "xhigh"
    }
)

print(interaction.output_text)

Generating outputs longer than 64K

A synchronous response can contain up to 65,536 tokens, whether streaming or not. max_output_tokens covers thinking and output combined, so a low limit can cut off the final answer [1].

For longer output, set background to true and raise max_output_tokens above 65,536, up to 1,048,576 minus your input tokens. The server then continues in 64K-token hops. If you set background without raising max_output_tokens, the server stops at 65,536 tokens [1]. The example below creates the background job, polls until it finishes and joins the text [1]:

import time
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-neon",
    input="Generate a complete multi-module migration specification and test suite for this service.",
    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)

# Join text across all 64K continuation hops.
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)

Migrating from earlier models

Moving from Carbon, Argon or Hydrogen is straightforward: request schemas do not change, and you set model to gemini-4-neon. Check the default thinking level, though. Neon defaults to high, while Carbon and Argon default to medium and cap at high, so set thinking_level explicitly if your code depends on the old default [1].

Migrating from Gemini 3.8 Flash or earlier involves more changes [1]:

  • Change the model ID to gemini-4-neon.
  • Remove hardcoded low max_output_tokens caps, such as 8,192, or raise them to 65,536.
  • Expect high as the default rather than medium. Passing minimal returns an error.
  • Remove cached_content fields. Neon does not support explicit caching (cachedContents and caches.create) [1].
  • Remove temperature, top_p and top_k. In-range values are ignored, and out-of-range values return a 400 error [1].
  • Keep multi-turn and tool-calling state with previous_interaction_id, and declare tools natively. Asking the model in a system prompt to write its own JSON tool calls, with no tools declared, can return MALFORMED_FUNCTION_CALL [1].

Migration is mostly about verification rather than code changes. The thinking level, output limit and sampling parameters have all changed, so answer length, speed and cost can differ from before. Run your own evaluation set against the new model and confirm quality and cost before you switch production traffic.

Limits and common problems

  • Timeouts: hard prompts can take several minutes. Use background execution, or set your HTTP client timeout to at least 15 minutes [1].
  • Billing: every token the model processes is billed, including thinking tokens and internal grounding instructions and function declarations. Google Search grounding is billed per query on top of tokens [1].
  • Security: Google says Neon writes code with fewer security vulnerabilities and improves root-cause patching. Defenders who need dual-use cyberdefense capabilities can apply through the Fairwind Program [1].
  • Agents: in Gemini Managed Agents, the Antigravity agent supports gemini-4-neon, alone or alongside Hydrogen in a multi-model workflow [1].

Where to go next

Before production use, check token limits, rate limits and prices on Google's official pages. To compare Neon with other models, start with the Choosing a model guide [1].

Sources

  1. 1

Cite this page: Getting started with Gemini 4 Neon: quickstart, new features and model choice. TellWorld, https://www.tellworld.net/practice/practice-gemini-4-neon. Updated 2026-11-20

Related news

View all