> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laozhang.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 4 Hydrogen API: Pricing, Code Examples, and Hydrogen vs Gemini 3.8 Flash

> Gemini 4 Hydrogen (gemini-4-hydrogen) is live on LaoZhang API with a default-group API key at Google's price of $1.5 input and $7.5 output per 1M tokens. Model ID, curl and Python examples, the new xhigh thinking level, and how it compares with Gemini 3.8 Flash and Gemini 4 Argon.

Gemini 4 Hydrogen (`gemini-4-hydrogen`) is Google's new model for everyday coding and agent work, and its recommended upgrade from Gemini 3.8 Flash. Since November 14, any `default`-group LaoZhang API key can call it at \$1.5 input and \$7.5 output per 1M tokens, the same as Google's price.

* **Published:** November 14, 2026
* **Last checked:** November 14, 2026
* **Status:** Live in the `default` group

## Key facts

| Item | Details |
| - | - |
| Model ID | `gemini-4-hydrogen` |
| Google release | November 12, 2026 (GA) |
| Available on LaoZhang API | November 14, 2026 |
| OpenAI-compatible endpoint | `POST https://api.laozhang.ai/v1/chat/completions` |
| Native Gemini endpoint | `https://api.laozhang.ai/v1beta/models/gemini-4-hydrogen:generateContent` |
| Token group and billing | `default` group, billed by tokens |
| Price | \$1.5 input, \$7.5 output, \$0.075 cache read per 1M tokens |
| Context window (Google) | 1,048,576 tokens, one price across the whole window |
| Max output per request (Google) | 65,536 tokens by default |
| Thinking levels | `low`, `medium`, `high`, `xhigh`; Google's default is `high` |
| Works with | Function calling, structured output (JSON Schema), image input, streaming |

## Pricing

Prices from LaoZhang API's public pricing on November 14, 2026, in US dollars per 1M tokens:

| Item | LaoZhang API | Google |
| - | -: | -: |
| Input | \$1.5 | \$1.5 |
| Output (thinking tokens included) | \$7.5 | \$7.5 |
| Cache read | \$0.075 | \$0.075 |

* There are no context tiers. A prompt over 200K tokens costs the same per token, unlike Gemini 3.1 Pro.
* Thinking tokens are billed as output. For example, a request with 43 input tokens and 135 output tokens (answer plus thinking) costs about \$0.0011.
* Hydrogen thinks at `high` unless you say otherwise, so even easy questions produce thinking tokens. Send `low` when a short answer is enough; see [Thinking levels](#thinking-levels).
* Cache reads come from Google's implicit caching: when you resend the same prefix of 4,096 tokens or more, the cached part is billed at the cache price with no extra parameters. Hydrogen does not support explicit caching (`cachedContents`), so drop that code when you move over from Gemini 3.8 Flash.
* Per-request token usage and charges are in your [usage logs](https://api.laozhang.ai/log). Current prices are in the [model catalog](https://docs.laozhang.ai/en/models.md#vendor-google-text).

## Hydrogen vs Gemini 3.8 Flash and Gemini 4 Argon

| | `gemini-4-hydrogen` | `gemini-3.8-flash` | `gemini-4-argon` |
| - | - | - | - |
| On LaoZhang API since | November 14, 2026 | September 3, 2026 | October 14, 2026 |
| LaoZhang API price now (input / output) | \$1.5 / \$7.5 | \$0.75 / \$3.75 | \$2 / \$10 |
| Google price change | None announced | \$1.5 / \$7.5 from January 1, 2027 | \$4 / \$20 from December 1, 2026 |
| Default thinking level | `high` | `medium` | `medium` |
| Highest thinking level | `xhigh` | `high` | `high` |
| Explicit caching (Google) | No | Yes | No |

* **Coming from Gemini 3.8 Flash:** Google says Hydrogen is clearly stronger on coding and agent tasks and finishes them faster. Per token it costs twice as much today. Google's 3.8 Flash launch price runs through December 31, 2026; from January 1, 2027 both models have the same list price.
* **Compared with Gemini 4 Argon:** in the benchmark index Google cited at launch, Hydrogen at its default `high` level scores slightly above Argon, while its per-token price is 25% lower. Once Argon moves to Google's list price on December 1, Hydrogen costs less than half as much. For the hardest coding, debugging, and science problems, also try [Gemini 4 Carbon](https://docs.laozhang.ai/en/announcements/gemini-4-carbon-2026-11.md).
* The quality claims above are Google's. Before you switch production traffic, run your own prompts and compare results, latency, and token usage in your [usage logs](https://api.laozhang.ai/log). All three models are called the same way; only `model` changes.

## Request examples

Create an API key under [Tokens](https://api.laozhang.ai/token): choose the `default` group and set billing to "usage first" (recommended) or "usage". Then set an environment variable:

```bash theme={null}
export LAOZHANG_API_KEY="your-laozhang-api-key"
```

> [tab] OpenAI-compatible
>
> ```bash theme={null}
> curl https://api.laozhang.ai/v1/chat/completions \
>   -H "Authorization: Bearer $LAOZHANG_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "model": "gemini-4-hydrogen",
>     "reasoning_effort": "low",
>     "messages": [
>       {"role": "user", "content": "Write a Python function that turns a duration string like \"1h30m\" into seconds."}
>     ]
>   }'
> ```

> [tab] Native Gemini
>
> ```bash theme={null}
> curl "https://api.laozhang.ai/v1beta/models/gemini-4-hydrogen:generateContent" \
>   -H "Authorization: Bearer $LAOZHANG_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "contents": [
>       {"role": "user", "parts": [{"text": "Write a Python function that turns a duration string like \"1h30m\" into seconds."}]}
>     ],
>     "generationConfig": {
>       "thinkingConfig": {"thinkingLevel": "low"}
>     }
>   }'
> ```

> [tab] Python
>
> ```python theme={null}
> import os
> from openai import OpenAI
>
> client = OpenAI(
>     api_key=os.environ["LAOZHANG_API_KEY"],
>     base_url="https://api.laozhang.ai/v1",
>     timeout=600.0,
>     max_retries=0,
> )
> response = client.chat.completions.create(
>     model="gemini-4-hydrogen",
>     reasoning_effort="low",
>     messages=[{"role": "user", "content": "Write a Python function that turns a duration string like \"1h30m\" into seconds."}],
> )
> print(response.choices[0].message.content)
> print(response.usage)
> ```

* On the OpenAI-compatible API, the answer is in `choices[0].message.content` and the thinking token count is in `usage.completion_tokens_details.reasoning_tokens`.
* On the native API, the answer is in `candidates[0].content.parts[].text`, the thinking token count is in `usageMetadata.thoughtsTokenCount`, and `modelVersion` reads `gemini-4-hydrogen`.
* Code that already calls Gemini 3.8 Flash only needs `gemini-3.8-flash` replaced with `gemini-4-hydrogen` in `model` or the URL. Keep the same API key, and remove explicit caching if you use it.
* For native image, streaming, and multi-turn requests, see the [Gemini protocol](https://docs.laozhang.ai/en/api-reference/gemini.md). For tools, see [function calling](https://docs.laozhang.ai/en/api-capabilities/function-calling.md).

## Thinking levels

| API | Parameter | Values |
| - | - | - |
| Native Gemini | `generationConfig.thinkingConfig.thinkingLevel` | `low`, `medium`, `high`, `xhigh` |
| OpenAI-compatible | `reasoning_effort` | `low`, `medium`, `high` |

* Without a level, Hydrogen uses Google's default, `high`. That is more thinking than Gemini 3.8 Flash, which defaults to `medium`.
* `xhigh` is new with Hydrogen. It usually spends several times the thinking tokens of `high`, and Google warns it can overthink simple prompts. Save it for hard problems.
* To use `xhigh`, or to control the thinking level precisely, call the native API. On the OpenAI-compatible API, stick to the three values in the table.
* `minimal` returns an error on the native API. The lowest level is `low`.
* Thinking and the visible answer share `maxOutputTokens` (`max_tokens` on the OpenAI-compatible API). If the limit is too small, the model can run out before it writes the answer, and the thinking tokens are still billed. To cut cost, lower the thinking level instead of the output limit.
* Google says Gemini 4 Hydrogen ignores `temperature`, `top_p`, and `top_k`. Sending them does not cause an error, but it does not change the output.

## Who this affects

* **Affected:** projects using Gemini 3.8 Flash for coding, agents, or batch text work that want a stronger model, and projects that want a cheaper per-token price than Gemini 4 Argon. Any `default`-group key billed by usage can call it.
* **Not affected:** no existing model changed with this launch. `gemini-3.8-flash`, `gemini-4-argon`, `gemini-4-carbon`, and the other Gemini models keep working, and current integrations need no changes.

## FAQ

### What is the Gemini 4 Hydrogen model ID?

`gemini-4-hydrogen`. Google published only this GA ID, with no `-preview` or dated version. Put it in the `model` field on the OpenAI-compatible API, or in the URL path on the native API.

### Google has a free tier. Why call Hydrogen through LaoZhang API?

Google's free-tier limits apply per project, and Google uses free-tier data to improve its products. On LaoZhang API you use a LaoZhang API key and the base URL `https://api.laozhang.ai`, with no Google account or AI Studio API key. You pay from a prepaid balance by tokens, at Google's paid-tier price.

### Is Gemini 4 Hydrogen more expensive than Gemini 3.8 Flash?

Per token, twice as much right now: \$1.5 input and \$7.5 output for Hydrogen versus \$0.75 and \$3.75 for 3.8 Flash. The 3.8 Flash price is Google's launch price, which ends December 31, 2026; from January 1, 2027 Google lists both at the same price. What a request actually costs also depends on thinking tokens, and `low` cuts them sharply.

### Why are output tokens much larger than the answer?

Output tokens include thinking tokens. Hydrogen thinks at `high` by default, even on simple questions. The thinking part is `usage.completion_tokens_details.reasoning_tokens` (`usageMetadata.thoughtsTokenCount` on the native API). Send `low` when a short answer is all you need.

### Does it accept images, PDFs, audio, or video?

Image input works: use `image_url` (URL or Base64) on the OpenAI-compatible API, or `inlineData` / `fileData` on the native API. Google also lists video, audio, and PDF input; see [image understanding](https://docs.laozhang.ai/en/api-capabilities/vision-understanding.md) and the [Gemini protocol](https://docs.laozhang.ai/en/api-reference/gemini.md). The model outputs text only, not images or speech.

### What if long requests time out?

At the default `high` level a request can take tens of seconds, and `xhigh` takes longer. Set your client timeout to about 600 seconds and stream the response:

* OpenAI-compatible API: add `"stream": true` to the request.
* Native API: call `streamGenerateContent?alt=sse` instead.

## Sources and related pages

* [Google: Gemini 4 Hydrogen model page](https://ai.google.dev/gemini-api/docs/models/gemini-4-hydrogen): model ID, context window, output limit, input types, and supported tools.
* [Google: What's new in Gemini 4 Hydrogen](https://ai.google.dev/gemini-api/docs/whats-new-gemini-4-hydrogen): thinking levels, implicit caching, and migrating from Gemini 3.8 Flash.
* [Google: Gemini API pricing](https://ai.google.dev/gemini-api/docs/pricing): list prices for Hydrogen, 3.8 Flash, and Argon.
* [Google: Gemini API changelog](https://ai.google.dev/gemini-api/docs/changelog): GA release on November 12, 2026.
* [Model catalog](https://docs.laozhang.ai/en/models.md#vendor-google-text): LaoZhang API's current prices.
* [Gemini 3.8 Flash launch announcement](https://docs.laozhang.ai/en/announcements/gemini-3-8-flash-2026-09.md)
* [Gemini 4 Carbon launch announcement](https://docs.laozhang.ai/en/announcements/gemini-4-carbon-2026-11.md)
* [Text generation API: protocols and popular models](https://docs.laozhang.ai/en/api-capabilities/text-generation.md)
* [Gemini protocol: generateContent](https://docs.laozhang.ai/en/api-reference/gemini.md)
* [LaoZhang API announcements](https://docs.laozhang.ai/en/changelog.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.