Skip to main content
Gemini 4 Hydrogen is Google’s fast, efficient model for everyday coding, multimodal knowledge work, and agentic workflows. It is designed for rapid execution on its own or as an execution model alongside frontier models. Use the stable model ID gemini-4-hydrogen with POST /v1beta/models/gemini-4-hydrogen:generateContent.

Model specifications

Key capabilities

  • Long-context reasoning — Share up to 1,048,576 input, thinking, and output tokens in one context window.
  • Multimodal understanding — Analyze text, images, video, audio, and PDF documents; the model returns text.
  • Agentic workflows — Use function calling, code execution, Google Search, Google Maps, URL context, and Computer Use (Preview).
  • Structured output — Constrain responses with responseMimeType and responseSchema.
  • Long decode — The native endpoint can return a continuationToken when a foreground segment reaches its output limit. Use the token with a continuation-capable client when you need a response beyond 65,536 output tokens; the unified request budget remains 1,048,576 tokens minus input tokens.

Choose a workflow

Send text in contents[].parts[].text. Use generationConfig.thinkingConfig.thinkingLevel to trade latency for reasoning depth. Valid values are low, medium, high, and xhigh; the default is high.The final conversation turn must be a non-empty user turn. Do not prefill a response by ending the request with a model turn.

Request examples

cURL

Generation controls

Conversation and response handling

  • Use user and model roles for conversation history.
  • Preserve complete model turns and every thoughtSignature in multi-step function workflows.
  • Check candidates[].finishReason before consuming the output.
  • Read token counts from usageMetadata, including thoughtsTokenCount for reasoning usage. Responses can also include createTime, promptTokensDetails, candidatesTokensDetails, and continuationToken.
  • Search and Maps responses can include groundingMetadata with queries, sources, and supporting segments.
  • Code execution can return executableCode and codeExecutionResult parts.
Do not send temperature, topP, topK, or candidateCount. Google documents these sampling controls as ignored for Gemini 4 Hydrogen. Explicit context caching is also unsupported; implicit caching may apply automatically.

API Reference

View request fields, capability examples, and response schemas for Gemini 4 Hydrogen.

Official references