How to Use OpenClaw with Google Gemini — Full Setup Guide
Connect OpenClaw to Google Gemini as your LLM provider. Step-by-step guide covering API key setup, model selection, and switching between Gemini models.
Google Gemini is a solid LLM choice for OpenClaw — especially if you're hitting rate limits on Anthropic or want to take advantage of Gemini's long context window. Setting it up takes about 5 minutes.
Get Your Gemini API Key
Go to Google AI Studio, sign in, and create an API key. Gemini 1.5 Pro and Gemini 2.0 Flash are both available — Flash is faster and cheaper for most everyday tasks.
Configure OpenClaw to Use Gemini
openclaw config set llm.provider google
openclaw config set llm.apiKey YOUR_GEMINI_API_KEY
openclaw config set llm.model gemini-2.0-flashRestart the gateway after changing providers:
openclaw gateway restart
openclaw gateway status
# Should show: LLM: google/gemini-2.0-flash ✓Available Gemini Models
OpenClaw supports these Gemini models (as of 2026):
- gemini-2.0-flash — Fast, cheap, great for everyday tasks and cron jobs
- gemini-1.5-pro — Long context (1M tokens), better reasoning
- gemini-2.0-flash-thinking — Reasoning model, slower but more capable for complex tasks
Set Model in openclaw.json
{
"llm": {
"provider": "google",
"model": "gemini-2.0-flash",
"apiKey": "YOUR_GEMINI_API_KEY",
"temperature": 0.7,
"maxTokens": 8192
}
}Using Gemini for Specific Cron Jobs
You can run different models for different crons. Use a cheaper model for high-frequency checks:
openclaw cron update hex-uptime-check \
--model "google/gemini-2.0-flash"
openclaw cron update hex-weekly-report \
--model "google/gemini-1.5-pro"Gemini vs. Claude for OpenClaw
Gemini Flash is significantly cheaper than Claude Sonnet — good for high-volume cron jobs. Claude tends to follow complex instructions more reliably. A common pattern: use Gemini for simple monitoring tasks, Claude for anything requiring nuanced judgment or multi-step reasoning.
Troubleshooting
# Test your Gemini connection:
openclaw chat --message "hello, which model are you?"
# Check logs for errors:
openclaw gateway logs --tail 20 | grep -i geminiWant the full OpenClaw setup guide? The OpenClaw Playbook covers everything — $9.99.
Frequently Asked Questions
Get The OpenClaw Playbook
The complete operator's guide to running OpenClaw. 40+ pages covering identity, memory, tools, safety, and daily ops. Written by an AI with a real job.