Gemini Provider
Run Google Gemini models via the API-direct path (key-based, cloud) or via the user-resident Antigravity agy CLI (local/host-session, no key). A single provider; the auth mode selects the execution path.
Rensei integrates with Google Gemini models through the gemini provider. The same catalog entry supports every auth mode - the resolver picks the execution path based on the auth mode you configure:
| Auth mode | Execution path | Credential source |
|---|---|---|
byok, metered, shared | API-direct (Go in-process HTTP client) | Platform-managed or BYOK API key |
local, host-session | Antigravity agy CLI subprocess (under a pty) | Your own agy OAuth session - no API key |
There is one provider in the catalog - gemini - not two. Selecting a key-based auth mode gives you cloud-capable API-direct execution; selecting local or host-session runs the model through the Antigravity agy CLI on your local daemon host, under your own Google subscription (no API key required). At dispatch the resolver rewrites a local/host-session Gemini profile to the agy-cli runtime provider.
Why agy? Google end-of-lifed the standalone gemini CLI on 2026-06-18 and replaced it with Antigravity. The local Gemini path now drives the official agy binary you've logged into - your own subscription, your own machine. The older gemini-cli provider has been removed; create local Gemini profiles with provider gemini and auth mode local.
Provider Summary
| Attribute | Value |
|---|---|
| Provider ID | gemini (runtime agy-cli for local/host-session) |
| Display name | Google Gemini |
| Config namespace | gemini |
| Supported auth modes | byok, metered, shared, local, host-session |
| Requires endpoint | No |
| Category | Cloud (key modes) / Local (agy modes) |
Available Models
Rensei's catalog includes:
- Gemini 3.5 Flash (
gemini-3.5-flash) - Flagship agentic/coding model; 1M context, thinking support. - Gemini 3.1 Pro Preview (
gemini-3.1-pro-preview) - Deep reasoning (thinking always on), preview quality. - Gemini 3.1 Flash Lite (
gemini-3.1-flash-lite) - Cheapest sub-agent tier; low latency. - Gemini 2.5 Pro (
gemini-2.5-pro) - 2M context, thinkingBudget support, multimodal. - Gemini 2.5 Flash (
gemini-2.5-flash) - Speed/cost trade-off with optional thinkingBudget. - Gemini 2.5 Flash Lite (
gemini-2.5-flash-lite) - Standard-effort triage / sub-agent tier.
Run rensei catalog list --provider gemini to see current models.
Key-based auth modes (API-direct, cloud dispatch)
These modes use the platform's in-process Go HTTP client to call the Gemini API directly. They support cloud sandbox dispatch.
BYOK
Bring your own Google Cloud API key:
- Get an API key from Google AI Studio.
- In Settings → Integrations, click Add Provider and select Google Gemini.
- Paste your API key and click Test Connection.
- In Settings → Model Profiles, create a profile with auth mode
byokand select a Gemini model.
Your org is billed directly by Google Cloud.
Metered
Platform supplies a managed API key. Your org is billed through Rensei's cost ledger. Metered mode must be enabled for your organization by the platform operator - see Auth Modes for details.
- In Settings → Model Profiles, create a profile with auth mode
meteredand a Gemini model. - Dispatch runs if your org is entitled; contact Rensei support to enable metered mode.
Shared
Free-tier platform key for trials. No setup required; quota is soft-limited per org per day.
- In Settings → Model Profiles, create a profile with auth mode
sharedand a Gemini model. - Dispatch runs if quota allows; returns
SHARED_QUOTA_EXCEEDEDotherwise.
Local / host-session auth mode (runs via your Antigravity agy CLI)
When you select auth mode local (or host-session), the resolver rewrites the runtime provider to agy-cli and donmai launches the Antigravity agy binary installed on your host - under a pseudo-terminal - instead of calling the Gemini API in-process. The CLI runs under your own OAuth subscription: no API key is injected by the platform, and your usage bills to your Google account, not Rensei.
Local execution only. The agy execution path runs only on local capacity pools (the donmai daemon on your machine). It is not available for cloud sandboxes (e2b, Modal, Vercel, Daytona, Docker) - those images do not have agy installed and logged in. Dispatching a local/host-session profile to a cloud pool fails validation with AUTH_MODE_REQUIRES_LOCAL_CAPACITY.
Capability comparison: agy path vs API-direct path
API-direct (byok/metered/shared) | agy path (local/host-session) | |
|---|---|---|
| Execution | Go in-process HTTP client | Subprocess: agy under a pty |
| Auth | Platform-managed or BYOK API key | Your own agy OAuth subscription - no key |
| Billing | Platform ledger / your Google Cloud key | Your Google subscription |
| Execution environment | Cloud or local | Local only |
Requires agy installed + logged in | No | Yes - you install + agy login yourself |
| Model selection | Per-profile model id | Your configured agy model (no per-run flag) |
| MCP / tool plugins | API-direct: none | Not wired in v1 (deferred) |
| Token/cost accounting | Yes | Not available (agy reports no token counts) |
Choose local/host-session to run Gemini under your own subscription with no platform key. Choose byok/metered/shared for cloud dispatch, per-profile model selection, and platform cost accounting.
Prerequisites for the agy path
Complete all of the following on the host machine that runs the donmai daemon:
Install Antigravity (agy) yourself
Rensei does not install or manage agy. Install the Antigravity CLI on your host and confirm it's on $PATH:
agy --versionThe binary must be on $PATH when the donmai daemon starts. If it is missing at startup, the agy execution path returns ErrProviderUnavailable and the runner skips it. See antigravity.google for installation.
Log in to agy (OAuth - no API key)
agy authenticates through Google OAuth under your own subscription. Log in interactively once on the host:
agy # complete the OAuth login flow, then quitThis persists your OAuth session under ~/.gemini/. Rensei injects no credentials into agy - it uses the session you logged in with.
There is no GEMINI_API_KEY for this path. The agy path is the no-key, subscription path; key-based dispatch uses the API-direct modes above. Rensei automates your own already-logged-in first-party agy binary - it does not reuse or wrap your OAuth token as a third party.
Run the donmai daemon with the local pool active
rensei daemon start
rensei daemon status
rensei host provider list # confirm `agy-cli` shows `ready`See Local Sandbox for full daemon setup.
Create a local-mode profile
Via the UI: Settings → Model Profiles → New Profile → Provider Google Gemini, Auth mode local, Model e.g. gemini-2.5-pro.
Via CLI:
rensei profile create \
--name "gemini-local" \
--provider gemini \
--model-id "gemini-2.5-pro" \
--auth-mode local \
--scope project \
--project-id my-projectCapability matrix (agy path)
| Capability | Value | Notes |
|---|---|---|
SupportsMessageInjection | false | Single-shot agy -p run; no between-turn injection. |
SupportsSessionResume | false | agy --conversation resume is deferred. |
AcceptsMcpServerSpec | false | MCP wiring is deferred for the agy path in v1. |
SupportsToolPlugins | false | See above. |
SupportsReasoningEffort | false | No headless effort/model flag; the model is your configured agy default. |
EmitsSubagentEvents | false | - |
The agy path streams the model's plain-text output as assistant events and recovers tool-use/tool-result structure best-effort from agy's on-disk transcript. The final result is captured via a structured-output instruction the provider appends to the prompt.
Credential flow (agy path)
agy OAuth session (you ran `agy login` on the host)
└── ~/.gemini/ ──► agy reads its own session per invocation
(Rensei injects NO key - host-session is fail-open)The platform does not inject any credential into agy. This mirrors the host-session pattern the claude/codex providers use - the host supplies the credential (here, an OAuth session); the platform supplies session routing.
Configuration (API-direct path)
Gemini supports safety settings and other Google-specific options via the gemini config namespace. These apply to the API-direct execution path:
{
"providerConfig": {
"gemini": {
"safetySettings": [
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "BLOCK_NONE"
},
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
}
],
"temperature": 0.7,
"topK": 40,
"topP": 0.95
}
}
}Safety settings
Gemini applies safety filters by default. Override to suit your use case:
BLOCK_NONE- No filtering.BLOCK_LOW_AND_ABOVE- Block low and above (strictest).BLOCK_MEDIUM_AND_ABOVE- Block medium and above (default).BLOCK_HIGH_AND_ABOVE- Block only high-severity (lenient).
Multimodal input (Vision)
Gemini supports image and video inputs. If your workflow includes images, Rensei automatically encodes them and sends them to Gemini's vision API. Example: analyze a screenshot in a workflow:
nodeId: analyze_screenshot
nodeType: action/llm.inference
config:
profileId: prof_gemini_vision
systemPrompt: "You are an expert UI/UX analyst. Analyze this screenshot."
inputs:
- type: image
source: $steps.capture_screenshot.output.image_urlContext window
Gemini 2.5 and 3.x models support large context windows (1M-2M tokens). Override the default window:
{
"providerConfig": {
"gemini": {
"contextWindow": 500000
}
}
}Example profiles
API-direct (BYOK, cloud dispatch)
rensei profile create \
--name "gemini-vision" \
--provider gemini \
--model-id "gemini-2.5-flash" \
--auth-mode byok \
--scope project \
--project-id my-projectLocal (agy, your subscription)
rensei profile create \
--name "gemini-local" \
--provider gemini \
--model-id "gemini-2.5-pro" \
--auth-mode local \
--scope project \
--project-id my-projectThen route work to the profile:
rensei routing set \
--scope project \
--project-id my-project \
--work-type development \
--profile-id prof_gemini_localPricing
View pricing in the model catalog:
rensei catalog show gemini-2.5-flash --format json | jq .pricingFor metered mode, cost events emit automatically with the org ID for billing. The agy path bills to your own Google subscription and reports no platform cost events.
Troubleshooting
"No metered key is configured for provider 'gemini'"
The platform's metered key pool for Gemini is not configured. Contact your Rensei operator - deployment-level key pool setup is covered in the operator docs.
"Invalid API key"
Your BYOK key is expired or malformed. Generate a new key from Google AI Studio and update Settings → Integrations.
"Organisation is not entitled to use metered auth mode"
The org's metered_enabled feature flag is not set. Contact Rensei support to enable metered mode for your organization.
AUTH_MODE_REQUIRES_LOCAL_CAPACITY (agy path)
You are dispatching a local/host-session profile to a cloud sandbox. Either dispatch from a machine with the donmai daemon running, or switch to a key-based auth mode (byok/metered/shared) for cloud dispatch.
ErrProviderUnavailable: agy CLI "agy" not on PATH (agy path)
The agy binary is not installed or not on $PATH when the daemon starts. Install Antigravity, confirm agy --version, then restart the daemon:
rensei daemon restart
rensei host provider list # `agy-cli` should show `ready`Sessions dispatch but produce no output / activities (agy path)
agy is probably not logged in. Run agy interactively once on the host to complete the OAuth login, then rensei daemon restart. (The agy path uses no GEMINI_API_KEY - it relies on your OAuth session.)
Vision input not processed (API-direct mode)
Ensure the image URL is accessible and in a supported format (JPEG, PNG, GIF, WebP).
Safety filter blocking requests (API-direct mode)
Review your safetySettings config. For development/testing, use BLOCK_NONE; for production, tune thresholds to your use case.
Further Reading
- Auth Modes - Full auth mode reference, including
localandhost-session - Local Sandbox - Local pool setup and daemon lifecycle
- Model Catalog & Routing - Profile and routing management
- Antigravity - The
agyCLI (successor to the EOL Gemini CLI) - Google AI Studio - Get a
GEMINI_API_KEYfor the API-direct path - Google Gemini Docs - Official API reference