brave-shim

Set up brave_shim as a free local proxy for OpenClaw web_search, routing Brave API requests to DuckDuckGo. Use when user asks to enable free web search, configure brave_shim, fix missing_brave_api_key errors, or set up no-api-key search.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "brave-shim" with this command: npx skills add weare20202020/brave-shim

brave-shim

Local proxy that makes OpenClaw's Brave Search provider route to DuckDuckGo for free, without any API key.

How it works

  1. A Python FastAPI service (brave_shim) runs locally on http://127.0.0.1:8000
  2. It implements the Brave Search API format but fetches results from DuckDuckGo via ddgs
  3. OpenClaw's built-in Brave provider is redirected to this local service

Setup

1. Install brave_shim

# Clone the repo
git clone https://github.com/asoraruf/brave_shim <clone-path>

# Create venv and install dependencies
python -m venv <clone-path>/venv
# Windows:
<clone-path>\venv\Scripts\activate
pip install fastapi uvicorn ddgs pyyaml
# Linux/Mac:
source <clone-path>/venv/bin/activate
pip install fastapi uvicorn ddgs pyyaml

2. Patch OpenClaw Brave provider URL

The Brave provider in OpenClaw's bundled JS calls https://api.search.brave.com. Replace it with http://127.0.0.1:8000:

import subprocess, re, os

dist_dir = r"<openclaw-dist>"
pattern = r'(const BRAVE_SEARCH_ENDPOINT|const BRAVE_LLM_CONTEXT_ENDPOINT) = "[^"]+"'
replacement = {
    "const BRAVE_SEARCH_ENDPOINT": 'const BRAVE_SEARCH_ENDPOINT = "http://127.0.0.1:8000/res/v1/web/search"',
    "const BRAVE_LLM_CONTEXT_ENDPOINT": 'const BRAVE_LLM_CONTEXT_ENDPOINT = "http://127.0.0.1:8000/res/v1/llm/context"',
}

for fname in os.listdir(dist_dir):
    if fname.startswith("brave-web-search-provider") and fname.endswith(".js"):
        fpath = os.path.join(dist_dir, fname)
        content = open(fpath).read()
        new_content = re.sub(pattern, lambda m: replacement.get(m.group(1), m.group(0)), content)
        open(fpath, "w").write(new_content)

3. Configure OpenClaw

# Enable brave plugin (disabled by default)
openclaw config set plugins.entries.brave.enabled true

# Set Brave as search provider
openclaw config set tools.web.search.provider brave

# Restart gateway
openclaw gateway restart

4. Start shim service

# From brave_shim directory
.\venv\Scripts\python brave_shim.py
# Keep running in background

5. Verify

curl "http://127.0.0.1:8000/res/v1/web/search?q=hello+world"
# Should return JSON with web results

openclaw
# Then test: web_search { query: "test" }

Scripts

  • scripts/setup_brave_shim.py — Automated install: clone, venv, pip install
  • scripts/patch_openclaw.py — Patch OpenClaw dist JS files to redirect Brave API
  • scripts/start_shim.py — Start brave_shim service

Troubleshooting

"fetch failed" after setup:

  • Check shim is running: Invoke-WebRequest http://127.0.0.1:8000/res/v1/web/search?q=test
  • If shim is DOWN: re-run python brave_shim.py
  • If NO_PROXY blocks localhost: remove from env or set NO_PROXY=localhost,127.0.0.1

"missing_brave_api_key" error:

  • plugins.entries.brave needs enabled: true — run openclaw config set plugins.entries.brave.enabled true

"missing_gemini_api_key" instead:

  • Brave plugin still not enabled — check openclaw doctor for disabled plugin warnings

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated