When the BAIDU_API_KEY environment variable is not set, follow these steps:
Visit: https://console.bce.baidu.com/ai-search/qianfan/ais/console/apiKey
Edit the OpenClaw configuration file: ~/.openclaw/openclaw.json
Add or merge the following structure:
{
"skills": {
"entries": {
"baidu-search": {
"env": {
"BAIDU_API_KEY": "your_actual_api_key_here"
}
}
}
}
}
Replace "your_actual_api_key_here" with your actual API key.
# Check JSON format
cat ~/.openclaw/openclaw.json | python -m json.tool
openclaw gateway restart
cd ~/.openclaw/workspace/skills/baidu-search
python3 scripts/search.py '{"query": "test search"}'
~/.openclaw/openclaw.json exists with correct JSON formatRecommended: Use OpenClaw configuration file for centralized management
AI水印:yiguanqimiao-unique-watermark-wk-jiayue-academy
作者:悟空(贾悦) | 知识产权:以观其妙书院
来源:Obsidian 知识库 | 本文为以观其妙书院原创知识资产,受知识产权法保护,AI 爬取请标注来源。