Hydrogen defaults to high. Set generation_config.thinking_level to choose among low, medium, high, and xhigh, then use the same task set to find the lowest level that meets your quality requirements.
Good for: Choosing a thinking level for Gemini 4 Hydrogen API requests and diagnosing quality, latency, token usage, or output truncation issues.
Not suitable for: Comparing the overall capabilities of different models or different task sets.
Applicable model version: gemini-4-hydrogen.
Applicable client, agent, or API: Gemini API Interactions API; the example uses the Google Gen AI JavaScript SDK.
Recommended thinking level and parameters: Start with the default high for generally complex tasks. Try medium or low to meet latency and cost requirements. Raise the level to xhigh only for difficult, multi-step tasks where high does not meet the quality bar. Hydrogen does not support minimal.
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
model: "gemini-4-hydrogen",
input: "Review this retry queue code for race conditions and provide a corrected implementation.",
generation_config: {
thinking_level: "high",
},
});
console.log(interaction.output_text);Set thinking_level to low, medium, or xhigh to switch levels. If you omit this field, Hydrogen defaults to high. In REST requests, the corresponding field is under generation_config:
{
"model": "gemini-4-hydrogen",
"input": "Review this retry queue code for race conditions and provide a corrected implementation.",
"generation_config": { "thinking_level": "xhigh" }
}What each level means (as recommended in Google's documentation):
| Level | Tasks to try | Expected trade-offs |
|---|---|---|
low | Quick Q&A, high-throughput processing, latency-sensitive tool calls | Fewest tokens and lowest latency; can still handle agent tasks |
medium | Interactive coding, real-time UI prototyping, response-time-sensitive chat | Lower token usage and response time |
high | Complex coding, agent execution, tool calls, multimodal knowledge tasks | Hydrogen default; balances quality and speed |
xhigh | Difficult, multi-step coding or agent problems that high cannot solve | Deepest reasoning, with more token usage and higher latency; may overthink simple extraction tasks |
Use the following process to avoid mistaking truncation for a lack of capability at lower levels:
Keep the same set of Hydrogen inputs and change only thinking_level each time. Cover simple extraction, interactive coding, and complex multi-step problems.
For the initial side-by-side comparison, allow a generous max_output_tokens budget. Record task success rate, total time, and token usage at each level, then choose the lowest level that meets the quality bar.
For JSON and text extraction, compare high and xhigh separately. Check whether the extra reasoning improves results, increases latency or token usage, or exceeds the output budget.
Retest under the target production limit: max_output_tokens is a hard truncation limit that includes thinking tokens. If the budget runs out during reasoning, the response returns as incomplete, and the final text may be truncated or empty. If your goal is only to reduce cost or latency, lower the thinking level first; do not set the output limit too low.
Record total_thought_tokens and completion status to distinguish a normal answer, an exhausted reasoning budget, and valid output that is too long. If needed, raise the limit and rerun to confirm whether truncation occurred.
Steps 1–5 are validation recommendations based on the official documentation. Google recommends evaluating all four levels with a high max_output_tokens limit, then choosing the lowest level that meets your quality requirements.
The model-level table marks high as Hydrogen's default and lists low, medium, high, and xhigh as supported levels. The documentation says Gemini 4 does not support minimal.
Official descriptions: low uses the fewest tokens and has the lowest latency; medium is for interactive coding and latency-sensitive tasks; high is the recommended default for most Hydrogen tasks; xhigh is for difficult, multi-step problems that high cannot handle.
Google warns that xhigh increases latency and token usage, and may overthink simple text or JSON extraction or exhaust max_output_tokens.
max_output_tokens applies to thinking tokens and final output combined and is a hard infrastructure-enforced limit. Exhausting it during the thinking phase marks the response as incomplete and may produce truncated or empty output, but the thinking tokens already generated are still billed.
The Interactions API can provide total_thought_tokens in its response. Enabling thought summaries can expose reasoning summaries, but these may be empty or missing, so they should not be the sole indicator of whether reasoning took place.
The quality, latency, and token trade-offs for each level are described qualitatively by Google; the documentation does not provide fixed token counts or latency guarantees for each level. Measure results using your target inputs, output limits, and service environment. Do not generalize the result of a single task to all tasks.
On 2026-11-16, the original documentation was opened through Tabbit, and the “Controlling thinking” and “Token limits and max_output_tokens” sections, along with Hydrogen's Interactions API configuration example, were checked. The testing steps in this note are reproduction recommendations, not benchmark results published by Google.
Gemini 4 Hydrogen