Skip to content

Web search

The web_search tool searches the web using your configured provider and returns results. Results are cached by query for 15 minutes (configurable).

OpenClaw also includes x_search for X (formerly Twitter) posts and web_fetch for lightweight URL fetching. In this phase, web_fetch stays local while web_search and x_search can use xAI Responses under the hood.

  1. Choose a provider

    Pick a provider and complete any required setup. Some providers are key-free, while others use API keys. See the provider pages below for details.

  2. Configure

    Terminal window
    openclaw configure --section web

    This stores the provider and any needed credential. You can also set an env var (for example BRAVE_API_KEY) and skip this step for API-backed providers.

  3. Use it

    The agent can now call web_search:

    await web_search({ query: "OpenClaw plugin SDK" });

    For X posts, use:

    await x_search({ query: "dinner recipes" });
Brave Search

Structured results with snippets. Supports llm-context mode, country/language filters. Free tier available.

Codex Hosted Search

AI-synthesized grounded answers through your Codex app-server account.

DuckDuckGo

Key-free provider. No API key needed. Unofficial HTML-based integration.

Exa

Neural + keyword search with content extraction (highlights, text, summaries).

Firecrawl

Structured results. Best paired with firecrawl_search and firecrawl_scrape for deep extraction.

Gemini

AI-synthesized answers with citations via Google Search grounding.

Grok

AI-synthesized answers with citations via xAI web grounding.

Kimi

AI-synthesized answers with citations via Moonshot web search; ungrounded chat fallbacks fail explicitly.

MiniMax Search

Structured results via the MiniMax Token Plan search API.

Ollama Web Search

Search via a signed-in local Ollama host or the hosted Ollama API.

Parallel

Paid Parallel Search API (PARALLEL_API_KEY); higher rate limits and objective tuning.

Parallel Search (Free)

Key-free opt-in. Parallel’s free Search MCP, with LLM-optimized dense excerpts and no API key.

Perplexity

Structured results with content extraction controls and domain filtering.

SearXNG

Self-hosted meta-search. No API key needed. Aggregates Google, Bing, DuckDuckGo, and more.

Tavily

Structured results with search depth, topic filtering, and tavily_extract for URL extraction.

ProviderResult styleFiltersAPI key
BraveStructured snippetsCountry, language, time, llm-context modeBRAVE_API_KEY
Codex Hosted SearchAI-synthesized + source URLsDomains, context size, user locationNone; uses Codex/OpenAI sign-in
DuckDuckGoStructured snippetsNone (key-free)
ExaStructured + extractedNeural/keyword mode, date, content extractionEXA_API_KEY
FirecrawlStructured snippetsVia firecrawl_search toolFIRECRAWL_API_KEY
GeminiAI-synthesized + citationsGEMINI_API_KEY
GrokAI-synthesized + citationsxAI OAuth, XAI_API_KEY, or plugins.entries.xai.config.webSearch.apiKey
KimiAI-synthesized + citations; fails on ungrounded chat fallbacksKIMI_API_KEY / MOONSHOT_API_KEY
MiniMax SearchStructured snippetsRegion (global / cn)MINIMAX_CODE_PLAN_KEY / MINIMAX_CODING_API_KEY / MINIMAX_OAUTH_TOKEN
Ollama Web SearchStructured snippetsNone for signed-in local hosts; OLLAMA_API_KEY for direct https://ollama.com search
ParallelDense excerpts ranked for LLM contextPARALLEL_API_KEY (paid)
Parallel Search (Free)Dense excerpts ranked for LLM contextNone (free Search MCP)
PerplexityStructured snippetsCountry, language, time, domains, content limitsPERPLEXITY_API_KEY / OPENROUTER_API_KEY
SearXNGStructured snippetsCategories, languageNone (self-hosted)
TavilyStructured snippetsVia tavily_search toolTAVILY_API_KEY

