Connecting OpenClaw to BotHub
This guide describes how to configure OpenClaw to use models via BotHub (bothub.chat) — an AI model aggregator with an OpenAI-compatible API. You can use GPT, Claude, Gemini, DeepSeek and other models without VPN.
Contents
- What is BotHub
- Prerequisites
- Step 1 — Get a BotHub API key
- Step 2 — Install OpenClaw
- Step 3 — Configuration
- Step 4 — Apply configuration
- Example configs for popular models
- Available BotHub models
- Environment variables
- Verify connection
- Switching between models
- Troubleshooting
- Full example configuration
What is BotHub
BotHub is an AI model aggregator that provides access to GPT-5.x, Claude Opus/Sonnet, Gemini, DeepSeek, Grok and other models through a single OpenAI-compatible API without VPN.
| Parameter | Value |
|---|---|
| Base URL | https://openai.bothub.chat/v1 |
| API type | OpenAI-compatible (openai-completions) |
| Billing | Caps (no monthly subscriptions, don’t expire) |
| Free tier | 30,000 Caps on signup |
OpenClaw uses the api: "openai-completions" field for any OpenAI-compatible provider, which fits BotHub.
Prerequisites
- Node.js ≥ 22 (check:
node --version) - OpenClaw installed (
npm install -g openclaw@latestorpnpm add -g openclaw@latest) - Account on bothub.chat
- A generated BotHub API key
Step 1 — Get a BotHub API key
- Sign up or log in at bothub.chat.
- Open the For developers section of your profile:
https://bothub.chat/profile/for-developers - Click Add key and generate a new API key.
- Copy and save the key — you will need it for the OpenClaw configuration.
The key is a long string of characters (no prefix).
Step 2 — Install OpenClaw
If OpenClaw is not installed yet:
# Via npm
npm install -g openclaw@latest
# Or via pnpm
pnpm add -g openclaw@latest
# Then run the initial setup wizard
openclaw onboard --install-daemon
Step 3 — Configuration
OpenClaw config file:
~/.openclaw/openclaw.json
Option A: Edit openclaw.json manually
Open the config file and add BotHub as a custom provider.
Minimal config (one model)
{
"agent": {
"model": "bothub/claude-sonnet-4-6"
},
"models": {
"mode": "merge",
"providers": {
"bothub": {
"baseUrl": "https://openai.bothub.chat/v1",
"apiKey": "YOUR_BOTHUB_KEY",
"api": "openai-completions",
"models": [
{
"id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6 (BotHub)",
"contextWindow": 200000,
"maxTokens": 8192,
"reasoning": false,
"input": ["text", "image"]
}
]
}
}
}
}
Instead of storing the key in the config file, use an environment variable (see Environment variables).
Using an environment variable for the key (recommended)
{
"models": {
"mode": "merge",
"providers": {
"bothub": {
"baseUrl": "https://openai.bothub.chat/v1",
"apiKey": "${BOTHUB_API_KEY}",
"api": "openai-completions",
"models": [
{
"id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6 (BotHub)",
"contextWindow": 200000,
"maxTokens": 8192,
"reasoning": false,
"input": ["text", "image"]
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "bothub/claude-sonnet-4-6"
}
}
}
}
Set the environment variable:
# In .env or ~/.openclaw/.env
BOTHUB_API_KEY=YOUR_BOTHUB_KEY
# Or export directly
export BOTHUB_API_KEY=YOUR_BOTHUB_KEY
Option B: Automatic setup via chat
If OpenClaw is already running, paste this prompt into the chat:
Add BotHub as a custom provider to my OpenClaw config. Use these details:
- Provider name: bothub
- Base URL: https://openai.bothub.chat/v1
- API key: [PASTE_YOUR_BOTHUB_KEY_HERE]
- API type: openai-completions
Add these models:
1. claude-sonnet-4-6 (context: 200000, max tokens: 8192)
2. gpt-5.2 (context: 400000, max tokens: 128000)
3. gpt-5.4 (context: 1050000, max tokens: 128000)
Set bothub/claude-sonnet-4-6 as the primary model. Apply the config when done.
OpenClaw will update the config and restart the Gateway.
Step 4 — Apply configuration
After editing openclaw.json manually:
# Apply config from file
openclaw gateway config.apply --file ~/.openclaw/openclaw.json
# Or restart the Gateway
openclaw gateway restart
# Verify config
openclaw doctor
Example configs for popular models
Claude Sonnet 4.6
{
"id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6 via BotHub",
"contextWindow": 200000,
"maxTokens": 8192,
"reasoning": false,
"input": ["text", "image"]
}
GPT-5.2
{
"id": "gpt-5.2",
"name": "GPT-5.2 via BotHub",
"contextWindow": 400000,
"maxTokens": 128000,
"reasoning": false,
"input": ["text", "image"]
}
GPT-5.4
{
"id": "gpt-5.4",
"name": "GPT-5.4 via BotHub",
"contextWindow": 1050000,
"maxTokens": 128000,
"reasoning": false,
"input": ["text", "image"]
}
DeepSeek (via BotHub)
{
"id": "deepseek-chat",
"name": "DeepSeek Chat via BotHub",
"contextWindow": 128000,
"maxTokens": 8192,
"reasoning": false,
"input": ["text"]
}
Available BotHub models
Current model list: https://bothub.chat/models
Popular models for use in OpenClaw:
| Model ID (for config) | Description | Context |
|---|---|---|
claude-sonnet-4-6 | Claude Sonnet 4.6 (Anthropic) | 200K |
gpt-5.2 | GPT-5.2 (OpenAI) | 400K |
gpt-5.4 | GPT-5.4 (OpenAI) | 1,050K |
gpt-5 | GPT-5 (OpenAI) | 400K |
gpt-4.1 | GPT-4.1 (OpenAI) | 1,047K |
o3 | OpenAI o3 (reasoning) | 128K |
deepseek-chat | DeepSeek Chat | 128K |
gemini-1.5-pro | Gemini 1.5 Pro (Google) | 1,000K |
Check exact model IDs on bothub.chat/models or in the BotHub API.
Environment variables
To store keys securely, create a .env file in the OpenClaw directory:
# ~/.openclaw/.env or /opt/openclaw.env
BOTHUB_API_KEY=YOUR_BOTHUB_KEY
Then point the config to .env or export the variable:
export BOTHUB_API_KEY=YOUR_BOTHUB_KEY
Verify connection
# List all configured models
openclaw models list
# Filter by BotHub provider
openclaw models list --provider bothub
# Check current model status
openclaw models status
# Probe all providers
openclaw models status --probe
# Diagnostics
openclaw doctor
Switching between models
In chat:
/model bothub/gpt-5.2
/model bothub/claude-sonnet-4-6
/model bothub/deepseek-chat
Via CLI:
openclaw models set bothub/gpt-5.2
Troubleshooting
Model 'bothub/model-name' is not allowed
The model is not in the allowed list. Add it under agents.defaults.models:
{
"agents": {
"defaults": {
"models": {
"bothub/gpt-5.2": { "alias": "GPT-5.2" },
"bothub/claude-sonnet-4-6": { "alias": "Claude-BotHub" }
}
}
}
}
401 Unauthorized / Invalid API key
- Ensure the
BOTHUB_API_KEYenvironment variable is set correctly. - Confirm the key was generated in the For developers section on the BotHub site.
- Check your BotHub account Caps balance.
Connection refused / ECONNREFUSED
- Check your internet connection.
- Verify
baseUrlis correct:https://openai.bothub.chat/v1
Unknown provider / Provider not found
The provider name in models.providers must match the name in the model string (bothub/model-id):
{
"providers": {
"bothub": {}
}
}
In agents use bothub/gpt-5.2 — names must match.
JSON syntax errors
Ask OpenClaw to fix the config in chat:
Fix the JSON syntax errors in my openclaw config.
Or run:
openclaw doctor
Full example configuration
Below is a full ~/.openclaw/openclaw.json example with several BotHub models and a fallback chain:
{
"agents": {
"defaults": {
"model": {
"primary": "bothub/claude-sonnet-4-6",
"fallbacks": ["bothub/gpt-5.2", "bothub/deepseek-chat"]
},
"models": {
"bothub/claude-sonnet-4-6": { "alias": "Claude" },
"bothub/gpt-5.2": { "alias": "GPT-5.2" },
"bothub/gpt-5.4": { "alias": "GPT-5.4" },
"bothub/deepseek-chat": { "alias": "DeepSeek" }
}
}
},
"models": {
"mode": "merge",
"providers": {
"bothub": {
"baseUrl": "https://openai.bothub.chat/v1",
"apiKey": "${BOTHUB_API_KEY}",
"api": "openai-completions",
"models": [
{
"id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6",
"contextWindow": 200000,
"maxTokens": 8192,
"reasoning": false,
"input": ["text", "image"],
"cost": {
"input": 3.0,
"output": 15.0,
"cacheRead": 0,
"cacheWrite": 0
}
},
{
"id": "gpt-5.2",
"name": "GPT-5.2",
"contextWindow": 400000,
"maxTokens": 128000,
"reasoning": false,
"input": ["text", "image"],
"cost": {
"input": 1.97,
"output": 15.75,
"cacheRead": 0,
"cacheWrite": 0
}
},
{
"id": "gpt-5.4",
"name": "GPT-5.4",
"contextWindow": 1050000,
"maxTokens": 128000,
"reasoning": false,
"input": ["text", "image"],
"cost": {
"input": 2.81,
"output": 16.88,
"cacheRead": 0,
"cacheWrite": 0
}
},
{
"id": "deepseek-chat",
"name": "DeepSeek Chat",
"contextWindow": 128000,
"maxTokens": 8192,
"reasoning": false,
"input": ["text"],
"cost": {
"input": 0.14,
"output": 0.28,
"cacheRead": 0,
"cacheWrite": 0
}
}
]
}
}
}
}
Additional resources
| Resource | Description |
|---|---|
| OpenClaw Docs | OpenClaw models documentation |
| BotHub API Docs | BotHub API documentation |
| BotHub Models | Current models and pricing |
| BotHub For developers | API key management |
| OpenClaw GitHub | OpenClaw source code |
| OpenClaw Discord | Community support |
| BotHub Telegram | BotHub community |
Documentation is current for OpenClaw 2026.3.x and BotHub API v2. March 2026.