One-Click Script Tutorial
Quick Start
Before running this script, please ensure:
- Node.js 24 is recommended, and Node.js 22.14+ is also supported
- OpenClaw is installed and initialized
- It is recommended to run
openclaw onboard --install-daemonfirst - Your network connection is working properly, and the B.AI API is accessible
Script Commands
Linux & macOS:
Mac users: open Terminal from Applications, then run the command below:
curl -LsSf https://chat.b.ai/scripts/openclaw-install-bai-provider.sh | bash
Windows PowerShell:
Windows users: open PowerShell from the Start menu, then run the command below (CMD is not supported):
iwr -useb https://chat.b.ai/scripts/openclaw-install-bai-provider.ps1 | iex
Note: The current official one-click scripts are published through B.AI Chat.
Detailed Steps
1. Create an API Key
- Log in to the B.AI Platform
- Go to the API Key Management Page
- Create a new API Key
2. Run the Installation Script
Depending on your operating system, run the corresponding command above.
The script will automatically:
- Check your environment, including Node.js and OpenClaw
- Prompt you to enter your B.AI API Key
- Write the
baiprovider configuration into your OpenClaw config - Set a default model
- Attempt to restart the local Gateway service if it is already installed
3. Select a Default Model
After validating the API Key, the script will fetch the list of available models and prompt you to choose a default model.
Note: Some Gemini-series models may not work reliably in OpenClaw because certain function-calling scenarios are more strict about client fingerprinting. Please choose carefully.
4. Complete Configuration
After you finish model selection, the script will automatically:
- Back up your original configuration file
- Update your OpenClaw configuration
- Try to restart the related local service
Important: A successful script run does not always mean the Gateway service is already installed and running. After the script finishes, verify it explicitly:
openclaw gateway statusIf the CLI says the service is not installed, run:
openclaw gateway install
openclaw gateway restart
5. Switch Models
You can switch the model you use in two ways:
Option 1: Command Line
openclaw models set bai/<model_name>
You can also manually edit the ~/.openclaw/openclaw.json configuration file.
Option 2: Web UI - Dashboard
Open the following address in your browser:
This is the default OpenClaw Dashboard address.
Then:
- Click Agent in the left navigation menu
- Find the Primary model dropdown
- Select the model you want to use
Note: After changing the model in the Dashboard, command-line model switching may no longer work as expected, because the Dashboard may automatically add a
listfield to the configuration file.
Compatibility Testing
| Operating System | Status |
|---|---|
| Ubuntu 24.04 | ✅ Passed |
| Windows 11 | ✅ Passed |
| macOS | ✅ Passed |
FAQ
Q: What should I do if the script fails to run?
A: Please make sure that:
- Node.js 22.14+ is installed
- OpenClaw is installed
- You have already completed initialization, ideally with
openclaw onboard --install-daemon - Your network connection is working properly
- The B.AI API endpoint is reachable
- You are using the current official script URLs from B.AI Chat
- After the script finishes, you have confirmed the Gateway state with
openclaw gateway status
Q: How do I switch models?
A: See Step 5: Switch Models above.
Q: What if I have not installed OpenClaw yet?
A: Please install OpenClaw first, then run:
openclaw onboard --install-daemon
After onboarding is complete, come back and run the B.AI provider installation script.
Q: Where can I find the OpenClaw Dashboard?
A: By default, the Dashboard is available at:
Q: Can I edit the configuration manually instead of using the script?
A: Yes. You can manually edit:
~/.openclaw/openclaw.json
and add the bai provider configuration yourself.