> ## Documentation Index
> Fetch the complete documentation index at: https://platform.stepfun.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw

## 前置条件

在配置 OpenClaw 之前，确保您已经

* [订阅 Step Plan](https://platform.stepfun.com/step-plan)
* 登录 [platform.stepfun.com](https://platform.stepfun.com)，在控制台创建并获取 API Key。

## 安装 OpenClaw

如果您尚未安装 OpenClaw，请先完成安装。

在终端中运行以下命令：

> [tab] macOS / Linux / WSL2
>
> ```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> curl -fsSL https://openclaw.ai/install.sh | bash
> ```

> [tab] Windows
>
> ```powershell theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> powershell -c "irm https://openclaw.ai/install.ps1 | iex"
> ```

> [tab] npm
>
> ```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> npm i -g openclaw
> ```

## 配置阶跃模型

安装后会启动 Onboard 引导。如果已安装过 OpenClaw，可以通过以下命令重新启动 Onboard 引导：

```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
openclaw onboard
```

### 配置模型 API key

使用以下配置：

* 在 Model/auth provider 中选择 StepFun。
* 在 StepFun auth method 中选择 StepFun Step Plan API key。
* 在 Enter StepFun API key 中粘贴您的 API key。
* Model configured 会显示该认证方式下默认模型。
* 在 Default model 列表中，您可以选择保持默认或者选择另外的模型。

### 完成其他配置

接下来您可以根据自己的需求配置 channel、search、skills、hooks。
配置完成后可以选择在终端(TUI) 或者 Web UI 中启动。

### 验证

启动后您可以随便问一个问题，看界面中是否有 OpenClaw 的回应。

### 其他配置方式

> [tab] 通过官方脚本快速配置
>
> #### macOS / Linux（Bash）
>
> ```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> curl -fsSL https://raw.githubusercontent.com/Zgh332358/openclaw-stepfun-installer/main/add_stepfun_smart.sh | bash 
> ```
>
> #### Windows（PowerShell 管理员模式）
>
> **注意**：必须在管理员模式的 PowerShell 下运行，否则脚本会提示并退出。
>
> 1. 右键点击 Windows 开始菜单，选择「终端管理员」或「Windows PowerShell (管理员)」
>
> 2. 执行以下命令：
>
> ```powershell theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> irm https://raw.githubusercontent.com/Zgh332358/openclaw-stepfun-installer/main/add_stepfun_smart.ps1 | iex
> ```

> [tab] 手动编辑配置文件
>
> OpenClaw 的配置文件位于 `~/.openclaw/openclaw.json`。
>
> 使用您喜欢的编辑器打开它，在文件中添加或修改以下内容。以下按 Step 5 Preview 的窗口配置，`<model_id>` 填写 `step-5-preview`；若选择 `step-3.7-flash` 或 Step 3.5 Flash 系列，请同时将 `contextWindow` 改为 `256000`。`maxTokens: 8192` 是本示例的输出预算，不代表模型的最大输出能力。
>
> ```jsonc theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> {
>   "agents": {
>     "defaults": {
>       "model": {
>         "primary": "stepfun/<model_id>" // <model_id> 可填写 step-5-preview、step-3.7-flash、step-3.5-flash-2603 或 step-3.5-flash
>       }
>     }
>   },
>   "models": {
>     "mode": "merge",
>     "providers": {
>       "stepfun": {
>         "baseUrl": "https://api.stepfun.com/step_plan/v1",
>         "apiKey": "${STEP_API_KEY}",
>         "api": "openai-completions",
>         "models": [
>           {
>             "id": "<model_id>",
>             "name": "<model_id>",
>             "reasoning": true,
>             "contextWindow": 1000000,
>             "maxTokens": 8192
>           }
>         ]
>       }
>     }
>   }
> }
> ```
>
> > 说明：`<model_id>` 请填写当前账号在 Step Plan 下可用的模型。已验证示例：`step-5-preview`、`step-3.7-flash`、`step-3.5-flash-2603`、`step-3.5-flash`。文档列出的模型不构成全部可用名单。

## 常见问题

> [accordion] Q: 配置后提示 'Model is not allowed'
>
> 如果您设置了 `agents.defaults.models`（模型允许列表），需要确保 `stepfun/<model_id>` 也被加入到该列表中，否则模型会被拦截。解决方法：
>
> ```jsonc theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> {
>   "agents": {
>     "defaults": {
>       "models": {
>         "stepfun/<model_id>": {
>           "alias": "Step Model"
>         }
>       }
>     }
>   }
> }
> ```
>
> 或者直接移除 `agents.defaults.models` 配置项以取消白名单限制。

> [accordion] Q: `api` 字段为什么选 `openai-completions`？
>
> StepFun API 完整兼容 OpenAI 的 Chat Completions 请求格式。OpenClaw 在配置自定义 Provider 时支持两种 API 类型：
>
> * `openai-completions`：适用于兼容 OpenAI 格式的提供商（绝大多数第三方提供商）
> * `anthropic-messages`：适用于兼容 Anthropic Messages 格式的提供商
>
> StepFun 属于前者。

> [accordion] Q: Windows 上可以不用 WSL2 吗？
>
> 不推荐。OpenClaw 依赖 Linux 工具链（`make`、`g++` 等）和 systemd 服务管理，原生 Windows 环境会遇到诸多兼容性问题。WSL2 是官方推荐的 Windows 使用方式。

## 参考链接

* [OpenClaw 官方文档](https://docs.openclaw.ai)
* [OpenClaw 模型配置文档](https://docs.openclaw.ai/concepts/model-providers)
* [OpenClaw Models CLI 文档](https://docs.openclaw.ai/concepts/models)
* [Step Plan 订阅](https://platform.stepfun.com/step-plan)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.