Gemini Web Search API Fix | Generated by AI
Session Summary
Goal
Fix the web_search tool in OpenClaw which was failing due to a missing GEMINI_API_KEY.
What Was Found
- OpenClaw config at
~/.openclaw/openclaw.json - Web search was configured with
provider: "gemini"but no API key in the search section - A Google API key was already present under
models.providers.google
What Was Done
-
Backup created —
~/.openclaw/openclaw.json.bak.20260408_041208 - Initial edit — Added
apiKeytotools.web.search:"search": { "enabled": true, "provider": "gemini", "apiKey": "***" } - Config schema error detected — On restart, openclaw rejected the config:
tools.web.search provider-owned config moved to plugins.entries.<plugin>.config.webSearch - Auto-migration via
openclaw doctor --fix— This:- Moved the API key to the correct location:
plugins.entries.brave.config.webSearch.apiKey - Enabled the
braveplugin (which handles Gemini web search) - Archived 24 orphan session transcript files
- Updated schema fields (
cacheRead,cacheWritecost fields,apifield on models) - Restarted the systemd service automatically
- Saved a fresh backup at
~/.openclaw/openclaw.json.bak
- Moved the API key to the correct location:
- Gateway confirmed running — PID 402575 via systemd
Final Config State (relevant section)
"plugins": {
"entries": {
"brave": {
"enabled": true,
"config": {
"webSearch": {
"apiKey": "***"
}
}
}
}
}
Warnings Noted by Doctor (non-blocking)
- Telegram, Signal, and Slack
groupPolicyis"allowlist"butgroupAllowFromis empty — group messages will be silently dropped unless IDs are added or policy changed to"open"