Guide to configuring Nanobot for your deployment needs.
Nanobot stores configuration in:
~/.nanobot/config.json
This file is created automatically when you run nanobot onboard.
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-your-key"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5",
"provider": "openrouter"
}
},
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
},
"tools": {
"restrictToWorkspace": false,
"exec": {
"pathAppend": ""
},
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
}
}
}
}
Configure LLM providers and API keys:
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-your-openrouter-key"
},
"anthropic": {
"apiKey": "sk-ant-your-key"
},
"openai": {
"apiKey": "sk-your-key"
},
"deepseek": {
"apiKey": "your-key"
},
"groq": {
"apiKey": "gsk-your-key"
},
"gemini": {
"apiKey": "your-key"
}
}
}
Supported Providers:
| Provider | Config Key | API Key Format | Get Key At |
|---|---|---|---|
| OpenRouter | openrouter |
sk-or-v1-xxx |
https://openrouter.ai |
| Anthropic | anthropic |
sk-ant-xxx |
https://console.anthropic.com |
| OpenAI | openai |
sk-xxx |
https://platform.openai.com |
| Azure OpenAI | azure |
API key + endpoint | https://azure.microsoft.com |
| DeepSeek | deepseek |
API key | https://platform.deepseek.com |
| Groq | groq |
gsk_xxx |
https://console.groq.com |
| Google Gemini | gemini |
API key | https://aistudio.google.com |
| MiniMax | minimax |
API key | https://platform.minimaxi.com |
| SiliconFlow | siliconflow |
API key | https://siliconflow.cn |
| VolcEngine | volcengine |
API key | https://www.volcengine.com |
| DashScope | dashscope |
API key | https://dashscope.console.aliyun.com |
| MoonShot | moonshot |
API key | https://platform.moonshot.cn |
| Zhipu | zhipu |
API key | https://open.bigmodel.cn |
| Ollama | ollama |
Local (no key) | https://ollama.ai |
| vLLM | vllm |
Local (no key) | https://vllm.ai |
| AiHubMix | aihubmix |
API key | https://aihubmix.com |
| OpenAI Codex | codex |
OAuth | GitHub OAuth |
| GitHub Copilot | copilot |
OAuth | GitHub OAuth |
| Custom | custom |
Varies | Any OpenAI-compatible endpoint |
Total: 20 LLM providers supported (16 cloud + 2 local + 2 OAuth-based + custom endpoints)
Configure default agent behavior:
{
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5",
"provider": "openrouter",
"maxTokens": 4096,
"temperature": 0.7
}
}
}
Agent Settings:
| Setting | Type | Default | Description |
|---|---|---|---|
model |
string | - | Default model (format: provider/model) |
provider |
string | - | Default provider |
maxTokens |
number | 4096 | Maximum tokens in response |
temperature |
number | 0.7 | Response creativity (0-1) |
Configure messaging platform connectors:
{
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_TELEGRAM_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"],
"webhook": false
}
}
}
Get Token: Message @BotFather on Telegram, create new bot.
{
"channels": {
"discord": {
"enabled": true,
"token": "YOUR_DISCORD_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"],
"intents": {
"messageContent": true
}
}
}
}
Get Token: Discord Developer Portal → Applications → Bot
{
"channels": {
"whatsapp": {
"enabled": true,
"allowFrom": ["YOUR_PHONE_NUMBER"]
}
}
}
Setup: Requires Node.js 18+. QR code scan on first run.
{
"channels": {
"slack": {
"enabled": true,
"token": "xoxb-YOUR-BOT-TOKEN",
"appToken": "xapp-YOUR-APP-TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
}
}
Get Tokens: Slack API → Your Apps → Socket Mode enabled
{
"channels": {
"feishu": {
"enabled": true,
"appId": "cli_xxx",
"appSecret": "xxx",
"encryptKey": "xxx",
"verificationToken": "xxx"
}
}
}
{
"channels": {
"dingtalk": {
"enabled": true,
"appKey": "xxx",
"appSecret": "xxx"
}
}
}
{
"channels": {
"email": {
"enabled": true,
"imap": {
"host": "imap.example.com",
"port": 993,
"username": "your-email@example.com",
"password": "app-password"
},
"smtp": {
"host": "smtp.example.com",
"port": 587,
"username": "your-email@example.com",
"password": "app-password"
},
"allowFrom": ["trusted@example.com"]
}
}
}
{
"channels": {
"matrix": {
"enabled": true,
"homeserver": "https://matrix.org",
"userId": "@user:matrix.org",
"accessToken": "your-access-token",
"allowFrom": ["@trusted:matrix.org"],
"e2ee": {
"enabled": true
}
}
}
}
{
"channels": {
"wecom": {
"enabled": true,
"botId": "YOUR_BOT_ID",
"botSecret": "YOUR_BOT_SECRET",
"allowFrom": ["YOUR_USER_ID"]
}
}
}
Setup: Enterprise WeChat (WeCom) bot configuration.
Configure tool and MCP settings:
{
"tools": {
"restrictToWorkspace": false,
"exec": {
"pathAppend": "/usr/local/bin"
},
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "your-github-token"
}
}
}
}
}
Nanobot primarily uses config.json, but supports some environment variables:
| Variable | Description | Example |
|---|---|---|
MYPROVIDER_API_KEY |
Provider API keys | sk-or-v1-xxx |
ZHIPUAI_API_KEY |
Zhipu provider key | Your Zhipu key |
The workspace directory (~/.nanobot/workspace/) stores:
HEARTBEAT.md - Periodic task state{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-your-key"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5",
"provider": "openrouter"
}
}
}
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-your-key"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5",
"provider": "openrouter"
}
},
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_TELEGRAM_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
}
}
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-your-key"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5",
"provider": "openrouter",
"maxTokens": 4096,
"temperature": 0.7
}
},
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_TELEGRAM_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
},
"discord": {
"enabled": true,
"token": "YOUR_DISCORD_TOKEN",
"intents": {
"messageContent": true
}
},
"slack": {
"enabled": true,
"token": "xoxb-YOUR-TOKEN",
"appToken": "xapp-YOUR-TOKEN"
}
},
"tools": {
"restrictToWorkspace": true,
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/documents"]
}
}
}
}
After configuration changes:
# Check configuration
nanobot status
# Test agent
nanobot agent -m "Hello!"
# Restart gateway (Docker)
docker compose restart nanobot-gateway
Every deployment is unique. We provide consulting for:
Get personalized assistance: office@linux-server-admin.com | Contact Page