Google (Gemini) Provider
기준일: 2026-07-26
난이도: 중급
공식 기준: Google (Gemini)
개요
이 페이지는 OpenClaw Google (Gemini) provider의 인증, 모델 ref, 온보딩 플래그, 설정 키를 공식 문서 기준으로 정리합니다.
공식 요약: Google Gemini setup (API key + OAuth, image generation, media understanding, TTS, web search)
model ref는 보통 provider/model 형식입니다. API key·endpoint·model id는 아래 원문 값을 그대로 쓰세요. 임의로 키나 엔드포인트를 만들지 마세요.
빠른 참조
| 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 |
공식 문서 기반 상세
아래는 공식 providers/google 문서를 Mintlify 컴포넌트만 정리하고 공통 제목을 한국어로 맞춘 내용입니다. 설정 키, env, model ref, CLI 플래그는 원문 그대로 유지합니다.
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
- Runtime option:
agentRuntime.id: "google-gemini-cli"reuses Gemini CLI OAuth while keeping model refs canonical asgoogle/*.
시작하기
Choose your preferred auth method and follow the setup steps.
**Best for:** standard Gemini API access through Google AI Studio.
Get an API key
Create a free key in [Google AI Studio](https://aistudio.google.com/apikey).
Run onboarding
```bash
openclaw onboard --auth-choice gemini-api-key
```
Or pass the key directly:
```bash
openclaw onboard --non-interactive \
--mode local \
--auth-choice gemini-api-key \
--gemini-api-key "$GEMINI_API_KEY"
```
Set a default model
```json5
{
agents: {
defaults: {
model: { primary: "google/gemini-3.1-pro-preview" },
},
},
}
```
Verify the model is available
```bash
openclaw models list --provider google
```
GEMINI_API_KEYandGOOGLE_API_KEYare both accepted. Use whichever you already have configured.
With a configured API key, OpenClaw refreshes Google AI Studio's text-model
catalog from the Gemini `models.list` API. Newly released Gemini 3 Pro, Flash,
and Flash-Lite variants therefore appear in
`openclaw models list --provider google` without waiting for an OpenClaw
release. If discovery is unavailable, OpenClaw keeps the bundled fallback
catalog.
**Best for:** signing in with your Google account through Gemini CLI OAuth instead of using a separate API key.
The
google-gemini-cliprovider is an unofficial integration. Some users report account restrictions when using OAuth this way. Use at your own risk.
Install the Gemini CLI
The local `gemini` command must be available on `PATH`.
```bash
# Homebrew
brew install gemini-cli
# or npm
npm install -g @google/gemini-cli
```
OpenClaw supports both Homebrew installs and global npm installs, including
common Windows/npm layouts.
Log in via OAuth
```bash
openclaw models auth login --provider google-gemini-cli --set-default
```
Verify the model is available
```bash
openclaw models list --provider google
```
- Default model: `google/gemini-3.1-pro-preview`
- Runtime: `google-gemini-cli`
- Alias: `gemini-cli`
Gemini 3.1 Pro's Gemini API model id is `gemini-3.1-pro-preview`. OpenClaw accepts the shorter `google/gemini-3.1-pro` as a convenience alias and normalizes it before provider calls.
**Environment variables:**
- `OPENCLAW_GEMINI_OAUTH_CLIENT_ID` / `GEMINI_CLI_OAUTH_CLIENT_ID`
- `OPENCLAW_GEMINI_OAUTH_CLIENT_SECRET` / `GEMINI_CLI_OAUTH_CLIENT_SECRET`
If Gemini CLI OAuth requests fail after login, set
GOOGLE_CLOUD_PROJECTorGOOGLE_CLOUD_PROJECT_IDon the gateway host and retry.
If login fails before the browser flow starts, make sure the local
geminicommand is installed and onPATH.
Onboarding auto-detection lists an existing Gemini CLI login but never
auto-tests it because Gemini CLI has no tool-free probe. Choose Gemini CLI
OAuth or a Gemini API key to continue.
`google-gemini-cli/*` model refs are legacy compatibility aliases. New
configs should use `google/*` model refs plus the `google-gemini-cli`
runtime when they want local Gemini CLI execution.
google/gemini-3-pro-previewwas retired on 2026-03-09; usegoogle/gemini-3.1-pro-previewinstead. Re-running Gemini API key setup (openclaw onboard --auth-choice gemini-api-keyoropenclaw models auth login --provider google) rewrites a stale configured default to the current model.
기능
| 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 |
웹 검색
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:
{
plugins: {
entries: {
google: {
config: {
webSearch: {
apiKey: "AIza...", // optional if GEMINI_API_KEY or models.providers.google.apiKey is set
baseUrl: "https://generativelanguage.googleapis.com/v1beta", // falls back to models.providers.google.baseUrl
model: "gemini-2.5-flash",
},
},
},
},
},
}
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.
Gemini 3 models use
thinkingLevelrather thanthinkingBudget. OpenClaw maps Gemini 3, Gemini 3.1, andgemini-*-latestalias reasoning controls tothinkingLevelso default/low-latency runs do not send disabledthinkingBudgetvalues.
/think adaptivekeeps Google's dynamic thinking semantics instead of choosing a fixed OpenClaw level. Gemini 3 and Gemini 3.1 omit a fixedthinkingLevelso Google can choose the level; Gemini 2.5 sends Google's dynamic sentinelthinkingBudget: -1.Gemma 4 models (for example
gemma-4-26b-a4b-it) support thinking mode. OpenClaw rewritesthinkingBudgetto a supported GooglethinkingLevelfor Gemma 4. Setting thinking tooffpreserves thinking disabled instead of mapping toMINIMAL.Gemini 2.5 Pro only works in thinking mode and rejects an explicit
thinkingBudget: 0; OpenClaw strips that value for Gemini 2.5 Pro requests instead of sending it.
이미지 생성
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:
{
agents: {
defaults: {
imageGenerationModel: {
primary: "google/gemini-3.1-flash-image",
},
},
},
}
See Image Generation for shared tool parameters, provider selection, and failover behavior.
비디오 생성
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:
{
agents: {
defaults: {
videoGenerationModel: {
primary: "google/veo-3.1-fast-generate-preview",
},
},
},
}
See Video Generation for shared tool parameters, provider selection, and failover behavior.
음악 생성
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:
{
agents: {
defaults: {
musicGenerationModel: {
primary: "google/lyria-3-clip-preview",
},
},
},
}
See Music Generation for shared tool parameters, provider selection, and failover behavior.
Text-to-speech
The bundled google speech provider uses the Gemini API TTS path with
gemini-3.1-flash-tts-preview.
- 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
Google's batch Gemini TTS path returns generated audio in the completed
generateContent response. 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:
{
tts: {
auto: "always",
provider: "google",
providers: {
google: {
model: "gemini-3.1-flash-tts-preview",
speakerVoice: "Kore",
audioProfile: "Speak professionally with a calm tone.",
},
},
},
}
Gemini API TTS uses natural-language prompting for style control. Set
audioProfile to prepend a reusable style prompt before the spoken text. Set
speakerName when your prompt text refers to a named speaker.
Gemini API TTS also accepts expressive square-bracket audio tags in the text,
such as [whispers] or [laughs]. To keep tags out of the visible chat reply
while sending them to TTS, put them inside a [[tts:text]]...[[/tts:text]]
block:
Here is the clean reply text.
[[tts:text]][whispers] Here is the spoken version.[[/tts:text]]
A Google Cloud Console API key restricted to the Gemini API is valid for this provider. This is not the separate Cloud Text-to-Speech API path.
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.
| 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:
{
plugins: {
entries: {
"voice-call": {
enabled: true,
config: {
realtime: {
enabled: true,
provider: "google",
providers: {
google: {
model: "gemini-3.1-flash-live-preview",
speakerVoice: "Kore",
activityHandling: "start-of-activity-interrupts",
turnCoverage: "audio-activity-and-all-video",
},
},
},
},
},
},
},
}
Google Live API uses bidirectional audio and function calling over a WebSocket. OpenClaw adapts telephony/Meet bridge audio to Gemini's PCM Live API stream and keeps tool calls on the shared realtime voice contract. Leave
temperatureunset unless you need sampling changes; OpenClaw omits non-positive values because Google Live can return transcripts without audio fortemperature: 0. Gemini API transcription is enabled withoutlanguageCodes; the current Google SDK rejects language-code hints on this API path.
Gemini 3.1 Live accepts conversational text through realtime input and uses sequential function calling. OpenClaw omits the older
NON_BLOCKING, function response scheduling, and affective-dialog fields for this model. PreferthinkingLevel; configured positivethinkingBudgetvalues are mapped to the nearest supported level, while-1leaves Google's default in place. See the Gemini Live capability comparison.
Control UI Talk supports Google Live browser sessions with constrained one-use tokens. In Video Talk, the browser sends bounded JPEG frames directly to Google Live at the provider's maximum of one frame per second. The
describe_viewfunction reports whether that camera stream is active. Camera frames do not pass through the Gateway. Backend-only realtime voice providers can also run through the generic Gateway relay transport, which keeps provider credentials on the Gateway.
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.
고급 설정
Direct Gemini cache reuse
For direct Gemini API runs (`api: "google-generative-ai"`), OpenClaw
passes a configured `cachedContent` handle through to Gemini requests.
- Configure per-model or global params with either
`cachedContent` or legacy `cached_content`
- Params from a more specific scope (model-level over global) always win.
Within the same scope, if both keys are set, `cached_content` wins.
Use only one key per scope to avoid surprises.
- Example value: `cachedContents/prebuilt-context`
- Gemini cache-hit usage is normalized into OpenClaw `cacheRead` from
upstream `cachedContentTokenCount`
```json5
{
agents: {
defaults: {
models: {
"google/gemini-2.5-pro": {
params: {
cachedContent: "cachedContents/prebuilt-context",
},
},
},
},
},
}
```
Gemini CLI usage notes
When using the `google-gemini-cli` OAuth provider, OpenClaw 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 `message` events.
- For legacy JSON output, reply text comes from the CLI JSON `response` field.
- Usage falls back to `stats` when the CLI leaves `usage` empty.
- `stats.cached` is normalized into OpenClaw `cacheRead`.
- If `stats.input` is missing, OpenClaw derives input tokens from
`stats.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`).
관련 문서
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.
검증 체크리스트
-
openclaw models list --provider google로 모델이 보이는지 확인 - 기본 model alias를
agents.defaults.model.primary에 설정했는지 확인 - API key / OAuth / 로컬 런타임 인증 경로를 공식 문서와 대조했는지 확인
- failover 시 데이터가 다른 provider로 이동할 수 있는지 검토