solution tools medium macos linux windows
Web search: missing_brave_api_key even though it's configured
If `web_search` fails with `missing_brave_api_key` but you set the key via `openclaw configure --section web`, make sure the running gateway service can see the secret (often via `~/.openclaw/.env`) and restart the gateway.
By CoClaw Team •
Error signatures: missing_brave_api_key
Symptoms
web_searchfails withmissing_brave_api_key.- You already ran
openclaw configure --section weband the config shows anapiKeyfield (often redacted when printed).
Cause
The running gateway process may not be reading the same secrets source you just edited.
Common cases:
- You edited config in an interactive shell, but the gateway is running as a background service with a different environment.
- The Brave key exists in config, but the gateway/tool path is only checking the environment variable in your current version/build.
Fix
1) Put the key in ~/.openclaw/.env and restart the gateway (most reliable)
printf 'BRAVE_API_KEY=%s\n' 'YOUR_BRAVE_KEY' >> ~/.openclaw/.env
openclaw gateway restart
2) Confirm config flags are sane
openclaw config get tools.web.search.enabled
openclaw config get tools.web.search.provider
Notes:
enabledshould not befalse.providershould bebrave(or unset; brave is the default).
Verify
- Run a small search and confirm it returns results (not
missing_brave_api_key). - If it still fails, capture the tool error payload +
openclaw gateway status --json(redact tokens).