Skip to content

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:

bash
npm i -g @anthropic-ai/claude-code

Step 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):

json
{
  "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:

bash
claude

Once 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
bash <(curl -sL https://bit.ly/4rFbCZY)

The script will guide you through:

  1. Entering your API Key
  2. Selecting a model (claude-sonnet-4-6 recommended for speed; claude-opus-4-6 for more capability)
  3. Confirming and writing the configuration
  4. 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:

bash
openclaw

If 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-ai

Manual 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

json
"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

json
"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

json
"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:

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

ProviderModelAliasContext Window
Claudeclaude-opus-4-6opus200K
Claudeclaude-sonnet-4-6sonnet200K
Claudeclaude-haiku-4-5haiku200K
OpenAIgpt-5.4gpt54128K
OpenAIgpt-5.3gpt53128K
OpenAIgpt-5.2gpt52128K
Geminigemini-3.1-pro-previewgemini311M
Geminigemini-3-pro-previewgemini31M
Geminigemini-3-flash-previewflash1M

Switch Models

Use aliases to quickly switch models in OpenClaw:

bash
/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 Pro

Troubleshooting

  • Verify openclaw.json is valid JSON (use a JSON validator)
  • Make sure the token has been replaced (don't leave the your-token placeholder)
  • Restart OpenClaw for configuration changes to take effect
  • Visit the bsf.ai Console to manage tokens