~/.openclaw/openclaw.json~/.openclaw/openclaw.jsonopenclaw.json,在 models.providers 中添加新的提供商配置:{
"models": {
"mode": "merge",
"providers": {
"crazyrouter": {
"baseUrl": "https://crazyrouter.com/v1",
"apiKey": "sk-your-api-key-here",
"api": "openai-completions",
"models": [
{
"id": "claude-opus-4-6",
"name": "Claude Opus 4.6",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
}
}
}{
"models": {
"providers": {
"minimax": {
"baseUrl": "https://api.minimax.io/anthropic",
"api": "anthropic-messages",
"models": [
{
"id": "MiniMax-M2.1",
"name": "MiniMax M2.1",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 15,
"output": 60,
"cacheRead": 2,
"cacheWrite": 10
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
}
}
}openai-completions: OpenAI Chat Completions API 格式anthropic-messages: Anthropic Messages API 格式agents.defaults.model 中设置主模型:{
"agents": {
"defaults": {
"model": {
"primary": "crazyrouter/claude-opus-4-6"
}
}
}
}<provider>/<model-id>{
"models": {
"providers": {
"your-provider": {
"apiKey": "your-api-key-here"
}
}
}
}{
"auth": {
"profiles": {
"provider:default": {
"provider": "your-provider",
"mode": "api_key"
}
}
}
}/newbot 创建新机器人{
"channels": {
"telegram": {
"enabled": true,
"botToken": "your-bot-token-here",
"dmPolicy": "pairing",
"groupPolicy": "open",
"streamMode": "partial"
}
}
}dmPolicy: 私聊策略 (pairing 需要配对, open 开放)groupPolicy: 群组策略 (open 开放, whitelist 白名单)streamMode: 流式输出模式 (partial 部分流式, full 完整流式){
"channels": {
"discord": {
"enabled": true,
"token": "your-discord-bot-token",
"groupPolicy": "open"
}
}
}{
"channels": {
"feishu": {
"enabled": true,
"appId": "cli_your_app_id",
"appSecret": "your_app_secret",
"connectionMode": "websocket",
"dmPolicy": "pairing"
}
},
"plugins": {
"entries": {
"feishu": {
"enabled": true
}
}
}
}http://localhost:18789openclaw.json 的 gateway.auth.token 中查看api 字段是否正确 (openai-completions 或 anthropic-messages)Address already in useDuplicate plugin ID: feishudisconnected [WS] unauthorized gateway token missingopenclaw health127.0.0.1 而不是 localhost{
"meta": {
"lastTouchedVersion": "2026.2.15",
"lastTouchedAt": "2026-02-18T00:00:00.000Z"
},
"models": {
"mode": "merge",
"providers": {
"openai": {
"baseUrl": "https://api.openai.com/v1",
"apiKey": "sk-your-openai-key",
"api": "openai-completions",
"models": [
{
"id": "gpt-4",
"name": "GPT-4",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 30,
"output": 60,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 128000,
"maxTokens": 4096
}
]
},
"anthropic": {
"baseUrl": "https://api.anthropic.com",
"apiKey": "sk-ant-your-key",
"api": "anthropic-messages",
"models": [
{
"id": "claude-3-5-sonnet-20241022",
"name": "Claude 3.5 Sonnet",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 3,
"output": 15,
"cacheRead": 0.3,
"cacheWrite": 3.75
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "anthropic/claude-3-5-sonnet-20241022"
},
"workspace": "~/.openclaw/workspace",
"maxConcurrent": 4
}
},
"channels": {
"telegram": {
"enabled": true,
"botToken": "your-telegram-bot-token",
"dmPolicy": "pairing",
"groupPolicy": "open"
}
},
"gateway": {
"port": 18789,
"mode": "local",
"bind": "loopback",
"auth": {
"mode": "token",
"token": "your-generated-token"
}
}
}