Direct OpenAI Responses models use OpenAI’s hosted web_search tool automatically when OpenClaw web search is enabled and no managed provider is pinned. This is provider-owned behavior in the bundled OpenAI plugin and only applies to native OpenAI API traffic, not OpenAI-compatible proxy base URLs or Azure routes. Set tools.web.search.provider to another provider such as brave to keep the managed web_search tool for OpenAI models, or set tools.web.search.enabled: false to disable both managed search and native OpenAI search.

The Codex app-server runtime uses Codex’s hosted web_search tool automatically when web search is enabled and no managed provider is selected. Native hosted search and OpenClaw’s managed web_search dynamic tool are mutually exclusive, so managed search cannot bypass native domain restrictions. OpenClaw uses the managed tool when hosted search is unavailable, explicitly disabled, or replaced by a selected managed provider. OpenClaw keeps Codex’s standalone web.run extension disabled because production app-server traffic rejects its user-defined web namespace.

  • Configure native search under tools.web.search.openaiCodex
  • Set tools.web.search.provider: "codex" to provision Codex Hosted Search as the managed web_search provider for any parent model. Each call runs a bounded ephemeral Codex app-server turn and fails if Codex does not emit a hosted webSearch item.
  • mode: "cached" is the default preference, but Codex resolves it to live external access for unrestricted app-server turns; set "live" to request live access explicitly
  • Set tools.web.search.provider to a managed provider such as brave to use OpenClaw’s managed web_search instead
  • Set tools.web.search.openaiCodex.enabled: false to opt out of Codex-hosted search; other managed providers remain available
  • Restricting the Codex native tool surface also keeps managed web_search available
  • When allowedDomains is set, automatic managed fallback fails closed if hosted search is unavailable so the native allowlist cannot be bypassed
  • Tool-disabled LLM-only runs disable both native and managed search
  • tools.web.search.enabled: false disables both managed and native search

Persistent effective Codex search-policy changes start a fresh bound thread so an already loaded app-server thread cannot keep stale hosted-search access. Transient per-turn restrictions use a temporary restricted thread and preserve the existing binding for later resume.

