Gemini 4 Neon migration: default high thinking, 400 errors and the 65K cap

· AIHubMix · 14 min read · Tutorial

Google names Gemini 4 Neon as the upgrade target for Gemini 3.1 Pro, for general coding work on Gemini 4 Argon, and for complex coding or science work on Gemini 3.8 Flash. Changing the model string to gemini-4-neon is the easy part. The rest falls into four groups.

  • Silent: the default thinking level is now high. Argon and 3.8 Flash defaulted to medium. Unless you set a level, each request thinks more than it would at medium. For 3.8 Flash users that means higher bills; for Argon users the per-task cost still falls (see below).
  • Loud: Neon returns HTTP 400 for several fields older code still sends: thinking_budget, the native MINIMAL level, the two penalty parameters, more than one candidate, and broken thought signatures in tool calls.
  • Quiet: temperature, top_p and top_k are ignored, and a low output cap can stop the model while it's still thinking. Explicit context caching and prefilled assistant turns aren't supported, and Google doesn't say how those fail.
  • On AIHubMix: plan for 65,536 output tokens per request. Google's 1M-token long decode isn't available through AIHubMix's OpenAI-compatible endpoint, and its native path wasn't tested for this post.

Coming from Gemini 4 Carbon is simpler: Google says the request schema doesn't change, and the main difference is the default level. The Neon vs Carbon post covers that move.

What differs depending on where you start

Change From 3.1 Pro From Argon From 3.8 Flash
Default thinking level now high medium to high medium to high
xhigh level new new new
Token limits unified 1M already unified unified 1M
Explicit caching removed already gone removed
Price, input / output $2 / $12 to $3 / $15 $2 / $10 to $3 / $15 $0.75 / $3.75 to $3 / $15

Google's official prices, USD per million tokens. Gemini 3.1 Pro's $2/$12 applies to prompts up to 200K tokens ($4/$18 above that); Neon has one rate across the 1M window. Argon's $2/$10 is an introductory price that becomes $4/$20 on December 1, 2026; 3.8 Flash's $0.75/$3.75 runs to December 31, 2026. Google says 3.1 Pro and Argon both cap at high; it doesn't list 3.1 Pro's default.

The rules in the rest of this post come from Google's Neon developer guide on Google Cloud and the migration checklist in AI Studio, unless marked otherwise.

About the starting points: Google's AI Studio upgrade table sends 3.8 Flash users to Gemini 4 Hydrogen. It's the Google Cloud guide that points complex coding and science work on 3.8 Flash at Neon. Google has announced no shutdown date for 3.1 Pro Preview, 3.8 Flash or any Gemini 4 model.

The silent change: high is the new default

Google is direct about it: "The default thinking_level is HIGH (changed from MEDIUM on gemini-4-argon and gemini-3.8-flash), and XHIGH is supported for deep reasoning tasks …" Its fix is just as direct: "If your workload relied on MEDIUM as the default on gemini-4-argon or gemini-3.8-flash, explicitly set thinking_level="MEDIUM" to keep equivalent reasoning latency."

What the extra level costs, from Artificial Analysis's measurements of Google's API (re-checked 2026-11-19, 13:27 UTC; third-party, and they change as AA re-runs models):

Neon setting AA Index $/task Min/task First answer (s)
Medium 54.9 1.90 8.3 20.1
High (default) 59.6 3.74 14.8 40.6
Xhigh 61.4 6.44 21.5 56.5

AA's averages per Intelligence Index task, at Neon's $3/$15. "First answer" is the time to the first answer token.

Moving from medium to high buys 4.8 points on the index for almost twice the cost per task, 1.8 times the time per task and twice the wait for the first answer token. Moving on to xhigh adds 1.8 points for another 72% in cost. That's a good trade for hard multi-step work and a bad one for a chat reply.

