How to use the Brave Search API with OpenClaw
This guide explains how to equip OpenClaw with better exposure to the Brave Search API, giving agents access to crucial context and enhanced Web search capabilities.
Readers’ note: If you plan to try OpenClaw, for security reasons you should run it on a dedicated machine or VM that has restricted access to sensitive data. Don’t share your API key publicly; monitor for unauthorized use; and, if you discover your key has been leaked by OpenClaw, revoke its access via the Brave Search API dashboard.
Step 1: Set up your Brave Search API key
- Register for (or log in to) a Brave Search API account.
- Once you’re logged in, navigate to the My subscriptions tab in the dashboard, and ensure you’re subscribed to the Search plan.
- If you’re not subscribed to the Search plan, visit the Available plans tab to change plans.
- Also note that each plan includes $5 in free credits, every single month. If you have a small-scale project you can set a usage limit in your account dashboard after you subscribe. This can help ensure your usage remains free as long as you need it to.
- Go to the API keys section and create a new API key.
- Note your API key for later use, and save your key in a safe place.
Step 2: Install and configure OpenClaw
OpenClaw offers several installation methods depending on your environment and needs. For most users, the recommended option is the official installer, which detects your platform, installs Node.js if needed, installs OpenClaw, and launches onboarding automatically.
macOS, Linux, and WSL2:
curl -fsSL https://openclaw.ai/install.sh | bashWindows (PowerShell):
iwr -useb https://openclaw.ai/install.ps1 | iexOpenClaw currently recommends Node 24, though Node 22.16+ is also supported.
If you prefer to manage Node.js yourself, you can also install OpenClaw via npm or pnpm. For development or maximum control, you can build from source (requires pnpm). Containerized deployment via Docker (the route chosen when authoring/testing this walkthrough), Podman, or Nix is also available and may be a better fit if you want stronger isolation or are deploying to a server or cloud environment. For the full set of installation options and platform-specific details, see the OpenClaw install documentation.
Once installed, verify your setup before proceeding:
openclaw --version
openclaw doctorIf you installed OpenClaw without onboarding, or if you need to set up the long-running gateway service manually, run:
openclaw onboard --install-daemonThis installs the gateway daemon as a user service so it stays running in the background.
Step 3: Retrieve and set up the Brave Search CLI
The Brave Search skill leverages the new Brave Search CLI utility (referenced as bx once installed). You can manually locate your preferred binary/executable via the releases page on github. Download the CLI file, rename it to bx (or bx.exe on Windows) and store it in an easily retrievable place. You’ll soon need to expose this file’s location to OpenClaw.
Alternatively, the bx CLI utility can be installed with the help of an installer script. You can configure the download path for the utility via the BX_INSTALL_DIR environment variable, though this is not required.
macOS, Linux, and WSL2:
curl -fsSL https://raw.githubusercontent.com/brave/brave-search-cli/main/scripts/install.sh | shWindows (PowerShell):
powershell -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/brave/brave-search-cli/main/scripts/install.ps1 | iex"The output from these installer scripts will contain the location of the bx utility. For example:
bx v1.3.0 installed to /home/node/.local/bin/bxYou can either cd to that directory now, or use it when invoking bx in the next step.
Set your API Key
Now that the CLI utility is on the system, you can access it directly to configure your Brave Search API key (also configurable via the BRAVE_SEARCH_API_KEY environment variable):
bx config set-key BSAv...WSxsWith this key set, you can test the utility by querying for the OpenClaw logo:
bx images "openclaw logo" --count 1The JSON response indicates the utility is working as expected.
Step 4: Finish set up for OpenClaw
Configure OpenClaw’s access to the CLI
In order for OpenClaw to have access to the bx utility, you’ll need to add its path to the openclaw.json configuration file (if needed, run openclaw config file to locate your config file). For example, if bx were downloaded to /home/node/.local/bin, you would run the following command:
openclaw config set tools.exec.pathPrepend '["/home/node/.local/bin"]'If you have already configured a path in this manner before, you may wish to manually add the new path by directly modifying the openclaw.json configuration file:
{
"tools": {
"exec": {
"pathPrepend": ["/home/node/.local/bin", "/previous/path"]
}
}
}Because you’re making changes to a central part of OpenClaw’s configuration, you’ll need to restart the gateway for these changes to take effect. If you’re running OpenClaw in a docker container, restart the container. If you’re running it on the host machine, simply run the restart command:
openclaw gateway restartInstalling the Skill via ClawHub
With the bx utility now installed and accessible, you can proceed to install the Skill itself, which teaches OpenClaw how to use the bx utility to its full potential. To install the Skill from ClawHub, use the openclaw skills install command in your terminal:
openclaw skills install bx-searchStep 5: Use Brave Search in your assistant
Once configured, OpenClaw will be instructed to prefer the bx utility for web-search requests. There are a few ways you can leverage this utility via the OpenClaw agent:
- Asking natural language questions that require Web search
- Sending a message with “search” or “find” followed by your query
- Messages that start with
/skill bx-searchare explicit skill requests (e.g./skill bx-search "current formula 1 standings")
Your agent may at times attempt to use its built-in web_search tool over the Skill. You can ask that your agent prefer this new Skill in the future, and/or you can prepend your query with /skill bx-search to be more explicit.
Advanced configuration
The bx utility supports an optional --config argument, enabling you or your agent to use a custom configuration file with each request. This file can specify its own API key and timeout threshold. You can also use a custom API Key via the --api-key command line argument, but be careful with this parameter as it may leave your plain-text key in shell history.
The bx utility supports a top-level --help flag (i.e. bx --help) to understand endpoints. This flag can also be used with specific endpoints (e.g. bx web --help) to understand more granular, endpoint-specific search parameters.
Troubleshooting
If you’re encountering issues, try one (or more) of the following fixes:
- Make sure the location of bx is known to you and your agent
- Ensure your API key is correct and has sufficient query limits
- Verify that the Brave Search API is accessible from your network
- Check that your OpenClaw instance has Internet connectivity
- Review the logs for any error messages related to API calls
Security considerations
Note: By publishing this guide Brave is not (and cannot) make any claims about the security of OpenClaw. If you choose to use OpenClaw, proceed carefully. In addition to the security recommendations that appear at the top of this guide, visit Brave’s X thread for a non-exhaustive list of other precautions you should take.
You should also set usage limits for the Brave Search API to ensure your usage does not exceed your expected monthly budget.
Support and updates
For the latest information and updates about using the Brave Search API with OpenClaw:

