Hermes Agent Gemini 4 setup takes about five minutes: add a Google AI Studio API key to ~/.hermes/.env, run hermes model, choose Google AI Studio and pick gemini-4-hydrogen, gemini-4-argon or gemini-4-carbon.
Get Your Backlink Gameplan →Try Polar Rank Free for 3 Days →
The details that matter for operators are which Gemini 4 model to default to, how Hermes maps its effort levels onto Gemini's thinking levels, and when long decode switches on.
If you want agents like this working on your SEO, get your Backlink Gameplan, or try Polar Rank free for 3 days.
Everything below follows the Hermes Google Gemini guide and Google's Gemini 4 model pages.
Before you start
- A Google AI Studio API key, created at aistudio.google.com/apikey.
- A billing-enabled Google Cloud project; the guide warns the free tier is too small for long agent sessions because Hermes can make several model calls per turn.
- Hermes Agent installed; the native Gemini provider needs no extra Python package.
- Note that you cannot sign in to Hermes with a consumer Gemini subscription; the provider takes an API key, or Vertex AI billing for Google Cloud projects.
Quick start
# 1. add your key (GEMINI_API_KEY also works)
echo "GOOGLE_API_KEY=your-key-here" >> ~/.hermes/.env
# 2. pick the provider and model
hermes model
# More providers... -> Google AI Studio -> gemini-4-hydrogen
# 3. check it, then chat
hermes doctor
hermes chat
hermes model checks your key tier and lists the Gemini models it can reach.
If you prefer editing config by hand, this is what ends up in ~/.hermes/config.yaml:
model:
default: gemini-4-hydrogen
provider: gemini
base_url: https://generativelanguage.googleapis.com/v1beta
Use Gemini's native IDs such as gemini-4-hydrogen, not OpenRouter-style IDs like google/gemini-4-hydrogen, when the provider is gemini.
Which Gemini 4 model to run
| Model | Hermes model ID | Role | Tier |
|---|---|---|---|
| Gemini 4 Hydrogen | gemini-4-hydrogen | Fast model for everyday coding and agent work; adds an xhigh thinking level | Free and paid |
| Gemini 4 Argon | gemini-4-argon | Flagship reasoning; shared 1M input and output window, long decode | Paid |
| Gemini 4 Carbon | gemini-4-carbon | Strongest reasoning; more thinking per turn than Argon at the same price | Paid only |
Google's changelog dates general availability as Argon on 13 October, Carbon on 10 November and Hydrogen on 12 November 2026.
Hydrogen costs less per token than Argon and Carbon, which share pricing, so it is the natural default for a busy gateway; promote hard turns to Argon or Carbon with /model.
Get Your Backlink Gameplan →Try Polar Rank Free for 3 Days →
🔥 Running Hermes with Gemini 4 across your business? Inside the AI Profit Boardroom you get step-by-step video trainings, the installable Agent OS, four coaching calls a week and 3,400+ members testing the newest models on real business work. → Join the AI Profit Boardroom
How Hermes effort maps to Gemini thinking
| Hermes effort | Argon / Carbon thinkingLevel | Hydrogen | Output budget |
|---|---|---|---|
| none, minimal, low | low | low | Per-request cap |
| medium | medium (Google's default) | medium | Per-request cap |
| high | high | high (Google's default) | Per-request cap |
| xhigh | high | xhigh | 262,144 tokens with long decode |
| max, ultra | high | xhigh | 1,048,576 minus input, long decode |
Set effort with /reasoning in a session or agent.reasoning_effort in config.
Note the defaults differ: Google defaults Argon and Carbon to medium thinking but Hydrogen to high, so the same Hermes effort can cost noticeably different amounts across the three.
Long decode for very long outputs
Without long decode, one Gemini request stops at 65,536 output tokens when streaming and 32,768 when not, thinking included.
At xhigh or max, Hermes raises the output budget and, when a request hits the cap with budget left, resends it with Google's continuation token until the model finishes, joining the hops into one reply, as Google's long decode docs describe.
Two caveats: long decode only runs on the native AI Studio and Vertex AI express endpoints, not Google's OpenAI-compatible endpoint, OpenRouter or the OAuth Vertex provider; and those requests are stored by Google for its standard period, 55 days on paid and 1 day on free, because continuation needs a stored interaction.
Every other Gemini request goes through the Interactions API with store: false, so Google keeps no copy.
Vertex AI express keys and Argon
Google now issues AQ.-prefixed keys for both AI Studio and Vertex AI express, so Hermes no longer guesses from the key shape; the base URL decides.
For an express key, add GEMINI_BASE_URL=https://aiplatform.googleapis.com to ~/.hermes/.env; a 403 PERMISSION_DENIED usually means key and host are crossed.
Gemini 4 Argon is served only in the global location, so on express use the project-scoped URL ending /projects/<project>/locations/global.
Get Your Backlink Gameplan →Try Polar Rank Free for 3 Days →
Earlier Hermes builds rerouted AQ. keys automatically; that is gone, so existing express users must set the base URL once.
📞 Want agents growing your organic traffic? Get your Backlink Gameplan and we will map where Hermes and Gemini 4 fit into your SEO and AI search work, or try Polar Rank free for 3 days. Backlink Gameplan or try Polar Rank free for 3 days
Fallbacks so Gemini never stalls a session
fallback_providers:
- provider: gemini
model: gemini-4-argon
- provider: anthropic
model: claude-opus-5-5
Hermes tries fallback entries in order when the primary hits rate limits, overload, auth failures or connection drops, per its fallback docs.
Gemini entries accept gemini, google, google-gemini or google-ai-studio as the provider name.
Since v0.23.0, a Gemini safety block also moves the turn to the fallback model instead of ending it, and hermes fallback check --live sends one small request per entry to prove the chain works.
Messaging gateway
hermes gateway setup
hermes gateway start
Gemini works on every Hermes gateway platform, including Telegram, Discord, Slack and WhatsApp, reading the same config.yaml.
Troubleshooting
| Error | Fix |
|---|---|
| "Gemini native client requires an API key" | Add GOOGLE_API_KEY or GEMINI_API_KEY to ~/.hermes/.env, then rerun hermes model |
| "This Google API key is on the free tier" | Enable billing on the key's Cloud project, regenerate if needed, rerun hermes model |
| 404 model not found | Model not enabled for your account, region or key; pick another in hermes model |
| Tool calls fail with schema errors | Upgrade Hermes and rerun hermes model |
| Requests going to the /openai endpoint | Set GEMINI_BASE_URL to the native v1beta URL or remove it |
| 403 PERMISSION_DENIED | Key and host crossed; match AI Studio keys to the default host and express keys to aiplatform |
What the native adapter does for you
Hermes keeps its own agent loop in OpenAI-shaped messages and translates each request to Gemini's native schema: messages become contents, system prompts become systemInstruction, tool schemas become functionDeclarations and tool results become functionResponse parts.
Union types such as ["number", "null"] are rewritten into Gemini's scalar-plus-nullable form, and multi-type unions survive through anyOf, so MCP tools work without changes.
For Gemini 3 and later, Hermes preserves the thoughtSignature values on function-call parts and replays them on the next tool turn, which keeps multi-step tool loops valid.
Get Your Backlink Gameplan →Try Polar Rank Free for 3 Days →
Choosing the API per model
providers:
gemini:
gemini_api: auto # default: Interactions for Gemini 3+
models:
gemini-4-hydrogen:
gemini_api: interactions
Per the Hermes guide, AI Studio requests for Gemini 3 and later go through the Interactions API by default, while Gemini 2.x and Gemma use generateContent; a per-model setting wins over the provider-wide one and applies on the next request without a restart.
Vertex AI express and proxy base URLs always use generateContent, since Interactions only exists on the AI Studio host.
Billing quirks of long decode
Every long-decode hop re-reads the prompt plus the output so far, so the summed input count Google bills is far larger than the real context.
Hermes prices those summed counts but feeds the first hop's prompt size to context compaction and the context meter, so a long-decode turn does not trigger an early compaction.
Google's caching docs add that Gemini 4 supports implicit caching on prompts of 4,096 tokens or more, with a 95% discount on cache hits, but not explicit caching.
Keep stable instructions at the top of the system prompt so long agent sessions hit the implicit cache.
Resilience settings worth tuning
- Credential pools rotate multiple keys for the same provider before any cross-provider fallback.
- When a rate-limit response names a reset time, the primary is benched until exactly then; otherwise backoff runs from 60 seconds up to four hours.
fallback.min_switch_reset_secondsskips the switch when the primary reopens soon, avoiding pointless provider hops.- Auxiliary tasks such as vision and compression resolve providers independently, so they can stay on Gemini while chat falls back.
All four are documented in the fallback providers page.
Pricing window on Carbon
Google put Carbon on an introductory rate until 30 November 2026, per its model page; after that its per-token price matches Argon's.
If you are load-testing Carbon this month, re-check your cost model in December before rolling it out across a gateway.
Recommended operator setup
- Default to
gemini-4-hydrogenatmediumeffort for gateway traffic. - Escalate to
gemini-4-carbonorgemini-4-argonwith/modelfor hard reasoning. - Reserve
xhighandmaxfor jobs that genuinely need very long outputs, remembering they are stored by Google. - Add at least one non-Google fallback and run
hermes fallback check --liveweekly. - Run
hermes doctorafter every Hermes upgrade.
Members of the AI Profit Boardroom get the Agent OS on Hermes with model routing already set up.
Get Your Backlink Gameplan →Try Polar Rank Free for 3 Days →
FAQ: Hermes Agent Gemini 4 Setup
How do I use Gemini 4 in Hermes Agent?
Add GOOGLE_API_KEY to ~/.hermes/.env, run hermes model, choose More providers then Google AI Studio, and pick a Gemini 4 model.
Which Gemini 4 model should Hermes use by default?
Gemini 4 Hydrogen for everyday agent work; it is the fastest and lowest-priced Gemini 4 model. Use Argon or Carbon for hard reasoning.
Can I use the Gemini free tier with Hermes?
Hydrogen is on the free tier, but the Hermes guide warns free quotas run out after a handful of agent turns. Carbon is paid only.
Does long decode work through OpenRouter?
No. Long decode only runs on the native AI Studio and Vertex AI express endpoints.
Can I sign in with my Gemini subscription?
No. Hermes takes a Gemini API key, or Vertex AI credentials for Google Cloud billing.
📺 Video notes + links to the tools 👉
🎥 Learn how I make these videos 👉
🆓 Get a FREE AI Course + Community + 1,000 AI Agents 👉
About Julian
I'm Julian Goldie, an SEO entrepreneur, author and founder of the AI Profit Boardroom, which has 3,400+ members.
I help business owners scale with AI agents, automation and SEO.
- I've built a 7-figure SEO and link building agency, Goldie Agency, with a team of 70+ SEO experts.
- I've grown a YouTube channel to 400,000+ subscribers.
- I wrote "Link Building Mastery".
- My Udemy courses have taught over 29,000 students.
→ Get my best AI training inside the AI Profit Boardroom
Default to Hydrogen, escalate when needed and add a fallback, and Hermes Agent Gemini 4 runs smoothly; for SEO help, get your Backlink Gameplan, or try Polar Rank free for 3 days.