For an Argon user there is good news in the same data. Neon Medium scores 54.9 against 47.6 for Argon's default Medium, at $1.90 per task against $4.31, in 8.3 minutes against 28.9. Moving from Argon to Neon Medium raises quality and lowers cost per task, even before Argon's price doubles. Even Neon's default High ($3.74, 14.8 minutes) costs less per task than Argon Medium on AA's tasks. What you give up by not setting a level is the cheaper Medium option.

The higher default also has these effects:

  • Thinking counts against your output cap. Google: "Reasoning tokens generated at HIGH (default) and XHIGH count toward max_output_tokens and accumulate in multi-turn context when you preserve thought signatures across turns."
  • Context fills faster. In multi-turn coding agents, those thinking tokens build up. Google warns against "overly low context-compaction thresholds" and suggests medium on latency-sensitive tool turns.

How to set the level depends on the protocol:

Protocol Field Values for Neon
Native Gemini thinkingConfig.thinkingLevel LOW to XHIGH
Chat Completions reasoning_effort low to xhigh
Responses reasoning.effort low to xhigh
Anthropic Messages output_config.effort low to xhigh

The native values are uppercase in GenerateContent. The other three protocols' values come from AIHubMix's parameter schema for gemini-4-neon, which lists high as the default on every protocol.

Google's OpenAI compatibility layer maps reasoning_effort onto the thinking level, with minimal folded into low. It also says the two "overlap functionality, so they can't be used at the same time": send one or the other.

The 400 errors

Each of these is documented by Google for Neon. AIHubMix's own error notes say that 400s are parameter errors and "most are passed through from the upstream provider". No live test was run for this post, so the exact text you get through the gateway may differ.

thinking_budget and MINIMAL

What you'll see: HTTP 400 on requests that worked on Gemini 3 models.

Why: Neon only accepts the four named levels. Google's model page: "Setting thinking_budget or thinking_level="MINIMAL" returns an HTTP 400 validation error." Its own code diff flags the old field: thinking_budget=16384, # Returns HTTP 400 instead of mapping silently.

Fix: delete thinking_budget. Replace MINIMAL with LOW. On the OpenAI-compatible path, Google maps reasoning_effort="minimal" to low, but sending low yourself removes the question.

frequency_penalty, presence_penalty and extra candidates

What you'll see: HTTP 400 from a request that sets a penalty or asks for several candidates.

Why: "Passing frequency_penalty, presence_penalty, or candidate_count greater than 1 (candidateCount is fixed at 1) returns an HTTP 400 error."

Fix: remove both penalties. Leave candidate_count at 1 or omit it. On Chat Completions, don't send n above 1 either: Google doesn't state what the compatibility layer does with it, and AIHubMix's schema marks it as a field not to send.

max_output_tokens above 1,048,576

What you'll see: HTTP 400.

Why: input and output share one 1,048,576-token window, so a larger output budget is invalid.

Fix: on AIHubMix, send at most 65,536 (see the output cap section). The ceiling matters only for long decode on Google's own API.

Missing or misplaced thought signatures

What you'll see: HTTP 400 on the second or later step of a tool-calling turn.

Why: Neon validates the thought signature attached to function calls in the current turn. "Omitting thought_signature from the first functionCall part in the active turn returns an HTTP 400 error. Duplicating the signature onto sibling functionCall parts or interleaving turns also returns an HTTP 400 error."

Google's thought-signatures guide shows the message form for Gemini 3 models: "Function call <Function Call> in the <index of contents array> content block is missing a thought_signature." Neon's guide states the 400 but not its wording.

Fix: send the model's turns back exactly as you received them. With parallel calls, only the first call carries a signature. Keep all the calls in one model turn and all the results in one user turn, in the same order. Google's own example: when the model returns "FC1 + signature, FC2", the expected next request contains "FC1 + signature, FC2, FR1, FR2". Interleaving them as "FC1 + signature, FR1, FC2, FR2" returns a 400.

Out-of-range sampling values

What you'll see: HTTP 400 for a temperature or top_p outside its valid range.

Why: Google ignores in-range values, but still validates them: "Out-of-range values return a 400 validation error."

