



























@@ -1,107 +1,11 @@
11---
2-summary: "Brave Search API setup for web_search"
3-read_when:
4- - You want to use Brave Search for web_search
5- - You need a BRAVE_API_KEY or plan details
6-title: "Brave search (legacy path)"
2+summary: "Redirect to /tools/brave-search"
3+title: "Brave search"
4+redirect: /tools/brave-search
75---
869-# Brave Search API
10-11-OpenClaw supports Brave Search API as a `web_search` provider.
12-13-## Get an API key
14-15-1. Create a Brave Search API account at [https://brave.com/search/api/](https://brave.com/search/api/)
16-2. In the dashboard, choose the **Search** plan and generate an API key.
17-3. Store the key in config or set `BRAVE_API_KEY` in the Gateway environment.
18-19-## Config example
20-21-```json5
22-{
23- plugins: {
24- entries: {
25- brave: {
26- config: {
27- webSearch: {
28- apiKey: "BRAVE_API_KEY_HERE",
29- mode: "web", // or "llm-context"
30- },
31- },
32- },
33- },
34- },
35- tools: {
36- web: {
37- search: {
38- provider: "brave",
39- maxResults: 5,
40- timeoutSeconds: 30,
41- },
42- },
43- },
44-}
45-```
46-47-Provider-specific Brave search settings now live under `plugins.entries.brave.config.webSearch.*`.
48-Legacy `tools.web.search.apiKey` still loads through the compatibility shim, but it is no longer the canonical config path.
49-50-`webSearch.mode` controls the Brave transport:
51-52-- `web` (default): normal Brave web search with titles, URLs, and snippets
53-- `llm-context`: Brave LLM Context API with pre-extracted text chunks and sources for grounding
54-55-## Tool parameters
56-57-| Parameter | Description |
58-| ------------- | ------------------------------------------------------------------- |
59-| `query` | Search query (required) |
60-| `count` | Number of results to return (1-10, default: 5) |
61-| `country` | 2-letter ISO country code (e.g., "US", "DE") |
62-| `language` | ISO 639-1 language code for search results (e.g., "en", "de", "fr") |
63-| `search_lang` | Brave search-language code (e.g., `en`, `en-gb`, `zh-hans`) |
64-| `ui_lang` | ISO language code for UI elements |
65-| `freshness` | Time filter: `day` (24h), `week`, `month`, or `year` |
66-| `date_after` | Only results published after this date (YYYY-MM-DD) |
67-| `date_before` | Only results published before this date (YYYY-MM-DD) |
68-69-**Examples:**
70-71-```javascript
72-// Country and language-specific search
73-await web_search({
74- query: "renewable energy",
75- country: "DE",
76- language: "de",
77-});
78-79-// Recent results (past week)
80-await web_search({
81- query: "AI news",
82- freshness: "week",
83-});
84-85-// Date range search
86-await web_search({
87- query: "AI developments",
88- date_after: "2024-01-01",
89- date_before: "2024-06-30",
90-});
91-```
92-93-## Notes
94-95-- 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.
96-- 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.
97-- 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).
98-- `llm-context` mode returns grounded source entries instead of the normal web-search snippet shape.
99-- `llm-context` mode does not support `ui_lang`, `freshness`, `date_after`, or `date_before`.
100-- `ui_lang` must include a region subtag like `en-US`.
101-- Results are cached for 15 minutes by default (configurable via `cacheTtlMinutes`).
102-103-See [Web tools](/tools/web) for the full web_search configuration.
7+This page has moved to [Brave Search](/tools/brave-search).
10481059## Related
10610107-- [Brave search](/tools/brave-search)
11+- [Web tools](/tools/web)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。