Google Gemini with DevFlow: setup, scope and limits

A Google AI key lets DevFlow's OpenCode agents call Gemini models on your own account. The workspace stores it once, and every run with a google/ model ID uses it. Setup is 5 steps in Workspace Settings → Billing → Model access.

Kind
Model provider
Where to set it up
Workspace Settings → Billing → Model access
Plan
All plans
Agent roles
Any OpenCode role set to a google/ model
Verified
1 Oct 2026

Setup steps

  1. Create an API key. Create a key for the Generative Language API, the API behind Gemini.
  2. Open the Billing tab. As an owner, open the Billing tab and find "Model access"; if the provider cards are folded away, click "Manage keys".
  3. Add the key under Add provider. The card labelled "Google (Gemini)" appears only once a key exists. Use "Add provider": enter GOOGLE_GENERATIVE_AI_API_KEY, paste the secret into "API key" and click "Add".
  4. Test the key. Click "Test" on the Google (Gemini) card. DevFlow requests the model list at /v1beta/models, passing the key as a query parameter, and reports the answer. A key typed into the field but not yet saved is tested in place of the stored one, so a replacement can be checked before it goes live.
  5. Select the models. In the Execution tab, set "OpenCode Model", a tier or a role override to an ID such as google/gemini-2.5-pro.

What it does

Different client libraries read different variable names, so DevFlow fans one saved key out to three: GOOGLE_GENERATIVE_AI_API_KEY, GOOGLE_API_KEY and GEMINI_API_KEY. A row saved under any of these names therefore works the same way.

IDs such as google/gemini-2.5-pro can serve as the default OpenCode Model, back a tier or be pinned to one role. Planning and verification always ask for the highest reasoning effort, whichever provider serves them; a model that cannot honour the option ignores it or returns an error.

Gemini requests are not routed through the optional context-compression proxy, which fronts only Anthropic and OpenAI. Requests therefore always reach the Generative Language API directly, or through DevFlow's relay when that is on.

For each run, DevFlow stores input, output, cache-read and cache-write token counts as the OpenCode CLI reports them. Prompt-cache use thus appears in the same per-run records as for every other provider, ready for cost comparison.

Before the first task, "Check readiness" in the Repositories tab confirms that the default model and every per-role override have a credential, so a missing key shows up there instead of failing mid-task.

A single run may last up to 90 minutes and is stopped after 45 minutes without output, whatever the provider. Only the operator can change either limit, through AGENT_TIMEOUT_MINUTES and AGENT_IDLE_TIMEOUT_MINUTES.

Requirements

Limits

FAQ

Why is the Google (Gemini) card missing from a new DevFlow workspace?

DevFlow steers new workspaces to OpenRouter or a custom key, so the Anthropic, OpenAI and Google cards appear only after a key with their exact env name is stored.

Does DevFlow switch on prompt caching for Gemini?

No. Prompt caching for Gemini belongs to Google and the OpenCode CLI, and DevFlow has no setting that turns it on or off.

Sources

Every fact above comes from these files in the DevFlow repository.