# Migrating from Gemini 3.8 Flash to Hydrogen and Decisions API

> Source: <https://dev.to/altrouter/migrating-from-gemini-38-flash-to-hydrogen-and-decisions-api-3n6c>
> Published: 2026-11-13 11:45:51+00:00

The promo period for Gemini 4 Carbon ends on November 30, 2026. The discount on Gemini 3.8 Flash expires on December 31. Passing the old thinking budget parameter now breaks production with an HTTP 400 error. Developers need to update their agent architecture and avoid doubling their budget.

A stack using `gemini-decision-1` at the entry point and `gemini-4-hydrogen` for logic pays off immediately through a 2.5x speed boost. The price of 3.8 Flash will rise to $1.50 for input and $7.50 for output on January 1, 2027. This will make it cost exactly the same as the faster Hydrogen model.

Gemini 4 Hydrogen costs $1.50 per 1 million input tokens and $7.50 per 1 million output tokens. The current rate for [Gemini 3.8 Flash](https://altrouter.ai/en/models/gemini-3.8-flash/) is $0.75 for input and $3.75 for output. The difference is exactly double.

The $0.75 and $3.75 rate is only valid until December 31, 2026. The base price of 3.8 Flash [will hit the same $1.50 and $7.50](https://cloud.google.com/model-garden/pricing) on January 1, 2027. Hydrogen [completes tasks 2.5 times faster](https://venturebeat.com/technology/google-launches-gemini-4-hydrogen-a-faster-smarter-pricier-flash-successor) on the standard `high` thinking setting.

The new model [scores 51 points against 31 points for 3.8 Flash](https://venturebeat.com/technology/google-launches-gemini-4-hydrogen-a-faster-smarter-pricier-flash-successor) in the Artificial Analysis Intelligence Index benchmark. The score reaches 54 points at the `xhigh` level. Hydrogen beats even the October flagship `gemini-4-argon`, which scores only 50 points. The distilled smaller model outperforms the flagship in tests, breaking the usual hierarchy.

Provisioned Throughput for Hydrogen [reaches 685 tokens per second](https://docs.cloud.google.com/gemini-enterprise-agent-platform/release-notes) per 1 GSU. Task execution via Batch [takes up to 24 hours](https://venturebeat.com/technology/google-launches-gemini-4-hydrogen-a-faster-smarter-pricier-flash-successor), while Flex finishes in 1 to 15 minutes. Developers on Hacker News agree that the Argon model is effectively dead after the Hydrogen release. Users complain about Argon being slow. Competing models manage to complete several tasks in the same timeframe.

Quota anomalies inside development environments make things worse. Forums show A/B test measurements where Gemini 4 flagship models consume the shared 5-hour Antigravity quota pool 3 times faster per published dollar of API cost. This equals $6 for input and $30 for output instead of the stated $2 and $10. Google has not provided an official comment on this billing mechanic inside the IDE.

Here is the math for January 1, 2027. Assume an agent processes 10 million input tokens and generates 2 million output tokens. On 3.8 Flash, this will cost $15 for input (10 multiplied by $1.50) and $15 for output (2 multiplied by $7.50). The total is $30. The numbers will be absolutely identical on Hydrogen. The bill will be the same $30, accompanied by a 2.5x speed increase and 20 extra intelligence points.

| Model | Input (promo) | Output (promo) | Promo ends | Input (standard) | Output (standard) | 
|---|---|---|---|---|---|
| Gemini 3.8 Flash | $0.75 | $3.75 | 12/31/2026 | $1.50 | $7.50 | 
| Gemini 4 Argon | $2.00 | $10.00 | 11/30/2026 | $4.00 | $20.00 | 
| Gemini 4 Hydrogen | None | None | None | $1.50 | $7.50 | 

The Hydrogen model [is built on the Carbon architecture](https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-hydrogen/) specifically for fast code generation and agent task execution. Giving it primitive routing is too expensive. The model costs 15 times more than basic competitors like Claude Haiku 5.5. Google [launched the Decisions API](https://blog.google/innovation-and-ai/technology/developers-tools/gemini-decisions-api/) and the `gemini-decision-1` model for binary classification.

This model evaluates typed questions in a single pass. The main number: [output tokens cost exactly $0](https://blog.google/innovation-and-ai/technology/developers-tools/gemini-decisions-api/). The developer pays only $0.10 per 1 million input tokens. The shared input context is billed once per request. You can pass a thousand independent questions without changing the price.

Compare this with [Gemini 3.5 Flash Lite](https://altrouter.ai/en/models/gemini-3.5-flash-lite/). It costs $0.30 for input and $2.50 for output. Filtering 10,000 user requests with 2,000 input tokens each requires the model to produce a short 50-token answer.

Input on 3.5 Flash Lite will cost $6 (20 million tokens multiplied by $0.30 and divided by a million). Output will cost $1.25 (500,000 tokens multiplied by $2.50 and divided by a million). The total is $7.25.

Input on `gemini-decision-1` costs $2 (20 million tokens multiplied by $0.10 and divided by a million). Output costs $0. The total is $2.00. The new model is almost four times cheaper. End-to-end latency [is 150 to 250 ms](https://www.reddit.com/r/GeminiAI/comments/1xtwzdf/google_introduces_their_first_decision_model/). The median compute time of the model itself on a context up to 16,000 tokens stays within 50 to 100 ms.

Three types of questions are passed through the `client.decisions.create` method in the `v1beta` API. These are binary yes or no (`noul`), selecting one option from 2 to 255 choices (` choice`), and scoring on a rubric of 2 to 255 levels (` score`). All this runs on top of a shared input of up to 262,144 tokens. A latency of 150 to 250 ms lets the model cut off simple intents before calling heavy generation models. The probability range for the `noul` type returns between 0.01 and 0.99.

``` python
from google import genai
from google.genai import types

client = genai.Client(api_key="YOUR_API_KEY")

response = client.decisions.create(
    model="gemini-decision-1",
    contents="User query: Create a python script to parse JSON and save to CSV.",
    decisions=[
        types.Decision(
            id="needs_code",
            type="noul",
            description="Does the user ask to write code?"
        ),
        types.Decision(
            id="complexity",
            type="choice",
            choices=["simple", "complex"],
            description="Rate the task complexity."
        )
    ]
)
print(response.decisions[0].probability)
```

The `gemini-4-carbon` model [opened to the public on November 10, 2026](https://aistudio.google.com/learn/gemini-4-carbon-developer-guide) two weeks after a closed release for cybersecurity specialists. A promo price applies until November 30 inclusive: $2.00 per 1 million input and $10.00 per 1 million output tokens. The price [will double](https://cloud.google.com/model-garden/pricing) on December 1: $4.00 for input and $20.00 for output.

Running the entire agent cycle on pure Carbon will become too expensive. The internal Orchestrator routing tool in Google Antigravity shows a way to cut costs. It dynamically switches tasks between Carbon and Hydrogen within a single session. Carbon plans the architecture, resolves deadlocks, and works in read mode to study dependencies. Hydrogen writes code, updates packages, and runs tests. Hydrogen returns control to Carbon to fix the plan if it hits an error.

This role separation [reduced quota consumption by 24%](https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-hydrogen/) and sped up processing by 19% on the Terminal-Bench 4.0 benchmark while maintaining quality at the level of pure Carbon.

We can calculate the savings with specific numbers for December 1. Assume a heavy task requires 500,000 input tokens and 100,000 output tokens. Pure Carbon costs $2 for input (0.5 multiplied by $4.00) and $2 for output (0.1 multiplied by $20.00). The total is $4. A hybrid session will cost $3.04 if Orchestrator reduces consumption by 24%. The savings will be almost a dollar on each run.

Skeptics on Hacker News [consider 24% savings a modest result](https://news.ycombinator.com/item?id=50472260). Discussions mention experience with the Mjolnir tool between Opus and DeepSeek Flash, where developers see 60% savings. This is a working method to keep the budget under control after December 1 for the Google ecosystem. Carbon [showed a 0.0% attack success rate](https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-carbon/) on the Gray Swan Indirect Prompt Injection benchmark in internal tests against 0.7% for Argon. Carbon cut the number of unverified claims in half, reduced out-of-bounds instructions by 26%, and lowered underperformance by 29%.

Replacing the `model="gemini-3.8-flash"` string with `gemini-4-hydrogen` will break the application. Google made strict changes to request parameters. Migration [will require an SDK update](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/migrate): `google-genai >= 2.34.0` for Python or `@google/genai >= 2.32.0` for JS.

The `thinking_budget` parameter has been completely removed in Hydrogen. Developers can no longer set a hard upper limit on spending for hidden thinking tokens. Passing `thinking_budget` or `thinking_level="MINIMAL"` [returns an HTTP 400 error](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/migrate).

Only `LOW`, `MEDIUM`, `HIGH`, and `XHIGH` levels are allowed. The exact token consumption at the `XHIGH` level is undocumented. Predicting the cost of a single step before it finishes is impossible without a budget parameter. The official documentation indicates a default `medium` level for Carbon and `high` for Hydrogen, but hides the exact multipliers.

Custom sampling parameters like `temperature`, `top_p`, and frequency penalties are now [simply ignored](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/migrate). Behavior control has shifted to fixed thinking levels. Many developers pass a zero temperature for agent determinism out of habit. The API now quietly discards this parameter.

Hydrogen [was released with a short-term release status](https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-hydrogen/). Google can delete it with only a 45-day warning. A release schedule for a version with long-term support has not been announced yet.

Explicit caching via `cached_content` is no longer supported. Automatic implicit caching replaced it. The static prefix at the beginning of the prompt [must exceed 4096 tokens](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/4-hydrogen) for it to trigger.

Cache lifetime management will launch on January 12, 2027. Writing to the cache [will be billed at a 1.25x multiplier](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/4-hydrogen) of the base price. This will amount to $1.875 per 1 million tokens. Reading will keep a 95% discount, costing $0.075 per 1 million. Google has not published the exact hourly rate grid for long-term storage yet. The pricing tables for Carbon mark this column as unavailable.

We can calculate the cost of working with a 10,000-token system prompt. Writing this prompt to the cache will cost $0.01875 (10,000 multiplied by $1.875 and divided by a million). Each subsequent read will cost only $0.00075.

A strict rule was introduced for multi-step agents. Developers [are required to keep the field](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/migrate) `thought_signature` in all previous conversation turns. This applies to text responses and function calls. The signature stays only on the first `functionCall` if the agent calls tools in parallel.

You must pass the `prefix_mismatch_behavior="DROP"` parameter if your script compresses or edits the message history to save context. The request will fail with an error without it. All models in the family received a unified limit of 1,048,576 tokens. This pool is shared between input, thinking, function calls, and the final response. Up to 65,536 tokens are generated in one synchronous segment. You need to use `continuation_token` or pass a background work flag in the Interactions API to extend generation to a million tokens.

The process needs to be broken down into three levels to keep costs down after promo rates end. Let's calculate the cost of a typical agent session using the prices that take effect on January 1, 2027.

Step one: filtering. A user request of 5,000 tokens goes to `gemini-decision-1`. The model determines the task type and classifies intents. Input costs $0.0005 (5,000 multiplied by $0.10 and divided by a million). There are no output tokens.

Step two: planning. A complex task is passed to `gemini-4-carbon`. The agent sends 10,000 tokens of context and receives a 1,000-token plan. Input will cost $0.04 (10,000 multiplied by $4.00 and divided by a million). Output will cost $0.02 (1,000 multiplied by $20.00 and divided by a million). The total is $0.06.

Step three: execution. The plan goes to `gemini-4-hydrogen`. The model generates code and calls functions. Assume the agent does five iterations. Each iteration consumes 15,000 tokens on input and 2,000 on output. This totals 75,000 input and 10,000 output tokens. Input costs $0.1125 (75,000 multiplied by $1.50 and divided by a million). Output costs $0.075 (10,000 multiplied by $7.50 and divided by a million). The total is $0.1875.

The total session cost will be $0.248. The same five execution iterations plus planning will cost $1.06 if you do all the work exclusively on Carbon. A hybrid architecture with a router at the entry point reduces the final bill by more than four times. You can track these multi-model costs using an API gateway like altrouter.ai to keep the token bill predictable.