Fix: remove the sampling parameters altogether (see the next section).

The request shapes

A correct request through AIHubMix, using the quick start setup:

curl -s https://aihubmix.com/v1/chat/completions \
  -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-4-neon",
    "reasoning_effort": "medium",
    "max_completion_tokens": 65536,
    "messages": [{"role": "user", "content": "Reply with OK."}]
  }'

A request that Google documents as a 400 for Neon:

curl -s https://aihubmix.com/v1/chat/completions \
  -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-4-neon",
    "frequency_penalty": 0.5,
    "messages": [{"role": "user", "content": "Reply with OK."}]
  }'

The same check on the native Gemini endpoint, with the old thinkingBudget field. The path follows the pattern AIHubMix documents for other Gemini models; Neon's own listing shows only the Chat Completions example.

curl -s "https://aihubmix.com/gemini/v1beta/models/gemini-4-neon:generateContent" \
  -H "x-goog-api-key: $AIHUBMIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"role": "user", "parts": [{"text": "Reply with OK."}]}],
    "generationConfig": {"thinkingConfig": {"thinkingBudget": 16384}}
  }'

These are request shapes, not recorded responses: none of them was run for this post.

Other changes to plan for

Sampling parameters do nothing

Google fixes Neon's sampling at temperature 1.0, topP 0.95 and topK 64, and ignores custom values. A temperature: 0 meant to make output repeatable has no effect, and there's no error to tell you so. Google's advice: "Control reasoning depth with thinking_level, and output format with response_schema." Use structured output where you need a fixed format.

Explicit caching is gone

cachedContents, caches.create and cached_content aren't supported. Google doesn't say whether a request that still sends them fails or is ignored, so remove them rather than finding out. Caching on Neon is implicit only. It applies automatically to a shared prompt prefix of at least 4,096 tokens (3.8 Flash needed 6,144), and cached input costs $0.15 per million tokens instead of $3.00. To get it, put the static part of the prompt first: system instructions, tool definitions, reference documents. Delete the explicit-cache code; it has no Neon equivalent.

Low output caps cut the thinking

An app tuned for an older model often sends max_tokens of 8,192 or less. On Neon, thinking and the answer share that budget, so a low cap can end the response before the answer starts. Google's guidance is to "remove hardcoded low caps (such as 8,192) or raise max_output_tokens to 65,536. To use fewer tokens, lower the thinking level instead."

Short timeouts

Google: "Hard prompts can take several minutes. Use background execution, or set HTTP client timeouts to at least 15 minutes." On AA's averages, Neon High waits 40.6 seconds for its first answer token, and Xhigh 56.5. Some requests will take far longer than the average.

Prefilled assistant turns

Neon's history rules: "History payloads can't end with a model role turn." "Prefilled model turns aren't supported." Code that seeds the assistant's reply to steer the format, a common trick with Anthropic's API, has to stop doing that. Google lists these under chat validation without stating the response, and AIHubMix's schema notes that a final model turn returns an error. Test it if your code relies on prefill.

Tool calls written as text

If the system prompt asks the model to write JSON tool calls as plain text, with no tools declared, Google says Neon "can return MALFORMED_FUNCTION_CALL". Declare tools natively, or use structured output.

The output cap on AIHubMix: 65,536 tokens

On Google's own API, Neon's single response is capped at 65,536 output tokens, streaming or not. Longer answers use long decode: generation continues in 64K segments up to 1,048,576 tokens minus the input, through the Interactions API or GenerateContent v1beta1. Google's SDKs can handle the continuation tokens automatically from these versions: Python google-genai 2.34.0 and JavaScript @google/genai 2.32.0 for the Interactions API.

Google also says that "earlier SDK versions and the OpenAI compatibility layer can't retrieve long completions using continuation tokens."

