Connect Gemini to OpenClaw
OpenClaw Setup supports two practical Gemini paths today:
Google Gemini API for straightforward hosted setup, and
Google Gemini CLI login for OpenClaw's subscription-style
google-gemini-cli provider.
Which option should you choose?
- Choose Google Gemini API if you want the fastest path and already have or can create an AI Studio API key.
- Choose Google Gemini CLI if you specifically want the OpenClaw
google-gemini-cliprovider and you are comfortable doing a local auth step first. - Choose Vertex AI instead if your team needs a more enterprise-style Google Cloud setup with service-account based control.
Option 1: Google Gemini API key
This is still the recommended path for most hosted users because it is the least ambiguous and easiest to rotate.
- Open Google AI Studio API keys.
- Sign in with the Google account you want to bill or rate-limit under.
- Create an API key.
- In OpenClaw Setup, choose Google Gemini API.
- Paste the key into the setup wizard or dashboard provider form.
If you only want Gemini models and do not care about Gemini CLI specifically, stop here. This is the smoothest hosted experience.
Option 2: Google Gemini CLI login
Google's official Gemini CLI supports Login with Google. Current Google docs describe multiple supported auth routes, including Gemini Code Assist / Google account flows and API-key auth. Current OpenClaw source also supports a dedicated google-gemini-cli provider.
In this hosted product, Gemini CLI is supported through OpenClaw's
google-gemini-cli provider, but the dashboard currently expects a
manual credential handoff rather than running the full browser OAuth flow in-app.
What you need
- A local Gemini CLI install, for example
brew install gemini-cliornpm install -g @google/gemini-cli. - A successful local Gemini CLI login.
- A credential payload for hosted OpenClaw in this format:
{"token":"...","projectId":"..."}.
Where to find the local credentials on your machine
Gemini CLI commonly stores its raw OAuth credentials in these user-level paths:
- macOS / Linux:
~/.gemini/oauth_creds.json - Windows:
%USERPROFILE%\.gemini\oauth_creds.json
If your local Gemini CLI setup depends on a Google Cloud project, check
~/.gemini/.env on macOS/Linux, or the equivalent
.gemini\.env file under your Windows user profile, as well as your shell environment, for values such as GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID.
Important: oauth_creds.json is the raw local Gemini CLI file. It is not the exact JSON payload this hosted dashboard asks you to paste. For hosted OpenClaw here, you still want the shaped payload {"token":"...","projectId":"..."}.
How to use it in OpenClaw Setup
- Complete your local Gemini CLI authentication first.
- In OpenClaw Setup, choose Google Gemini CLI / Google Gemini (Subscription).
- Paste credential JSON in the format
{"token":"...","projectId":"..."}. - Pick a
google-gemini-cli/...default model in the dashboard.
Important limitation
This dashboard does not currently open the Gemini CLI browser auth flow for you. If you do not already have a usable Gemini CLI credential payload, use the Google Gemini API key path instead.
When a Google Cloud project is required
Gemini CLI can depend on Google's Code Assist flow under the hood. In practice that means some accounts may require a Google Cloud project to be available. If the auth flow or later requests fail, be prepared to set or supply a project through GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID on the OpenClaw side.
If you want to avoid that complexity, use the standard Gemini API key route instead.
What should you paste into the dashboard?
For Google Gemini API, paste your normal AI Studio API key.
For Google Gemini CLI, paste JSON shaped like
{"token":"...","projectId":"..."}. Do not paste a Gemini API key into the Gemini CLI field, and do not paste an arbitrary browser redirect URL there.
Quick answers
Is Gemini CLI officially documented by Google?
Yes, Gemini CLI itself is officially documented by Google. What is still custom here is the hosted handoff into this dashboard.
Does OpenClaw really support Gemini CLI as a separate provider?
Yes. Current OpenClaw source and docs expose a dedicated google-gemini-cli provider alongside the normal google API-key provider.
What if I already selected Gemini CLI in the wizard but only have an API key?
Go back and choose Google Gemini API instead. That is the correct option for API-key auth.
Ready to launch?
Once you have the right Gemini credential, finish setup in the dashboard.