2026-01-18 01:42:40 +00:00
---
summary: "Brave Search API setup for web_search"
read_when:
- You want to use Brave Search for web_search
- You need a BRAVE_API_KEY or plan details
2026-01-31 16:04:03 -05:00
title: "Brave Search"
2026-01-18 01:42:40 +00:00
---
# Brave Search API
2026-03-08 14:10:26 +00:00
OpenClaw supports Brave Search API as a `web_search` provider.
2026-01-18 01:42:40 +00:00
## Get an API key
2026-02-06 10:08:59 -05:00
1. Create a Brave Search API account at [https://brave.com/search/api/ ](https://brave.com/search/api/ )
2026-03-08 19:06:21 +01:00
2. In the dashboard, choose the **Search** plan and generate an API key.
2026-03-08 14:10:26 +00:00
3. Store the key in config or set `BRAVE_API_KEY` in the Gateway environment.
2026-01-18 01:42:40 +00:00
## Config example
```json5
{
2026-03-17 23:59:17 -05:00
plugins: {
entries: {
brave: {
config: {
webSearch: {
apiKey: "BRAVE_API_KEY_HERE",
},
},
},
},
},
2026-01-18 01:42:40 +00:00
tools: {
web: {
search: {
provider: "brave",
maxResults: 5,
2026-01-31 21:13:13 +09:00
timeoutSeconds: 30,
},
},
},
2026-01-18 01:42:40 +00:00
}
```
2026-03-17 23:59:17 -05:00
Provider-specific Brave search settings now live under `plugins.entries.brave.config.webSearch.*` .
Legacy `tools.web.search.apiKey` still loads through the compatibility shim, but it is no longer the canonical config path.
2026-03-04 04:57:19 +00:00
## Tool parameters
| Parameter | Description |
| ------------- | ------------------------------------------------------------------- |
| `query` | Search query (required) |
| `count` | Number of results to return (1-10, default: 5) |
| `country` | 2-letter ISO country code (e.g., "US", "DE") |
| `language` | ISO 639-1 language code for search results (e.g., "en", "de", "fr") |
| `ui_lang` | ISO language code for UI elements |
| `freshness` | Time filter: `day` (24h), `week` , `month` , or `year` |
| `date_after` | Only results published after this date (YYYY-MM-DD) |
| `date_before` | Only results published before this date (YYYY-MM-DD) |
**Examples:**
```javascript
// Country and language-specific search
await web_search({
query: "renewable energy",
country: "DE",
language: "de",
});
// Recent results (past week)
await web_search({
query: "AI news",
freshness: "week",
});
// Date range search
await web_search({
query: "AI developments",
date_after: "2024-01-01",
date_before: "2024-06-30",
});
```
2026-01-18 01:42:40 +00:00
## Notes
2026-03-08 19:06:21 +01:00
- OpenClaw uses the Brave **Search** plan. If you have a legacy subscription (e.g. the original Free plan with 2,000 queries/month), it remains valid but does not include newer features like LLM Context or higher rate limits.
2026-03-13 18:37:39 +00:00
- Each Brave plan includes ** \$5/month in free credit** (renewing). The Search plan costs \$5 per 1,000 requests, so the credit covers 1,000 queries/month. Set your usage limit in the Brave dashboard to avoid unexpected charges. See the [Brave API portal ](https://brave.com/search/api/ ) for current plans.
2026-03-08 19:06:21 +01:00
- The Search plan includes the LLM Context endpoint and AI inference rights. Storing results to train or tune models requires a plan with explicit storage rights. See the Brave [Terms of Service ](https://api-dashboard.search.brave.com/terms-of-service ).
2026-03-04 04:57:19 +00:00
- Results are cached for 15 minutes by default (configurable via `cacheTtlMinutes` ).
2026-01-18 01:42:40 +00:00
See [Web tools ](/tools/web ) for the full web_search configuration.