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.
Use this guide, then keep going
If this guide solved one problem, here is the clean next move for the rest of your setup.
Most operators land on one fix first. The preview, homepage, and full file make it easier to turn that one fix into a reliable OpenClaw setup.
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
Is Google Gemini free to use with OpenClaw?
Google AI Studio has a free tier with rate limits. For production OpenClaw usage, you'll want a paid plan — Gemini Flash is very affordable at around $0.075 per 1M input tokens.
Which Gemini model works best with OpenClaw?
Gemini 2.0 Flash is the recommended default — it's fast, affordable, and capable enough for most agent tasks. Use Gemini 1.5 Pro when you need long-context reasoning over large documents.
Can I switch between Gemini and Claude in OpenClaw?
Yes. Update your llm.provider and llm.model config and restart the gateway. You can also configure a fallback provider so OpenClaw switches automatically if one hits rate limits.
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.