全部命令在 PowerShell(管理员) 里跑。每条命令前面带
① ② ③编号,照着顺序复制粘贴即可。
打开 https://nodejs.org/ ,下 Node 22 LTS 或更新,全部默认安装。
装完新开 PowerShell,验证:
node -v
npm -v
输出像 v22.x.x 和 10.x.x 就行。
npm install -g openclaw@latest --no-audit --no-fund
openclaw --version
输出 OpenClaw 2026.6.11 (e085fa1) 即可。
$env:OPENCLAW_STATE_DIR = "C:\Users\Administrator\AI_install\.openclaw"
New-Item -ItemType Directory -Force -Path "$env:OPENCLAW_STATE_DIR\workspace"
提示:把这个变量固化进 PowerShell 配置,以后新开窗不用重设:
"`$env:OPENCLAW_STATE_DIR = 'C:\Users\Administrator\AI_install\.openclaw'" | Add-Content $PROFILE
openclaw setup
输出三行 Config OK / Workspace OK / Sessions OK 即可。
https://api.ai-pioneer.cn/v1sk-ZDUcMtXm 开头把下面整段复制到 PowerShell 回车:
$baseUrl = "https://api.ai-pioneer.cn/v1"
$apiKey = "替换sk-擎创云 API密钥"
$batch = @"
[
{ "path": "models.providers.ai-pioneer.baseUrl", "value": "$baseUrl" },
{ "path": "models.providers.ai-pioneer.apiKey", "value": "$apiKey" },
{ "path": "models.providers.ai-pioneer.models", "value": [
{ "id": "claude-opus-4-8", "name": "Claude Opus 4.8", "api": "anthropic-messages" },
{ "id": "claude-opus-4-8", "name": "Claude Opus 4.8 (OpenAI)", "api": "openai-completions" },
{ "id": "deepseek-v4-flash", "name": "DeepSeek V4 Flash", "api": "openai-completions" },
{ "id": "deepseek-v4-pro", "name": "DeepSeek V4 Pro", "api": "openai-completions" },
{ "id": "glm-5.2", "name": "GLM 5.2", "api": "openai-completions" },
{ "id": "MiniMax-M3", "name": "MiniMax-M3", "api": "openai-completions" }
]},
{ "path": "agents.defaults.model.primary", "value": "ai-pioneer/deepseek-v4-flash" }
]
"@
$batch | Set-Content -Path "$env:TEMP\openclaw-batch.json" -Encoding UTF8
openclaw config set --batch-file "$env:TEMP\openclaw-batch.json"
期望看到:Updated 4 config paths. Restart the gateway to apply.
openclaw config validate
输出 Config valid: ...\openclaw.json 即可。
清掉可能误伤的代理:
$env:HTTP_PROXY=''; $env:HTTPS_PROXY=''; $env:ALL_PROXY=''; $env:NO_PROXY='*'
跑一句话试一下:
openclaw agent --local --agent main --model "ai-pioneer/deepseek-v4-flash" --message "用一句话中文自我介绍"
期望看到日志里有 status=200,并且模型回复中文(哪怕是空回复,只要 status=200 就说明链路通了——返回空一般是因为示例 Key 余额不足,正式 Key 不会有这个问题)。
# Deepseek
openclaw models set ai-pioneer/deepseek-v4-flash
openclaw models set ai-pioneer/deepseek-v4-pro
# 智谱 GLM
openclaw models set ai-pioneer/glm-5.2
# Claude
openclaw models set ai-pioneer/claude-opus-4-8
# MiniMax
openclaw models set ai-pioneeri/MiniMax-M3
openclaw agent --local --agent main --model "ai-pioneer/glm-5.2" --message "你好"
openclaw models status
输出 Default : ai-pioneer/xxx 那行就是当前生效的。
上新模型时用 ⑤ 那段 batch,把 models 数组里加一行:
{ "id": "新模型id", "name": "显示名", "api": "openai-completions" }
加完跑 openclaw config validate 检一下。
| 报错 | 处理 |
|---|---|
openclaw: command not found |
新开 PowerShell(npm bin 还没进 PATH) |
EPERM: mkdir ...\.openclaw\workspace |
回到 ③ 检查 OPENCLAW_STATE_DIR 设了没 |
fetch failed / ECONNREFUSED |
清代理,参见 ⑥ 那一句 |
status=200 但回复空 |
是 Hub 余额不足,去 https://api.ai-pioneer.cn 充钱或换正式 Key |
Config validation failed |
跑 openclaw config schema 看字段要求,对照着改 |