OpenClaw (ClawdBot/MoltBot) Configuration Tutorial
About 1 min
OpenClaw (ClawdBot/MoltBot) Configuration Tutorial
What is OpenClaw?
OpenClaw (also known as ClawdBot or MoltBot) is an open-source personal AI assistant that supports multiple messaging platforms including WhatsApp, Telegram, Slack, and Discord.
Prerequisites
Before configuring NiceRouter API, please complete the OpenClaw installation first:
- Visit OpenClaw Official Documentation
- Follow the Getting Started Guide to install OpenClaw
- Run
openclaw onboardto complete the basic configuration
Once OpenClaw is successfully installed, proceed with the following steps to configure NiceRouter API.
Configure NiceRouter API
Edit OpenClaw configuration file ~/.openclaw/openclaw.json to add NiceRouter as a model provider.
Method 1: OpenAI Compatible Format (Recommended)
For GPT series models and other OpenAI-compatible models:
{
"models": {
"providers": {
"nicerouter": {
"baseUrl": "https://api.nicerouter.com/v1",
"apiKey": "your-nicerouter-token",
"api": "openai-completions",
"models": [
{
"id": "gpt-5.2",
"name": "GPT 5.2",
"reasoning": false,
"input": [ "text", "image" ],
"contextWindow": 200000,
"maxTokens": 8192
},{
"id": "gemini-3-pro-preview",
"name": "Gemini 3 Pro Preview",
"reasoning": false,
"input": [ "text", "image" ],
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "nicerouter/gpt-5.2"
}
}
}
}Method 2: Anthropic Claude
For Claude series models:
{
"models": {
"providers": {
"nicerouter": {
"baseUrl": "https://api.nicerouter.com",
"apiKey": "your-nicerouter-token",
"api": "anthropic",
"models": [
{
"id": "claude-3-5-sonnet-20241022",
"name": "Claude 3.5 Sonnet",
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "nicerouter/claude-3-5-sonnet-20241022"
}
}
}
}Configuration Parameters
| Parameter | Description |
|---|---|
baseUrl | NiceRouter API address • OpenAI format: https://api.nicerouter.com/v1• Anthropic format: https://api.nicerouter.com• Enterprise: https://ee.nicerouter.com or https://ee.nicerouter.com/v1 |
apiKey | Your NiceRouter Token (create in console) |
api | API type: openai-completions or anthropic-messagesRecommended: openai-completions - NiceRouter supports model conversion, allowing you to use OpenAI format for both Gemini and Claude models |
models[].id | Model ID, e.g., gpt-5.2, claude-3-5-sonnet-20241022, gemini-2.5-pro |
agents.defaults.model.primary | Default model to use, format: provider-name/model-id |
Complete Configuration Example
{
"models": {
"providers": {
"nicerouter": {
"baseUrl": "https://api.nicerouter.com/v1",
"apiKey": "sk-xxxxxxxxxxxxxxxx",
"api": "openai-completions",
"models": [
{
"reasoning": true,
"input": [ "text", "image" ],
"id": "gpt-5.2",
"name": "GPT 5.2",
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "nicerouter/gpt-5.2"
}
}
},
"channels": {
"telegram": {
"enabled": true,
"botToken": "your-telegram-bot-token"
}
},
"gateway": {
"port": 18789
}
}Test Configuration
After configuration, start OpenClaw and test:
# Start gateway
openclaw gateway
# Test chat
openclaw agent --message "Hello"