Direct OpenAI ChatGPT Responses traffic can also use OpenAI’s hosted web_search tool. That separate path remains opt-in through tools.web.search.openaiCodex.enabled: true and only applies to eligible openai/* models using api: "openai-chatgpt-responses".

{
tools: {
web: {
search: {
enabled: true,
// Optional: use Codex Hosted Search from non-Codex parent models too.
provider: "codex",
openaiCodex: {
enabled: true,
mode: "cached",
allowedDomains: ["example.com"],
contextSize: "high",
userLocation: {
country: "US",
city: "New York",
timezone: "America/New_York",
},
},
},
},
},
}

For runtimes and providers that do not support native Codex search, Codex can use the managed web_search fallback through OpenClaw’s dynamic tool namespace. Use an explicit managed provider when you need OpenClaw’s provider-specific network controls instead of Codex-hosted search.

Selecting provider: "codex" enables the bundled codex plugin and uses the same tools.web.search.openaiCodex restrictions shown above. Authenticate the Codex app-server first with openclaw models auth login --provider openai. The parent agent can use any model or runtime; only the bounded search worker runs through Codex.

Managed HTTP web_search provider calls use OpenClaw’s guarded fetch path. For trusted provider API hosts, OpenClaw allows Surge, Clash, and sing-box fake-IP DNS answers in 198.18.0.0/15 and fc00::/7 only for that provider hostname. Other private, loopback, link-local, and metadata destinations remain blocked. Codex Hosted Search is the exception: its bounded worker delegates network access to Codex app-server’s hosted web_search tool.

This automatic allowance does not apply to arbitrary web_fetch URLs. For web_fetch, enable tools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRange and tools.web.fetch.ssrfPolicy.allowIpv6UniqueLocalRange explicitly only when your trusted proxy owns those synthetic ranges.

Provider lists in docs and setup flows are alphabetical. Auto-detection keeps a separate precedence order.

If no provider is set, OpenClaw checks providers in this order and uses the first one that is ready:

API-backed providers first:

  1. BraveBRAVE_API_KEY or plugins.entries.brave.config.webSearch.apiKey (order 10)
  2. MiniMax SearchMINIMAX_CODE_PLAN_KEY / MINIMAX_CODING_API_KEY / MINIMAX_OAUTH_TOKEN / MINIMAX_API_KEY or plugins.entries.minimax.config.webSearch.apiKey (order 15)
  3. Geminiplugins.entries.google.config.webSearch.apiKey, GEMINI_API_KEY, or models.providers.google.apiKey (order 20)
  4. Grok — xAI OAuth, XAI_API_KEY, or plugins.entries.xai.config.webSearch.apiKey (order 30)
  5. KimiKIMI_API_KEY / MOONSHOT_API_KEY or plugins.entries.moonshot.config.webSearch.apiKey (order 40)
  6. PerplexityPERPLEXITY_API_KEY / OPENROUTER_API_KEY or plugins.entries.perplexity.config.webSearch.apiKey (order 50)
  7. FirecrawlFIRECRAWL_API_KEY or plugins.entries.firecrawl.config.webSearch.apiKey (order 60)
  8. ExaEXA_API_KEY or plugins.entries.exa.config.webSearch.apiKey; optional plugins.entries.exa.config.webSearch.baseUrl overrides the Exa endpoint (order 65)
  9. TavilyTAVILY_API_KEY or plugins.entries.tavily.config.webSearch.apiKey (order 70)
  10. Parallel — paid Parallel Search API via PARALLEL_API_KEY or plugins.entries.parallel.config.webSearch.apiKey; optional plugins.entries.parallel.config.webSearch.baseUrl overrides the endpoint (order 75)

Configured endpoint providers after that:

  1. SearXNGSEARXNG_BASE_URL or plugins.entries.searxng.config.webSearch.baseUrl (order 200)

Key-free providers such as Parallel Search (Free), DuckDuckGo, Ollama Web Search, and Codex Hosted Search are available only when you select them explicitly with tools.web.search.provider or through openclaw configure --section web. OpenClaw does not send managed web_search queries to a key-free provider just because no API-backed provider is configured.

OpenAI Responses models are an exception: while tools.web.search.provider is unset, they use OpenAI’s native web search instead of the managed providers above. Set tools.web.search.provider to parallel-free (or another provider) to route them through the managed path.

{
tools: {
web: {
search: {
enabled: true, // default: true
provider: "brave", // or omit for auto-detection
maxResults: 5,
timeoutSeconds: 30,
cacheTtlMinutes: 15,
},
},
},
}

Provider-specific config (API keys, base URLs, modes) lives under plugins.entries.<plugin>.config.webSearch.*. Gemini can also reuse models.providers.google.apiKey and models.providers.google.baseUrl as lower-priority fallbacks after its dedicated web-search config and GEMINI_API_KEY. See the provider pages for examples. Grok can also reuse an xAI OAuth auth profile from openclaw models auth login --provider xai --method oauth; API-key config remains the fallback.

tools.web.search.provider is validated against the web-search provider ids declared by bundled and installed plugin manifests. A typo such as "brvae" fails config validation instead of silently falling back to auto-detection. If a configured provider only has stale plugin evidence, such as a leftover plugins.entries.<plugin> block after uninstalling a third-party plugin, OpenClaw keeps startup resilient and reports a warning so you can reinstall the plugin or run openclaw doctor --fix to clean up the stale config.

web_fetch fallback provider selection is separate:

  • choose it with tools.web.fetch.provider
  • or omit that field and let OpenClaw auto-detect the first ready web-fetch provider from configured credentials
  • non-sandboxed web_fetch can use installed plugin providers that declare contracts.webFetchProviders; sandboxed fetches allow bundled providers and verified official plugin installs, but exclude third-party external plugins
  • the official Firecrawl plugin provides web-fetch fallback, configured under plugins.entries.firecrawl.config.webFetch.*

When you choose Kimi during openclaw onboard or openclaw configure --section web, OpenClaw can also ask for:

  • the Moonshot API region (https://api.moonshot.ai/v1 or https://api.moonshot.cn/v1)
  • the default Kimi web-search model (defaults to kimi-k2.6)

For x_search, configure plugins.entries.xai.config.xSearch.*. It uses the same xAI auth profile as chat, or the XAI_API_KEY / plugin web-search credential used by Grok web search. Legacy tools.web.x_search.* config is auto-migrated by openclaw doctor --fix. When you choose Grok during openclaw onboard or openclaw configure --section web, OpenClaw can also offer optional x_search setup with the same credential. This is a separate follow-up step inside the Grok path, not a separate top-level web-search provider choice. If you pick another provider, OpenClaw does not show the x_search prompt.

Run openclaw configure --section web or set the key directly:

{
plugins: {
entries: {
brave: {
config: {
webSearch: {
apiKey: "YOUR_KEY", // pragma: allowlist secret
},
},
},
},
},
}
ParameterDescription
querySearch query (required)
countResults to return (1-10, default: 5)
country2-letter ISO country code (e.g. “US”, “DE”)
languageISO 639-1 language code (e.g. “en”, “de”)
search_langSearch-language code (Brave only)
freshnessTime filter: day, week, month, or year
date_afterResults after this date (YYYY-MM-DD)
date_beforeResults before this date (YYYY-MM-DD)
ui_langUI language code (Brave only)
domain_filterDomain allowlist/denylist array (Perplexity only)
max_tokensTotal content budget, default 25000 (Perplexity only)
max_tokens_per_pagePer-page token limit, default 2048 (Perplexity only)

x_search queries X (formerly Twitter) posts using xAI and returns AI-synthesized answers with citations. It accepts natural-language queries and optional structured filters. OpenClaw only enables the built-in xAI x_search tool on the request that serves this tool call.

{
plugins: {
entries: {
xai: {
config: {
xSearch: {
enabled: true,
model: "grok-4-1-fast-non-reasoning",
baseUrl: "https://api.x.ai/v1", // optional, overrides webSearch.baseUrl
inlineCitations: false,
maxTurns: 2,
timeoutSeconds: 30,
cacheTtlMinutes: 15,
},
webSearch: {
apiKey: "xai-...", // optional if an xAI auth profile or XAI_API_KEY is set
baseUrl: "https://api.x.ai/v1", // optional shared xAI Responses base URL
},
},
},
},
},
}

x_search posts to <baseUrl>/responses when plugins.entries.xai.config.xSearch.baseUrl is set. If that field is omitted, it falls back to plugins.entries.xai.config.webSearch.baseUrl, then the legacy tools.web.search.grok.baseUrl, and finally the public xAI endpoint.

ParameterDescription
querySearch query (required)
allowed_x_handlesRestrict results to specific X handles
excluded_x_handlesExclude specific X handles
from_dateOnly include posts on or after this date (YYYY-MM-DD)
to_dateOnly include posts on or before this date (YYYY-MM-DD)
enable_image_understandingLet xAI inspect images attached to matching posts
enable_video_understandingLet xAI inspect videos attached to matching posts
await x_search({
query: "dinner recipes",
allowed_x_handles: ["nytfood"],
from_date: "2026-03-01",
});
// Per-post stats: use the exact status URL or status ID when possible
await x_search({
query: "https://x.com/huntharo/status/1905678901234567890",
});
// Basic search
await web_search({ query: "OpenClaw plugin SDK" });
// German-specific search
await web_search({ query: "TV online schauen", country: "DE", language: "de" });
// Recent results (past week)
await web_search({ query: "AI developments", freshness: "week" });
// Date range
await web_search({
query: "climate research",
date_after: "2024-01-01",
date_before: "2024-06-30",
});
// Domain filtering (Perplexity only)
await web_search({
query: "product reviews",
domain_filter: ["-reddit.com", "-pinterest.com"],
});

If you use tool profiles or allowlists, add web_search, x_search, or group:web:

{
tools: {
allow: ["web_search", "x_search"],
// or: allow: ["group:web"] (includes web_search, x_search, and web_fetch)
},
}