Google (Gemini)
Google provides the Gemini model family for text, vision, and reasoning. OpenClaw supports two authentication paths: aGEMINI_API_KEY for direct API access, and the Google Gemini CLI OAuth flow for users who prefer browser-based sign-in.
Requirements
- A Gemini API key from aistudio.google.com, or
- A Google account with access to Gemini (for OAuth via
google-gemini-cli)
Quickstart
API key
Google Gemini CLI OAuth
Configuration
Environment variable
GEMINI_API_KEY automatically and enables the google provider.
Config snippet
Provider settings
Available models
Thegoogle provider includes all current Gemini models. Key models:
Use model IDs as
google/<model-id> (example: google/gemini-2.5-pro).
Vertex AI
For enterprise Vertex AI access, use thegoogle-vertex provider. Authentication resolves in this order:
GOOGLE_CLOUD_API_KEY— explicit Vertex API key.- Application Default Credentials (ADC), configured with
gcloud:
gcloud ADC file, or GOOGLE_APPLICATION_CREDENTIALS pointing at a service account key file), GOOGLE_CLOUD_PROJECT (or GCLOUD_PROJECT), and GOOGLE_CLOUD_LOCATION. Without the project or location, requests fail with Vertex AI requires a project ID / Vertex AI requires a location.
google-vertex also honors the Gemini key pool for key-rotated workloads: GEMINI_API_KEYS (comma-separated), GEMINI_API_KEY, GEMINI_API_KEY_<n>, and GOOGLE_API_KEY (fallback).
The base URL is https://{location}-aiplatform.googleapis.com and uses the google-vertex API backend.
google-vertex config snippet
google-vertex models mirror most google models: gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-3-pro-preview, gemini-3-flash-preview, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-1.5-pro, gemini-1.5-flash, gemini-1.5-flash-8b, gemini-3.1-pro-preview.
Troubleshooting
401 Unauthorized / API key not valid- Verify your API key starts with
AIzaand is copied in full. - Re-run onboarding:
openclaw onboard --auth-choice gemini-api-key. - Ensure the Generative Language API is enabled in your Google Cloud project.
- Re-run
openclaw onboard --auth-choice google-gemini-clito refresh the OAuth token.
- Use
openclaw models listto see available model IDs. - OpenClaw normalizes some model IDs:
gemini-3-pro→gemini-3-pro-preview,gemini-3-flash→gemini-3-flash-preview.
- Run
gcloud auth application-default loginto authenticate, or setGOOGLE_APPLICATION_CREDENTIALSto a service account key file. - ADC also requires
GOOGLE_CLOUD_PROJECT(orGCLOUD_PROJECT) andGOOGLE_CLOUD_LOCATION; missing either fails credential resolution. - To skip ADC, set
GOOGLE_CLOUD_API_KEYwith an explicit Vertex API key.