crabcode

websearch

Configure web search for agents. Crabcode supports two complementary paths:

  1. Local adapters (websearch.provider) — crabcode runs a websearch tool against Exa, Tavily, Brave, Ollama Cloud, etc.
  2. Native tools (websearch.native) — the active LLM provider executes search server-side (web_search, x_search, …). These are normal aisdk tools composed into the tools list.
{
  "websearch": {
    "enabled": true,
    "provider": "exa-hosted-mcp",
    "apiKey": null,
    "endpoint": null,
    "native": {
      "web": false,
      "x": true
    }
  }
}

websearch: false (or "enabled": false) disables both local and native search.

Local vs native

ConcernConfigWho runs it
General web search backendprovider / apiKey / endpointLocal websearch tool (crabcode)
Provider web searchnative.webLLM provider (web_search, Anthropic hosted web, OpenRouter web plugin)
X/Twitter searchnative.xxAI only (x_search)

native.web and the local websearch tool are substitutes: when native.web is on and the active provider supports hosted web search, local websearch is skipped.

native.x is a complement: just to make crabcode as capable as grok-build cli.

// Local Ollama Cloud web search + xAI x_search
{
  "websearch": {
    "provider": "ollama-cloud",
    "apiKey": "{env:OLLAMA_API_KEY}",
    "native": {
      "web": false,
      "x": true
    }
  }
}

Defaults

FieldDefault
enabledtrue when unset
providerexa-hosted-mcp (keyless, rate-limited)
native.webfalse
native.xtrue

Unsupported native flags are ignored (e.g. native.x on OpenAI). If native.web is true but the active provider has no hosted web tool (Ollama, Groq, …), crabcode falls back to the local adapter.

Native tool costs

ProviderToolAPI tool feeSource
OpenAIweb_search$10 / 1k calls + search-content tokensOpenAI
Anthropichosted web search$10 / 1k searches + tokensAnthropic
xAIweb_search$5 / 1k successful calls + tokensxAI
xAIx_search$5 / 1k successful calls + tokensxAI

These fees apply on API-key auth. Models often invoke search multiple times per turn.

Subscription / OAuth logins (ChatGPT, Claude, SuperGrok, …) use the provider’s subscription transport instead — native search is included in plan quota / rate limits, not billed as the API tool fees above.

Local adapters bill (or rate-limit) through their own APIs — exa-hosted-mcp and firecrawl-hosted-mcp are keyless/rate-limited; Exa/Tavily/Brave/Ollama Cloud/etc. use your key.

Default is local websearch + native.x on xAI. Set native.web: true to use provider-hosted web search instead (API tool fees may apply).

Providers (local adapters)

ProviderAuthNotes
exa-hosted-mcpNoneDefault. Hosted MCP bridge; rate-limited
firecrawl-hosted-mcpNone (optional key)Firecrawl hosted MCP bridge; rate-limited without a key
exaEXA_API_KEYDirect Exa API
tavilyTAVILY_API_KEYTavily search API
perplexityPERPLEXITY_API_KEYPerplexity Search API
braveBRAVE_API_KEYBrave Search API
ollama-cloudOLLAMA_API_KEY (required)Ollama Cloud POST /api/web_search — separate HTTP API, not a chat-native tool
serpapiSERPAPI_API_KEYSerpAPI results from Google, DuckDuckGo, etc.
keiroKEIRO_API_KEYKeiro search API
parallelPARALLEL_API_KEYParallel search API
takoTAKO_API_KEYTako search API