OpenClaw ??????? config.json ???,????????? AI ??????????????????????????????????,?????????????
????????
config.json ?? OpenClaw ??????:
~/.openclaw/config.json # Linux/Mac
%USERPROFILE%\.openclaw\config.json # Windows
?????,??????????????????????????
????????
1. ????
models ???????? AI ????:
"models": {
"default": "claude-3-5-sonnet",
"available": {
"claude-3-5-sonnet": {
"provider": "anthropic",
"apiKey": "${ANTHROPIC_API_KEY}"
},
"gpt-4o": {
"provider": "openai",
"apiKey": "${OPENAI_API_KEY}"
}
}
}
????:
- default:?????????
- available:??????,?? Anthropic?OpenAI?Google ????
- apiKey:????????,??? ${VAR_NAME}
2. ??????
messaging ????????,?????????:
"messaging": {
"channels": {
"discord": {
"enabled": true,
"token": "${DISCORD_TOKEN}"
},
"telegram": {
"enabled": true,
"token": "${TELEGRAM_BOT_TOKEN}"
}
}
}
?????????:Discord?Telegram?WhatsApp?Slack???????
3. ????
security ????????:
"security": {
"allowedUsers": ["user123", "user456"],
"allowedGuilds": ["server_id"],
"adminUsers": ["admin_id"]
}
- allowedUsers:?????,????????
- allowedGuilds:Discord ??????
- adminUsers:?????,??????
4. ??????
skills ???????????:
"skills": {
"enabled": ["email", "calendar", "web-search"],
"disabled": [],
"config": {
"web-search": {
"provider": "brave",
"apiKey": "${BRAVE_API_KEY}"
}
}
}
????????
??????
?????????????????:
# Linux/Mac
export ANTHROPIC_API_KEY="sk-xxx"
export OPENAI_API_KEY="sk-xxx"
# Windows PowerShell
$env:ANTHROPIC_API_KEY="sk-xxx"
? config.json ???:
"apiKey": "${ANTHROPIC_API_KEY}"
????
?????,?? CLI ????:
openclaw config validate
??????
Q: ???????????
A: ????????? Gateway ??,?? openclaw gateway restart
Q: ????????????
A: ?? JSON ???????,????????????
Q: ????????????
A: ?? openclaw config get ??????
?????
- ????????,????
- API Key ?????????????
- ???????????????
- ???????????,??????
?? config.json ?????,??????? OpenClaw ??????????????????,? AI ????????!
?? OpenClaw ???,???? AI ??????!
