OpenClaw is a powerful AI development tool. By configuring bsf.ai, you can access Claude, GPT, and Gemini models for a superior AI coding experience.
Prerequisites
1. Register a bsf.ai Account
- Visit https://bsf.ai to register
- Select Token Management from the left menu
- Click Add Token to create a new token
Quick Installation
Step 1: Install Claude Code
Install via npm
Make sure you have Node.js (>= 18) installed, then run in your terminal:
npm i -g @anthropic-ai/claude-codeStep 2: Configure Claude Code
Set API Key and Base URL
Edit the Claude Code config file at ~/.claude/settings.json (Mac/Linux) or C:\Users\YourUsername\.claude\settings.json (Windows):
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "Replace with your API Key",
"ANTHROPIC_BASE_URL": "https://api.bsf.ai",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1
},
"permissions": {
"allow": [],
"deny": []
}
}NOTE
After configuration, type claude in the terminal to verify the connection works.
Step 3: Install OpenClaw via Claude Code
Launch Claude Code and Install
Run in your terminal:
claudeOnce inside the Claude Code interactive interface, ask it to install OpenClaw. Claude Code will automatically handle dependencies and the installation process.
Step 4: One-Click bsf.ai Configuration
Run the Setup Script
After OpenClaw is installed, run the following command in your terminal to configure bsf.ai as the API provider:
bash <(curl -sL https://bit.ly/4rFbCZY)The script will guide you through:
- Entering your API Key
- Selecting a model (
claude-sonnet-4-6recommended for speed;claude-opus-4-6for more capability) - Confirming and writing the configuration
- Automatically restarting the OpenClaw Gateway
NOTE
The script requires the jq command-line tool. If not installed:
- macOS:
brew install jq - Ubuntu/Debian:
sudo apt install jq
Step 5: Launch OpenClaw
Run OpenClaw
After configuration, launch it directly in your terminal:
openclawIf you see the bsf.ai activated message, the setup is complete.
Quick Configuration (Existing OpenClaw)
NOTE
Prerequisite: OpenClaw is already running with another model and can execute tasks automatically.
Use the following prompt to let the AI assistant configure it for you:
My bsf.ai token:
Your token (replace with your actual token)
Based on the following configuration, update the openclaw.json config file
https://bsf.ai/config/openclaw-bsf-aiManual Configuration
Edit the OpenClaw config file ~/.openclaw/openclaw.json, find the models section, and replace it with the following content.
If there is no models section, add the following code inside the outermost { }.
WARNING
Replace your-token in the configurations below with the token you created on the bsf.ai platform.
Claude Models
"bsf-ai-claude": {
"baseUrl": "https://api.bsf.ai",
"apiKey": "your-token",
"auth": "token",
"api": "anthropic-messages",
"authHeader": true,
"models": [
{
"id": "claude-opus-4-6",
"name": "claude-opus-4-6",
"api": "anthropic-messages",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 200000,
"maxTokens": 8192
},
{
"id": "claude-sonnet-4-6",
"name": "claude-sonnet",
"api": "anthropic-messages",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 200000,
"maxTokens": 8192
},
{
"id": "claude-haiku-4-5",
"name": "claude-haiku",
"api": "anthropic-messages",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 200000,
"maxTokens": 8192
}
]
}OpenAI Models
"bsf-ai-openai": {
"baseUrl": "https://api.bsf.ai/v1",
"apiKey": "your-token",
"auth": "token",
"api": "openai-responses",
"authHeader": true,
"models": [
{
"id": "gpt-5.4",
"name": "gpt-5.4",
"api": "openai-responses",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000,
"maxTokens": 16384
},
{
"id": "gpt-5.3",
"name": "gpt-5.3",
"api": "openai-responses",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000,
"maxTokens": 16384
},
{
"id": "gpt-5.2",
"name": "gpt-5.2",
"api": "openai-responses",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000,
"maxTokens": 16384
}
]
}Gemini Models
"bsf-ai-gemini": {
"baseUrl": "https://api.bsf.ai/v1beta",
"apiKey": "your-token",
"auth": "token",
"api": "google-generative-ai",
"authHeader": true,
"models": [
{
"id": "gemini-3.1-pro-preview",
"name": "Gemini 3.1 Pro Preview",
"api": "google-generative-ai",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 1000000,
"maxTokens": 8192
},
{
"id": "gemini-3-pro-preview",
"name": "Gemini 3 Pro Preview",
"api": "google-generative-ai",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 1000000,
"maxTokens": 8192
},
{
"id": "gemini-3-flash-preview",
"name": "Gemini 3 Flash Preview",
"api": "google-generative-ai",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 1000000,
"maxTokens": 8192
}
]
}Configure Default Agent Model
Add the following to the agents section of openclaw.json:
"agents": {
"defaults": {
"model": {
"primary": "bsf-ai-claude/claude-sonnet-4-6"
},
"fallbacks": [
"bsf-ai-claude/claude-opus-4-6",
"bsf-ai-openai/gpt-5.4",
"bsf-ai-gemini/gemini-3.1-pro-preview"
],
"models": {
"bsf-ai-claude/claude-opus-4-6": { "alias": "opus" },
"bsf-ai-claude/claude-sonnet-4-6": { "alias": "sonnet" },
"bsf-ai-claude/claude-haiku-4-5": { "alias": "haiku" },
"bsf-ai-openai/gpt-5.4": { "alias": "gpt54" },
"bsf-ai-openai/gpt-5.3": { "alias": "gpt53" },
"bsf-ai-openai/gpt-5.2": { "alias": "gpt52" },
"bsf-ai-gemini/gemini-3.1-pro-preview": { "alias": "gemini31" },
"bsf-ai-gemini/gemini-3-pro-preview": { "alias": "gemini3" },
"bsf-ai-gemini/gemini-3-flash-preview": { "alias": "flash" }
}
}
}Supported Models
| Provider | Model | Alias | Context Window |
|---|---|---|---|
| Claude | claude-opus-4-6 | opus | 200K |
| Claude | claude-sonnet-4-6 | sonnet | 200K |
| Claude | claude-haiku-4-5 | haiku | 200K |
| OpenAI | gpt-5.4 | gpt54 | 128K |
| OpenAI | gpt-5.3 | gpt53 | 128K |
| OpenAI | gpt-5.2 | gpt52 | 128K |
| Gemini | gemini-3.1-pro-preview | gemini31 | 1M |
| Gemini | gemini-3-pro-preview | gemini3 | 1M |
| Gemini | gemini-3-flash-preview | flash | 1M |
Switch Models
Use aliases to quickly switch models in OpenClaw:
/model opus # Claude Opus 4.6
/model sonnet # Claude Sonnet 4.6
/model haiku # Claude Haiku 4.5
/model gpt54 # GPT-5.4
/model gemini31 # Gemini 3.1 ProTroubleshooting
- Verify
openclaw.jsonis valid JSON (use a JSON validator) - Make sure the token has been replaced (don't leave the
your-tokenplaceholder) - Restart OpenClaw for configuration changes to take effect
- Visit the bsf.ai Console to manage tokens