OpenClaw
更新时间:2026-03-23
关于 OpenClaw
OpenClaw 是一款开源、自托管的个人 AI 助手。本文介绍如何在 OpenClaw 中使用百度智能云千帆的 Coding Plan,可参考下文配置。
Step 1: 安装 OpenClaw
安装或更新 Node.js 22 或更新版本。
- macOS / Linux
Bash
1curl -fsSL https://openclaw.ai/install.sh | bash
- Windows
Bash
1iwr -useb https://openclaw.ai/install.ps1 | iex
Step 2: 配置网络与模型参数
1. 创建并打开配置文件:
- macOS / Linux:
Bash
1mkdir -p ~/.openclaw
2vim ~/.openclaw/openclaw.json
- Windows
Bash
1mkdir %USERPROFILE%\.openclaw
2notepad %USERPROFILE%\.openclaw\openclaw.json
2. 添加配置: 将以下内容完整填入 openclaw.json。
Bash
1{
2 "models": {
3 "mode": "merge",
4 "providers": {
5 "baiduqianfancodingplan": {
6 "baseUrl": "https://qianfan.baidubce.com/v2/coding",
7 "apiKey": "请填入您的千帆API Key",
8 "api": "openai-completions",
9 "models": [
10 {
11 "id": "qianfan-code-latest",
12 "name": "qianfan-code-latest",
13 "reasoning": false,
14 "input": [
15 "text"
16 ],
17 "cost": {
18 "input": 0.0025,
19 "output": 0.01,
20 "cacheRead": 0,
21 "cacheWrite": 0
22 },
23 "contextWindow": 98304,
24 "maxTokens": 65536
25 }
26 ]
27 }
28 }
29 },
30 "agents": {
31 "defaults": {
32 "model": {
33 "primary": "baiduqianfancodingplan/qianfan-code-latest"
34 },
35 "models": {
36 "baiduqianfancodingplan/qianfan-code-latest": {}
37 },
38 "compaction": {
39 "mode": "safeguard"
40 },
41 "maxConcurrent": 4,
42 "subagents": {
43 "maxConcurrent": 8
44 }
45 }
46 }
47}
Step 3: 启动配置
配置完成后,在终端执行以下命令启动OpenClaw
Bash
1openclaw onboard --install-daemon
评价此篇文章
