How to Use Gemini 4 Hydrogen Vertex AI in opencode
Gemini 4 Hydrogen handles everyday coding, debugging, and agent tasks that need quick iteration. Use it for focused repository edits, codebase questions, and writing with specific tone and format requirements.
Prompts to try with Gemini 4 Hydrogen Vertex AI in opencode
Copy an example into opencode, or ask in your own words.
Use Gemini 4 Hydrogen with high reasoning to investigate the failing test in this project. Reproduce the failure, fix its cause, and report the checks you ran.
Use Gemini 4 Hydrogen to trace login through this repository. Identify the entry point, validation, session creation, and error paths, citing the relevant files.
Use Gemini 4 Hydrogen to add pagination to the existing results endpoint. Follow the project's conventions and verify empty results, the first page, and the final page.
Use Gemini 4 Hydrogen to review the current diff for behavior changes and likely regressions. Tie each finding to a concrete execution path.
Use Gemini 4 Hydrogen to explain the parser in this project. Show its input assumptions, failure behavior, and three examples drawn from the existing tests.
How to set up Gemini 4 Hydrogen Vertex AI in opencode
Pick the way that suits you. Each takes about two minutes.
Use Spiral's MCP server
- Add the server
Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
- Sign in
Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.
opencode mcp auth spiral
- Check it
Spiral shows as connected.
opencode mcp list
Use the Spiral skill
- Send opencode this message
Your agent reads Spiral's skill and sets itself up.
set up https://spiral.ai/SKILL.md
- Sign in or paste a key
Approve Spiral in the browser, or give the agent a key from the console.
Use the Spiral CLI
- Install and sign in
Installs the Spiral CLI, signs you in and adds its skill to your coding agents.
npx -y spiral-cli@latest init
Call the Spiral API
- Create an API key
In the console, under API keys.
- Run Gemini 4 Hydrogen Vertex AI
One request; the result comes back by polling or a webhook.
curl https://api.spiral.ai/v1/runs \ -H "Authorization: Bearer $SPIRAL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "provider": "vertex", "model": "google/gemini-4-hydrogen", "input": { "messages": [ { "role": "system" } ] } }'
Then paste one of the prompts above: opencode finds Gemini 4 Hydrogen Vertex AI on Spiral, shows the price and runs it.
Gemini 4 Hydrogen Vertex AI providers and prices
Spiral runs Gemini 4 Hydrogen Vertex AI through Vertex AI. Open a card for today's price, with every fee included.
Up to $0.040005 per run at the default inputs. $1.95 per 1M input tokens, $0.0975 per 1M cached input tokens, $9.75 per 1M output tokens.
Settings you can ask for
Ask opencode for any of these in your prompt.
| Setting | Allowed values | Default | Description |
|---|---|---|---|
| Seed | a whole number | ||
| Max tokens | 1 to 65536 | The most output tokens to generate. | |
| Reasoning effort | low, medium, or high | high | How much the model reasons. |
Every API field of Gemini 4 Hydrogen is on its tool page: open its card above.
What can you do with Gemini 4 Hydrogen Vertex AI in opencode?
Turn a bug report or scoped requirement into a code change you can review and test. Give Gemini 4 Hydrogen the relevant project context and a concrete acceptance check.
Repair a reproducible bug
Give Gemini 4 Hydrogen the failure, relevant code, and expected behavior. Ask for a focused patch and a check that reproduces the original problem.
Understand an unfamiliar codebase
Trace a request through the relevant functions and identify where validation, state changes, and error handling happen.
Make a scoped code change
Describe one behavior to change, supply the affected code, and request an implementation that follows the existing conventions.
Rewrite customer communications
Turn a rough announcement into a concise email with a specified tone, length, and set of facts to preserve.
Create study material
Turn supplied notes into a study guide with definitions, examples, and questions tied to the source material.
Label incoming feedback
Classify messages using a fixed label set and include a short supporting excerpt for each decision.
More on Gemini 4 Hydrogen Vertex AI and opencode
Gemini 4 Hydrogen Vertex AI in other agents
Questions about Gemini 4 Hydrogen Vertex AI in opencode
Can opencode use Gemini 4 Hydrogen Vertex AI?
Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Gemini 4 Hydrogen Vertex AI like any built-in tool.
How much does Gemini 4 Hydrogen Vertex AI cost in opencode?
Up to $0.040005 per run at the default inputs. $1.95 per 1M input tokens, $0.0975 per 1M cached input tokens, $2.4375 per 1M cache write tokens, $9.75 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.
Do I need a Vertex AI account to use Gemini 4 Hydrogen Vertex AI in opencode?
No. Spiral runs Gemini 4 Hydrogen Vertex AI on its own Vertex AI account. You sign in to Spiral once and never paste a key.
How long does it take to set up Gemini 4 Hydrogen Vertex AI in opencode?
About two minutes: add the server, then sign in, then check it.
Does opencode wait while Gemini 4 Hydrogen Vertex AI runs?
Gemini 4 Hydrogen Vertex AI runs in the background. opencode starts the run, checks on it and gives you the text, json when it's ready.
What is Gemini 4 Hydrogen useful for?
Use it for iterative coding, debugging, codebase questions, and writing with detailed instructions. Tasks with a clear target and a result you can check make practical starting points.
How much context and output can Gemini 4 Hydrogen handle?
Input and output share a 1,048,576-token context limit. A single foreground segment allows up to 65,536 output tokens, including reasoning and function calls, so leave room beyond the text you want returned.
When should I use more reasoning?
Use low reasoning for straightforward work such as labeling short messages. Use high reasoning for debugging or problems with several dependent steps.
How should I prompt Gemini 4 Hydrogen?
State the task, provide the relevant context, and define the desired format and tone. For example, request a short comparison table with explicit criteria instead of asking for a general overview.
Can Gemini 4 Hydrogen classify text using my labels?
Yes. Supply the allowed labels and explain how to distinguish them; structured output can constrain responses to those labels.
Start using Gemini 4 Hydrogen Vertex AI in opencode
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into opencode:
set up https://spiral.ai/SKILL.md