AIHubMix's parameter schema for gemini-4-neon caps output at 65,536 tokens on every protocol it serves: Chat Completions, Responses, Anthropic Messages and native Gemini. The schema also lists Google's continuationToken field on the native Gemini protocol, and AIHubMix documents Google's native SDK and the Interactions API in general. Long decode for Neon through that path wasn't tested for this post. Until you've confirmed it works, design for one response of at most 65,536 tokens including thinking. If you need more, split the task yourself, for example one file or one section per request.

Billing rules that are easy to miss

Thinking is output. Neon's $15 per million output tokens includes thinking tokens. At high, most of a hard request's output can be thinking.

Grounding bills twice. Google counts "internal tool system instructions and function declarations when using grounding" as billable tokens, and charges each search query separately. Google's own quota is 5,000 free searches a month, shared across Gemini 3 and newer, then $14 per 1,000. AIHubMix bills web search per request; its Neon model page lists the rate.

Caching needs the right prompt order. The 95% cache discount only applies to a stable prefix of at least 4,096 tokens. A timestamp or user name at the top of the system prompt breaks it on every request.

Long decode re-bills input (Google's API only). "Each continuation segment re-prefills the prompt plus previously decoded tokens," so input counts grow from segment to segment. "Completed segments are billed at the end of each segment even if a later segment fails or is canceled." Through AIHubMix's 65,536-token cap this doesn't arise.

Cheaper tiers are Google's prices. Google sells Neon Batch and Flex at $1.50/$7.50 and Priority at $5.40/$27. AIHubMix's schema accepts a service_tier of flex or priority for Neon but publishes no price for those tiers, and Batch isn't listed. Budget at the standard $3/$15.

Steps that lower the bill:

  • Set reasoning_effort per call type: medium for interactive and tool turns, high for planning, xhigh only where your own evaluations show it pays.
  • Keep the static prompt prefix first and longer than 4,096 tokens.
  • Use web search only on turns that need it.
  • Watch completion_tokens in usage, which includes thinking, not just the visible answer.

Agents with real permissions

Neon's tool-calling rules are strict, and they matter most where the agent can write files or run commands:

  • Match calls and results. "Each FunctionResponse must match the id, name, and order of the preceding FunctionCall."
  • Keep the full history, signatures included. Google: "Pass back every thought_signature inside its original Part across all previous turns …" Stripping old signatures, or using placeholders such as skip_thought_signature_validator, "drops reasoning context and can trigger MALFORMED_FUNCTION_CALL."
  • On Chat Completions, return assistant messages unchanged. Keep each assistant message, with its tool calls, exactly as the API returned it. Don't rebuild history from your own logs. Google documents thought-signature support on its OpenAI-compatible chat completions for Gemini 3 models; check that your client keeps them for Neon.
  • Watch for a silent stop. A malformed function call ends the turn without a usable answer. Open-source proxies have reported this case reaching OpenAI-style clients as an ordinary stop or as a server error: LiteLLM pull request 52745 and Divyam issue 60 on GitHub, both opened in November 2026. If your agent sees an empty turn with no tool call, treat it as a failure and retry, not as the end of the task.

Google says Neon is better behaved than its predecessors in these loops. It "reduces redundant file reads, handles context compaction reliably, and minimizes fabricated claims and task shortcuts", and it cuts "agentic overreach and under-service". These are Google's claims, from its own evaluations. They lower the risk; they don't replace permission limits and review on writes.

Coding tools: Claude Code and Codex

AIHubMix's parameter schema lists four protocols for gemini-4-neon, including the two coding agents need: Anthropic Messages for Claude Code and the Responses API for Codex. Setup is the same as for any AIHubMix model; the Claude Code settings post and the Codex config.toml post cover it. What's specific to Neon:

Setting Claude Code Codex
Protocol Anthropic Messages Responses API
Model ID gemini-4-neon gemini-4-neon
Effort values low to xhigh low to xhigh
Context window 1,048,576 1,048,576
Output per request 65,536 65,536

Effort values and limits are from AIHubMix's parameter schema; the default effort is high on both protocols.

Claude Code. Set ANTHROPIC_MODEL to gemini-4-neon. Raise API_TIMEOUT_MS: its default is 10 minutes, and Google recommends at least 15 for hard prompts. Don't add assistant prefill to custom requests through the same endpoint; Neon doesn't support it.

Codex. Keep wire_api = "responses" and the AIHubMix base_url, set model = "gemini-4-neon", and pick model_reasoning_effort from Neon's levels. Start with medium; Codex runs many short tool turns, where high mostly adds waiting time.

Known issues to expect:

  • Long first tokens at high and xhigh.
  • Responses that stop at the 65,536-token cap when thinking runs long.
  • Empty turns where a tool call failed, as above.
  • A March 2026 knowledge cutoff, so library versions newer than that need to be in context.

A 10–15-minute smoke test

  1. Pick a small repository with one failing unit test and a test command that runs in under a minute.
  2. Point the tool at gemini-4-neon, set effort to medium and the client timeout to at least 15 minutes.
  3. Ask for the smallest change that makes the test pass. Then run the test and read the diff.
  4. Pass: a minimal diff, the test green, inside 15 minutes. Fail: note whether you got a 400, an empty turn, a timeout or a bad edit. Each has a fix above.
  5. Repeat at high. Keep the lower level unless high fixes something medium got wrong.

Checklist

  • Model ID set to gemini-4-neon.
  • Thinking level set explicitly, per call type; medium if you relied on Argon's or 3.8 Flash's default.
  • No thinking_budget; MINIMAL replaced with LOW.
  • Only one of reasoning_effort and the native thinking level per request.
  • No frequency_penalty or presence_penalty; candidate_count and n at 1 or omitted.
  • No temperature, top_p or top_k; structured output where format matters.
  • Explicit cache code removed; static prompt prefix first and above 4,096 tokens.
  • Output cap at 65,536 or below on AIHubMix, and no low caps left from older models.
  • Client timeouts at 15 minutes or more.
  • History never ends on an assistant turn; no prefill.
  • Assistant turns and tool calls returned exactly as received; parallel calls and results grouped in order.
  • Empty turns with no tool call treated as failures and retried.
  • Budget includes thinking tokens and web search requests.
  • Coding tool smoke-tested at medium and high.

FAQ

Do I need to change my request format to move to Gemini 4 Neon?
From another Gemini 4 model, no: Google says the schema is the same, so change the model ID and check the thinking level. From Gemini 3.1 Pro or 3.8 Flash, remove thinking_budget, MINIMAL, the penalty parameters and explicit caching.

Why do my requests cost more after switching from 3.8 Flash?
Neon's price is four times 3.8 Flash's, and it defaults to high thinking where 3.8 Flash defaulted to medium. On Artificial Analysis's measurements, Neon High costs about twice as much per task as Neon Medium. Set the level explicitly. From Argon, AA's cost per task goes down even at high.

Why does Neon return a 400 for thinking_budget?
Neon only accepts the named thinking levels, low, medium, high and xhigh. Google rejects thinking_budget and MINIMAL with HTTP 400 instead of mapping them.

Does temperature still work?
No. Neon ignores temperature, top_p and top_k, and out-of-range values return a 400. Use the thinking level and structured output instead.

Can Neon return more than 65,536 tokens through AIHubMix?
AIHubMix documents a 65,536-token output cap per request for Neon, including thinking. Google's long decode up to about 1M tokens works on Google's own API; through AIHubMix it isn't available on the OpenAI-compatible endpoint, and the native path is untested here.

Can I use Gemini 4 Neon in Claude Code or Codex?
Yes. AIHubMix lists the Anthropic Messages protocol that Claude Code uses and the Responses API that Codex uses. Set the model to gemini-4-neon, raise the timeout, and run a short smoke test first.

Is Gemini 3.1 Pro being shut down?
Google hasn't announced a shutdown date for Gemini 3.1 Pro Preview, Gemini 3.8 Flash or any Gemini 4 model. It recommends Neon as the upgrade for 3.1 Pro.

Keep reading: the Gemini 4 Neon series

Sources

More from the blog