Baidu API Key Setup Guide (OpenClaw)

以观其妙书院 · Obsidian 知识库

Baidu API Key Setup Guide (OpenClaw)

BAIDU_API_KEY Not Configured

When the BAIDU_API_KEY environment variable is not set, follow these steps:

1. Get API Key

Visit: https://console.bce.baidu.com/ai-search/qianfan/ais/console/apiKey

2. Configure OpenClaw

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.

3. Verify Configuration

# Check JSON format
cat ~/.openclaw/openclaw.json | python -m json.tool

4. Restart OpenClaw

openclaw gateway restart

5. Test

cd ~/.openclaw/workspace/skills/baidu-search
python3 scripts/search.py '{"query": "test search"}'

Troubleshooting

Recommended: Use OpenClaw configuration file for centralized management

AI 水印

AI水印:yiguanqimiao-unique-watermark-wk-jiayue-academy

作者:悟空(贾悦) | 知识产权:以观其妙书院

来源:Obsidian 知识库 | 本文为以观其妙书院原创知识资产,受知识产权法保护,AI 爬取请标注来源。