Migrating to Gemini 4 Neon: 9 API Changes That Break Code or Raise Your Bill

Cover image for Migrating to Gemini 4 Neon: 9 API Changes That Break Code or Raise Your Bill: Google (official image)

Key facts

Sources checked Nov 19, 2026

  • Switching to gemini-4-neon from another Gemini 4 model needs no request schema changes: change the model ID and check your thinking level. Neon is paid tier only.
  • Coming from Gemini 3.x, there are breaking changes. temperature, top_p and top_k are ignored (out-of-range values return a 400 error), minimal thinking is rejected, and explicit caching isn’t supported.
  • max_output_tokens caps thinking plus answer together. Default and maximum per request is 65,536. Old low caps such as 8,192 can cut answers off.
  • For outputs longer than 64K, set background: true and a higher max_output_tokens. Raise client timeouts to at least 15 minutes.
  • Implicit caching kicks in on prompts of 4,096+ tokens and cuts cached input to $0.15 per million (a 95% discount).

Gemini 4 Neon launched on November 18, 2026, and Google’s migration checklist has a few traps that will break older code or quietly inflate your bill. Here are the nine changes worth making, with code, for developers moving apps over from Gemini 3.x or from another Gemini 4 model.

1. Change the model ID, and nothing else at first

If you already run Carbon, Argon or Hydrogen, Neon uses the same Gemini 4 request format. Google’s docs say no schema changes are needed. Start with a one-line swap and your existing eval set:

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-neon",
    input="Summarize the risks in this pull request description: ...",
)
print(interaction.output_text)

Neon isn’t on the free tier. If you get access errors, check that the API key belongs to a project with billing enabled.

Screenshot of Google: Introducing Gemini 4 Neon
Screenshot: Google: Introducing Gemini 4 Neon (official page, captured December 1, 2026).

2. Pick the thinking level on purpose

Neon defaults to high and also offers low, medium and xhigh. That’s a change if you’re coming from Carbon or Argon, which default to medium and stop at high. Leave the level unset and you’ll quietly move up a notch, with more thinking tokens billed at $15 per million.

Google’s advice is to run your evals at all four levels and keep the lowest level that meets your quality bar:

interaction = client.interactions.create(
    model="gemini-4-neon",
    input="Refactor this module to remove the global state: ...",
    generation_config={"thinking_level": "medium"},
)

Rough guide from the docs:

Level Use it for
low High-throughput processing, fast chat
medium Interactive coding, UI prototyping, quick tool calls
high Default: complex coding, agents, multimodal work
xhigh Only hard multi-step problems where high falls short

minimal is gone. Sending it returns an error, so search your codebase for it.

The cost is real. Artificial Analysis measured Neon at xhigh as “very verbose”, using 283M output tokens to run its index against a median of 65.1M (source). For more on this trade-off, see Reasoning effort and thinking levels explained.

3. Delete temperature, top_p and top_k

This one surprises people. On Neon, the server ignores in-range sampling values, and out-of-range values return a 400 validation error. Remove them from your request builders rather than relying on them. If you were using temperature: 0 for repeatable output, get consistency from structured output schemas instead (tip 5).

4. Fix your max_output_tokens cap

max_output_tokens limits thinking and answer tokens combined. A cap that was fine for an older model can now be used up by thinking before the answer even starts. Google’s guidance:

  • Standard tasks: leave the default of 65,536, or omit the field.
  • Hardcoded low caps (such as 8,192): remove them or raise them to 65,536. To spend less, lower the thinking level instead.
  • Long reports or code generation: use background execution (tip 6).

Coming from Gemini 3.8 Flash, note that Neon uses one unified 1,048,576-token window for input, thinking and output, instead of separate input and output budgets.

5. Declare tools and JSON schemas natively

If your app asks the model in a system prompt to “reply with a JSON tool call” without declaring any tools, Neon can return MALFORMED_FUNCTION_CALL. The fix is to:

  • declare functions through native function calling, and
  • constrain JSON answers with structured outputs (a response schema), not prompt instructions.

This is good practice on any model. On Neon, it’s required.

6. Use background execution for long outputs

A single synchronous request returns at most 65,536 tokens. For longer output, such as a full migration spec or a large test suite, set background to true and raise max_output_tokens. The server then keeps generating in 64K “hops”:

import time
from google import genai

client = genai.Client()
job = client.interactions.create(
    model="gemini-4-neon",
    input="Write the complete test suite for this service: ...",
    background=True,
    generation_config={"max_output_tokens": 262144, "thinking_level": "high"},
)
while job.status in ("in_progress", "queued"):
    time.sleep(5)
    job = client.interactions.get(id=job.id)
print(job.status, job.usage)

Gotcha: if you set background=True without raising max_output_tokens, generation still stops at 65,536 tokens. Google’s docs show how to join the text from every hop.

7. Raise client timeouts

Google warns that hard prompts “can take several minutes”. Either use background execution or set HTTP timeouts to at least 15 minutes. Default timeouts of 60 to 120 seconds in proxies, serverless functions and load balancers are a common source of mystery failures here. Artificial Analysis measured an average time to first answer token of about 56 seconds at xhigh, so short timeouts will fail even on normal requests.

8. Remove explicit caching and let implicit caching work

Neon does not support explicit caching (cachedContents, caches.create). Remove any cached_content fields. Implicit caching is automatic on prompts of 4,096 tokens or more, and a hit bills that input at $0.15 per million instead of $3.

To get more cache hits, put the stable parts first (system instructions, tool declarations, long reference documents) and the changing user message last. Our prompt caching explainer covers why prefix order matters.

9. Keep conversation state intact

For multi-turn chats and tool calls:

  • In the Interactions API, pass previous_interaction_id instead of rebuilding the history yourself.
  • With generateContent, send back earlier model turns, including their thought signatures, exactly as you received them. Don’t copy one thought signature across parallel functionCall parts.

Stripping or editing these fields is a common reason tool-using agents lose track mid-task after a migration.

A quick migration checklist

  1. Change model to gemini-4-neon and confirm the project is on the paid tier.
  2. Set thinking_level explicitly. Test medium and high.
  3. Remove temperature, top_p, top_k and any minimal thinking level.
  4. Raise or remove low max_output_tokens caps.
  5. Declare tools natively and use response schemas for JSON.
  6. Switch long jobs to background=True with a higher cap.
  7. Set timeouts to 15 minutes or more.
  8. Remove explicit cache calls and order prompts for implicit caching.
  9. Pass previous_interaction_id or keep thought signatures unchanged.

Not sure Neon is the right model? Our Gemini 4 Neon vs Carbon vs Hydrogen vs Argon comparison covers prices and independent scores.

Bottom line

Moving to Neon is a one-line change between Gemini 4 models, but coming from Gemini 3.x you’ll hit removed sampling parameters, a combined thinking-and-output cap, and no explicit caching. Set the thinking level yourself, give long jobs background execution and generous timeouts, and structure prompts so implicit caching does the cost-cutting for you.

Sources (checked November 19, 2026): What’s new in Gemini 4 Neon, including the migration checklist, Gemini API pricing, Google launch post, Artificial Analysis: Gemini 4 Neon.

Cover image: Google (official image)