On this page
On this page
Providers
Google (Gemini)
The Google plugin provides access to Gemini models through Google AI Studio, plus image generation, media understanding (image/audio/video), text-to-speech, and web search via Gemini Grounding.
- Provider:
google - Auth:
GEMINI_API_KEYorGOOGLE_API_KEY - API: Google Gemini API
- Default model:
google/gemini-4-argon - Managed-cloud provider:
google-vertexwith Google Cloud Application Default Credentials - Optional runtime:
agentRuntime.id: "google-gemini-cli"runs an explicitly configured model through the local Gemini CLI
Getting started
For most installations, use a Google AI Studio API key. Use google-vertex when
the Gateway already runs inside a managed Google Cloud environment.
AI Studio API key
Recommended for: standard Gemini API access.
Get an API key
Create a free key in Google AI Studio.
Run onboarding
Or pass the key directly:
Set a default model
Verify the model is available
With a configured API key, OpenClaw refreshes Google AI Studio's text-model
catalog from the Gemini models.list API. Supported Gemini text models therefore appear in
openclaw models list --provider google without waiting for an OpenClaw
release. Failed refreshes report the failure and retain the last successful
inventory, or bundled models before the first success. A successful empty
response clears discovered models. Vertex uses its separate static catalog.
Vertex AI (ADC)
Use google-vertex for Gemini with Google Cloud project billing and
Application Default Credentials. Follow the Google (Vertex AI)
setup guide for gcloud user ADC, service account
keys, metadata-server credentials, and Gateway environment configuration.
Gemini CLI runtime
Advanced use only: run a standard google/* model through an installed
Gemini CLI while keeping authentication on the supported AI Studio API-key
path.
OpenClaw does not offer new Gemini CLI OAuth or Antigravity OAuth setup. Google ended consumer Gemini CLI Login with Google access on June 18, 2026, and the Antigravity terms prohibit third-party tools from accessing the service through Antigravity OAuth. Use an AI Studio API key or Vertex AI instead.
Configure Google AI Studio
Complete the API-key setup in the first tab. OpenClaw must have a usable
google API-key profile before the CLI runtime can be selected.
Install Gemini CLI
The local gemini command must be available on PATH.
OpenClaw supports both Homebrew installs and global npm installs, including common Windows/npm layouts.
Select the CLI runtime
Keep the standard Google model ref and opt that model into the CLI runtime:
- Runtime:
google-gemini-cli - Auth: selected Google AI Studio API-key profile
- Model refs:
google/*
google-gemini-cli is the CLI backend the bundled Google plugin registers.
See CLI backends for its argv, JSONL dialect, and
session and compaction behavior, and for the settings shared by every
registered backend.
Existing valid Gemini CLI OAuth profiles remain executable for compatibility, but OpenClaw cannot create or repair them. If one breaks, replace it with a Google AI Studio API-key profile.
google-gemini-cli/* refs remain legacy compatibility aliases. New configs
should use google/* model refs plus the explicit runtime selection above.
Gemini 4 Argon
google/gemini-4-argon is the default Google model, with a 1,048,576-token
context window and up to 65,536 output tokens. google/gemini-4 is its shorthand;
the same model ID and shorthand are available for google-vertex.
Gemini 4 Argon supports text, image, audio, video, and PDF inputs, function
calling, structured outputs, and search grounding. It uses implicit context
caching only: explicit cachedContents handles and the Live API are not
supported. See Google's model documentation.
The bundled catalog also includes the stable google/gemini-3.8-flash, with a
1,048,576-token context window and up to 65,536 output tokens. The built-in
gemini-flash alias selects this model; gemini-flash-lite selects
google/gemini-3.5-flash-lite.
Capabilities
| Capability | Supported |
|---|---|
| Chat completions | Yes |
| Image generation | Yes |
| Music generation | Yes |
| Text-to-speech | Yes |
| Realtime voice | Yes (Google Live API) |
| Image understanding | Yes |
| Audio transcription | Yes |
| Video understanding | Yes |
| Web search (Grounding) | Yes |
| Thinking/reasoning | Yes (Gemini 2.5+ / Gemini 3+) |
| Gemma 4 models | Yes |
Responses marked MAX_TOKENS or CONTINUATION reached a generation limit.
OpenClaw preserves their partial content and reports a length-limited result.
Function calls in that partial response remain incomplete instead of becoming
an executable tool-use turn.
The managed Gemini and Vertex transports stop reading when a compatible proxy
sends data: [DONE], release the response body, and ignore later frames. A valid
candidate finish reason is still required for a successful result. First-frame
quota errors participate in API-key rotation. For Gemini's first-response retry,
usage metadata, response IDs, and empty or unspecified finish states do not count
as generated output or disable the existing retry deadline.
Web search
The bundled gemini web-search provider uses Gemini Google Search grounding.
Configure a dedicated search key under plugins.entries.google.config.webSearch,
or let it reuse models.providers.google.apiKey after GEMINI_API_KEY:
Credential precedence is dedicated webSearch.apiKey, then GEMINI_API_KEY,
then models.providers.google.apiKey. webSearch.baseUrl is optional and
exists for operator proxies or compatible Gemini API endpoints; when omitted,
Gemini web search reuses models.providers.google.baseUrl. See
Gemini search for the provider-specific tool behavior.
Image generation
The bundled google image-generation provider defaults to
google/gemini-3.1-flash-image.
- Also supports
google/gemini-3-pro-image - Generate: up to 4 images per request
- Edit mode: enabled, up to 5 input images
- Geometry controls:
size,aspectRatio, andresolution
To use Google as the default image provider:
Video generation
The bundled google plugin also registers video generation through the shared
video_generate tool.
- Default video model:
google/veo-3.1-fast-generate-preview - Modes: text-to-video, image-to-video, and single-video reference flows
- Supports
aspectRatio(16:9,9:16) andresolution(720P,1080P); audio output is not supported by Veo today - Supported durations: 4, 6, or 8 seconds (other values snap to the nearest allowed value)
To use Google as the default video provider:
Music generation
The bundled google plugin also registers music generation through the shared
music_generate tool.
- Default music model:
google/lyria-3-clip-preview - Also supports
google/lyria-3-pro-preview - Prompt controls:
lyricsandinstrumental - Output format:
mp3by default, pluswavongoogle/lyria-3-pro-preview - Reference inputs: up to 10 images
- Session-backed runs detach through the shared task/status flow, including
action: "status"
To use Google as the default music provider:
Text-to-speech
The bundled google speech provider uses Gemini API TTS. The default model
stays gemini-3.1-flash-tts-preview. Set model to gemini-3.8-flash-tts to
opt in to Gemini 3.8, or gemini-3.8-flash-lite-tts for the faster, lower-cost
variant. gemini-2.5-flash-preview-tts and gemini-2.5-pro-preview-tts remain
available.
- Default voice:
Kore - Auth:
tts.providers.google.apiKey,models.providers.google.apiKey,GEMINI_API_KEY, orGOOGLE_API_KEY - Output: WAV for regular TTS attachments, Opus for voice-note targets, PCM for Talk/telephony
- Voice-note output: Google PCM is wrapped as WAV and transcoded to 48 kHz Opus with
ffmpeg
Malformed or oversized successful TTS responses are reported without automatically submitting another Google synthesis request. Transient network failures, HTTP 5xx responses, and responses with no audio retain one automatic retry.
OpenClaw sends Gemini 3.8 TTS through the Interactions API
(POST /v1beta/interactions) with store: false. Google also documents 3.8 on
generateContent; Interactions is OpenClaw's routing choice, not a model
requirement. OpenClaw asks for headerless 24 kHz PCM (audio/l16) and still
wraps that PCM locally. audioProfile and personaPrompt are sent as
speech_metadata.style, speakerName as the structured speaker label, and
none of them are spoken as part of the transcript. Momentary 3.8 vocal tags use
angle brackets, such as <laugh> or <short pause>; sustained delivery such as
whispering belongs in audioProfile.
Set speakers to exactly two { speaker, voice, style? } entries to cast a
dialogue. Only lines that start with one of those two names followed by a colon
begin a turn (Puck: Hello and Puck:Hello both count), and the name is not
spoken. Every other line is spoken as part of
the current turn, including ordinary colon-prefixed prose such as
Budget: 10 dollars and any unconfigured label such as Alice: Hi. Words
before the first label are spoken by that first speaker, not dropped. A
transcript with no configured labels stays on the single-voice path.
Multi-speaker dialogue requires gemini-3.8-flash-tts or
gemini-3.8-flash-lite-tts.
Gemini 3.1 and 2.5 preview TTS still use generateContent. Those models keep
the older behavior: audioProfile is prepended to the transcript, and
expressive tags use square brackets such as [whispers]. An unknown
gemini-3.8-*-tts id is rejected instead of being sent to generateContent.
For lowest-latency spoken conversations, use the Google realtime voice provider backed by the Gemini Live API instead of batch TTS.
To use Google as the default TTS provider:
Gemini API TTS uses natural-language prompting for style control. Set
audioProfile for a reusable delivery style. On Gemini 3.8 that style is
speech_metadata.style and is not read aloud. On Gemini 3.1 and 2.5 preview
models it is still prepended to the spoken text. Set speakerName when the
performance needs a named speaker; 3.8 sends it as the structured
speech_metadata.speaker label, never as style text, and the selected voice
stays the single configured voice.
Gemini 3.1 and 2.5 preview TTS accept expressive square-bracket audio tags in
the text, such as [whispers] or [laughs]. Gemini 3.8 uses angle-bracket
vocal tags such as <laugh> instead. To keep tags out of the visible chat reply
while sending them to TTS, put them inside a [[tts:text]]...[[/tts:text]]
block:
Realtime voice
The bundled google plugin registers a realtime voice provider backed by the
Gemini Live API for backend audio bridges such as Voice Call and Google Meet.
Talk and Discord expose Google's prebuilt voices in their voice catalogs. During
an active Talk or Discord call, use talk_voice to select a new voice. OpenClaw
reconnects with that voice while preserving the conversation and unfinished agent
work; saved voice defaults stay unchanged. See Discord voice changes.
| Setting | Config path | Default |
|---|---|---|
| Model | plugins.entries.voice-call.config.realtime.providers.google.model |
gemini-3.1-flash-live-preview |
| Voice | ...google.voice |
Kore |
| Temperature | ...google.temperature |
(unset) |
| VAD start sensitivity | ...google.startSensitivity |
(unset) |
| VAD end sensitivity | ...google.endSensitivity |
(unset) |
| Silence duration | ...google.silenceDurationMs |
(unset) |
| Activity handling | ...google.activityHandling |
Google default, start-of-activity-interrupts |
| Turn coverage | ...google.turnCoverage |
Google default, audio-activity-and-all-video |
| Disable auto VAD | ...google.automaticActivityDetectionDisabled |
false |
| Session resumption | ...google.sessionResumption |
true |
| Context compression | ...google.contextWindowCompression |
true |
| API key | ...google.apiKey |
Falls back to models.providers.google.apiKey, GEMINI_API_KEY, or GOOGLE_API_KEY |
Example Voice Call realtime config:
For maintainer live verification, run
OPENAI_API_KEY=... GEMINI_API_KEY=... node --import tsx scripts/dev/realtime-talk-live-smoke.ts.
The smoke also covers OpenAI backend/WebRTC paths; the Google leg mints the same
constrained Live API token shape used by Control UI Talk, opens the browser
WebSocket endpoint, sends the initial setup payload plus a JPEG frame, and
verifies a text response and describe_view function roundtrip.
The OpenAI path also performs a synthesized PCM24 speech-to-response audio
roundtrip; pass --openai-audio-cycles 3 for a short repeated lifecycle soak.
Advanced configuration
Gemini Interactions API (stateless)
Gemini text models use the Interactions API by default on the API-key
google provider when the effective base URL is the official Google AI Studio
endpoint. This covers Flash, Flash-Lite, Pro, the default google/gemini-4-argon,
-latest aliases, and forward-compatible Gemini model IDs. Gemma models keep
google-generative-ai (GenerateContent). Custom proxy URLs default to
google-generative-ai, even when the model comes from the catalog rather than
a configured model row. Vertex AI, Gemini CLI, image generation, speech, Live,
embeddings, media understanding, web search, and PDF processing keep their
existing routes.
GenerateContent, music, and video SDK clients explicitly use v1beta unless
a configured base URL already includes an API version. Vertex AI keeps v1;
Live and browser-token routes keep their existing versions.
To force GenerateContent for a Gemini model, for example to keep explicit
cachedContent handles, set its existing api override:
A model-level api overrides the provider-level value; either explicit
setting wins over the endpoint and catalog defaults. To use Interactions on
another Gemini text model, set api: "google-interactions" on that model's
entry. A compatible proxy can also set it provider-wide.
Interactions honors the Google provider's managed request.proxy,
request.tls, and local-service settings. Requests to the official AI Studio
endpoint also use the same Gemini API-key rotation as GenerateContent when
rate limited before streaming starts. Custom endpoints, OAuth credentials,
and explicit authentication headers do not receive additional Gemini keys.
Interactions supports tool calling, thinking levels, image and native video
inputs, and streamed replies. Native video remains available on supported
Gemini models using the official AI Studio endpoint. Inline video uses
base64 data; clipping offsets and frame sampling map to Google's
video processing settings.
This transport is stateless: OpenClaw sends store: false,
does not retain a server-side interaction ID, and replays the needed
conversation context on each request. It relies on implicit caching:
OpenClaw skips explicit cache creation and ignores configured cachedContent
handles on this route, keeping instructions and tools inline. Select
google-generative-ai when you need explicit Gemini cache handles.
Interrupted text replies use the normal transient-error retry and failover policy. Malformed streaming JSON fails the request instead of silently dropping content. Malformed completed tool-call arguments remain rejected.
Direct Gemini cache reuse
For direct Gemini API runs (api: "google-generative-ai"), OpenClaw
passes a configured cachedContent handle through to supported Gemini models.
Gemini 4 Argon supports implicit caching only; do not configure an explicit
cache handle for it.
- Configure per-model or global params with either
cachedContentor legacycached_content - Params from a more specific scope (model-level over global) always win.
Within the same scope, if both keys are set,
cached_contentwins. Use only one key per scope to avoid surprises. - Example value:
cachedContents/prebuilt-context - Gemini cache-hit usage is normalized into OpenClaw
cacheReadfrom upstreamcachedContentTokenCount
Gemini CLI usage notes
The optional google-gemini-cli runtime uses Gemini CLI stream-json
output by default and normalizes usage from the final stats payload.
Legacy --output-format json overrides still use the JSON parser.
- Streamed reply text comes from assistant
messageevents. - For legacy JSON output, reply text comes from the CLI JSON
responsefield. - Usage falls back to
statswhen the CLI leavesusageempty. stats.cachedis normalized into OpenClawcacheRead.- If
stats.inputis missing, OpenClaw derives input tokens fromstats.input_tokens - stats.cached.
Environment and daemon setup
If the Gateway runs as a daemon (launchd/systemd), make sure GEMINI_API_KEY
is available to that process (for example, in ~/.openclaw/.env or via
env.shellEnv).
Related
Choosing providers, model refs, and failover behavior.
Shared image tool parameters and provider selection.
Shared video tool parameters and provider selection.
Shared music tool parameters and provider selection.
Gemini CLI backend setup and runtime details.
Audio bridge that consumes the Gemini Live realtime voice provider.