Web Search in OpenClaw Requires an API Key: Here Are Your Options
If you've just set up OpenClaw and expected your agent to search the web out of the box, you might be surprised to find it doesn't work without additional configuration. This catches a lot of new users off guard.
The Reality: No Free Built-In Web Search
OpenClaw's web_search tool isn't a "free web search" feature. It's a wrapper that routes your search requests to external providers, and those providers require API keys.
As Krill explained in the Discord:
OpenClaw's built-in
web_searchisn't "free web search" anymore in the sense you need some provider key.
Your Provider Options
Here are the search providers OpenClaw supports and what you need for each:
1. Brave Search API
- Environment variable:
BRAVE_API_KEY - Free tier: Yes (limited requests)
- Sign up: brave.com/search/api
- Best for: General web search, good privacy defaults
2. Gemini Grounding
- Environment variable:
GEMINI_API_KEY - Free tier: Yes (via Google AI Studio)
- Best for: If you're already using Gemini models
3. Perplexity
- Environment variable:
PERPLEXITY_API_KEY - Free tier: No (requires subscription)
- Best for: Research-heavy use cases, detailed answers
4. OpenRouter
- Environment variable:
OPENROUTER_API_KEY - Best for: If you're already routing models through OpenRouter
Setting It Up
Add your chosen API key to your environment. If you're using systemd:
# Edit your service environment
systemctl --user edit openclaw-gateway.service
# Add the key
[Service]
Environment="BRAVE_API_KEY=your-key-here"
# Restart
systemctl --user restart openclaw-gateway.serviceOr in your shell profile (~/.bashrc or ~/.zshrc):
export BRAVE_API_KEY="your-key-here"The Brave Free Tier Is Usually Enough
For most personal use cases, Brave's free tier (around 2,000 queries/month) is plenty. It's the most straightforward option if you don't have strong preferences.
Alternative: MCP Search Servers
If you want to avoid API keys entirely or need specialized search (like searching your own codebase), you can use MCP servers instead. However, don't follow Gemini's advice about openclaw mcp add โ that command doesn't exist in OpenClaw. MCP configuration is done through your config file or built-in integrations like mcporter.
Why Isn't Search Built-In?
Running a search engine is expensive. Every query costs money in infrastructure, and no search provider offers truly free unlimited access. By using external providers, OpenClaw keeps the core lightweight and lets you choose the provider that fits your budget and needs.
Comments (0)
No comments yet. Be the first to comment!