Integration
Xiaomi Mimo Provider
OpenClaw plugin: Xiaomi MiMo (mimo-v2.5 / mimo-v2.5-pro) over the OpenAI Responses API, with Token Plan and pay-as-you-go endpoints
Install
openclaw plugins install clawhub:@mirr0ch1/xiaomi-mimo-provider
Configuration Example
{"error":{"code":"responses_feature_not_supported",
"message":"tool type 'web_search' is not supported by this gateway phase."}}
README
<div align="center">
# xiaomi-mimo-provider
**OpenClaw 插件:以 OpenAI Responses 协议接入小米 MiMo 模型(`mimo-v2.5` / `mimo-v2.5-pro`)**
*OpenClaw plugin: register Xiaomi MiMo models through the OpenAI Responses API*
[](LICENSE)
[](https://docs.openclaw.ai)
[](https://mimo.mi.com)
[](https://mimo.mi.com/docs/zh-CN/api/chat/responses)
</div>
---
## 简介 / Introduction
本插件把小米 MiMo 的 `mimo-v2.5` 与 `mimo-v2.5-pro` 注册为 OpenClaw 的文本推理 Provider,走
**OpenAI Responses 兼容端点**(`POST /v1/responses`),而不是旧的 Chat Completions。
This plugin wires Xiaomi MiMo's `mimo-v2.5` and `mimo-v2.5-pro` into OpenClaw over the
**OpenAI Responses-compatible** endpoint rather than the legacy chat-completions path.
### 为什么换成 Responses?/ Why Responses?
在 Chat Completions 端点上,MiMo 要求历史上的每一条 assistant 消息都保留 `reasoning_content`,
否则多轮工具调用会直接失败:
```
400 Param Incorrect — "The reasoning_content in the thinking mode must be passed back to the API."
```
而在 Responses 端点上,**推理是第一等公民**:响应里原生带有 `{"type": "reasoning"}` 输出项,
会话转录会自然地把历史思考内容带回给 API。因此本插件**不再需要**任何请求体手工补丁 —— 这也
是本次重写最大的收益。
> 本插件的前身 `xiaomi-mimo-reasoning-fix` 就是专门打这个补丁的;它还有个副作用:只要插件提供
> `wrapStreamFn`,OpenClaw 就认为 Provider 已自行处理流,从而**跳过核心下发 `thinking` /
> `reasoning_effort` 的包装器**,导致思考等级根本没发到 API(永远是 `low`)。Responses 协议从
> 根上绕开了这个问题。
---
## 特性 / Features
- ✅ **Responses 协议**:`api: "openai-responses"`,推理内容原生回传,无需补丁
- ✅ **完整思考等级**:`off` / `minimal` / `low` / `medium` / `high` / `xhigh` / `max`,默认 `high`
- ✅ **两种接入端点**:Token Plan 订阅(`tp-` 密钥)与按量付费 API(`sk-` 密钥)
- ✅ **算力集群可选**:中国大陆(默认)/ 新加坡 / 阿姆斯特丹
- ✅ **动态模型目录**:`baseUrl`、`api`、成本表随配置实时生成
- ✅ **模型级图像能力**:`mimo-v2.5` 声明 `input: ["text", "image"]`,但不主动抢占图像理解管线
- ✅ 兼容既有配置:Provider id 沿用 `xiaomi-mimo`,原来的 `xiaomi-mimo/mimo-v2.5-pro` 引用无需改动
---
## 安装 / Installation
### 方式一:ClawHub(推荐)/ via ClawHub
```bash
openclaw plugins search xiaomi-mimo
openclaw plugins install clawhub:@mirr0ch1/xiaomi-mimo-provider
systemctl --user restart openclaw-gateway # 或 openclaw gateway restart
```
### 方式二:GitHub 仓库 / via GitHub
```bash
openclaw plugins install Mirr0ch1/xiaomi-mimo-provider
```
### 方式三:手动 / Manual
```bash
git clone https://github.com/Mirr0ch1/xiaomi-mimo-provider.git ~/coding/xiaomi-mimo-provider
```
然后在 `~/.openclaw/openclaw.json` 中启用:
```json5
{
plugins: {
allow: ["xiaomi-mimo-provider"],
load: { paths: ["~/coding/xiaomi-mimo-provider"] }, // 或直接放进 ~/.openclaw/extensions/
entries: {
"xiaomi-mimo-provider": { enabled: true },
// 可选:内置 xiaomi 插件也提供这些模型,避免重复可关掉
xiaomi: { enabled: false },
},
},
}
```
重启网关后验证:
```bash
openclaw plugins list | grep -i mimo
openclaw models list | grep -i mimo
```
---
## 配置 / Configuration
所有选项位于 `plugins.entries["xiaomi-mimo-provider"].config`:
```json5
{
plugins: {
entries: {
"xiaomi-mimo-provider": {
enabled: true,
config: {
surface: "token-plan", // token-plan(默认) | api
cluster: "cn", // cn(默认) | sgp | ams,仅 token-plan 生效
// baseUrl: "https://...", // 显式覆盖,优先级最高
// registerImageModel: false, // 是否注册为图像理解 Provider,默认关闭
},
},
},
},
}
```
| 选项 / Option | 类型 | 默认值 | 说明 / Description |
|---|---|---|---|
| `surface` | `token-plan` \| `api` | `token-plan` | 计费形态 / 端点族。Billing surface. |
| `cluster` | `cn` \| `sgp` \| `ams` | `cn` | Token Plan 算力集群。Compute cluster (token-plan only). |
| `baseUrl` | string | — | 显式覆盖,优先级高于 `surface` + `cluster`。Explicit override. |
| `registerImageModel` | boolean | `false` | 是否把 `mimo-v2.5` 注册为图像理解 Provider。详见下文。 |
### 端点表 / Endpoints
| `surface` | `cluster` | Base URL |
|---|---|---|
| `token-plan` | `cn` | `https://token-plan-cn.xiaomimimo.com/v1` |
| `token-plan` | `sgp` | `https://token-plan-sgp.xiaomimimo.com/v1` |
| `token-plan` | `ams` | `https://token-plan-ams.xiaomimimo.com/v1` |
| `api` | — | `https://api.xiaomimimo.com/v1` |
### 凭据 / Credentials
| 形态 | 密钥前缀 | 环境变量 |
|---|---|---|
| Token Plan | `tp-` | `XIAOMI_TOKEN_PLAN_API_KEY` |
| 按量付费 / Pay-as-you-go | `sk-` | `XIAOMI_API_KEY` |
> ⚠️ 两类密钥**互不通用**,端点也必须匹配。用 `sk-` 密钥打 token-plan 端点(或反之)会得到 404。
> The two key types are **not interchangeable**; endpoints must match the key type.
---
## 模型 / Models
| 模型 / Model | 输入 | 上下文 | 最大输出 | 推理 |
|---|---|---|---|---|
| `mimo-v2.5-pro` | text | 1,048,576 | 131,072 | ✅ |
| `mimo-v2.5` | text + image | 1,048,576 | 131,072 | ✅ |
按量付费形态会带官方价格表(input/output/cacheRead);Token Plan 为订阅制,成本一律记为 0。
---
## 思考等级 / Thinking Levels
`/think` 接受全部 7 档,映射为 `reasoning.effort`:
| 等级 / Level | `reasoning.effort` |
|---|---|
| `off` | `none` |
| `minimal` / `low` | `low` |
| `medium` | `medium` |
| `high` / `xhigh` / `max` | `high` |
> ⚠️ **MiMo 并不真正分级。** 官方文档与实测均表明:`none` 关闭思考,其余取值**效果完全一致**。
> 保留完整 7 档只是为了从其他 Provider 切过来时 `/think high` 不报错,请不要指望它能调节推理强度。
>
> MiMo does not grade reasoning intensity: `none` turns thinking off, every other value enables it
> identically. The full ladder exists for provider-switch compatibility only.
>
> 另外,思考模式下 MiMo 会强制 `temperature: 1.0` 与 `top_p: 0.95`,传别的值也会被忽略。
---
## 联网搜索:不支持 / Web Search: Not Supported
MiMo 的原生 `web_search` 工具**只在 Chat Completions 端点上实现**。发到 `/v1/responses` 会被网关硬拒:
```json
{"error":{"code":"responses_feature_not_supported",
"message":"tool type 'web_search' is not supported by this gateway phase."}}
```
因此本插件不注册、也不注入联网搜索工具。
即便回退到 Chat Completions,还需要先在 [MiMo 控制台 - 插件管理](https://platform.xiaomimimo.com/#/console/plugin)
开通「联网服务插件」,否则会收到:
```json
{"error":{"code":"400","message":"web search tool found in the request body, but webSearchEnabled is false"}}
```
如果需要 MiMo 原生联网搜索,请使用 Chat Completions 协议的插件(如 OpenClaw 内置 `xiaomi` 插件)。
---
## 图像理解:默认关闭 / Image Understanding: Opt-in
`mimo-v2.5` 在模型目录里声明了 `input: ["text", "image"]`,所以它是**具备**图像能力的 ——
但本插件**默认不会**把它注册为图像理解 Provider,OpenClaw 不会自动把图片理解路由给它。
想启用时显式打开:
```json5
config: { registerImageModel: true }
```
注册时使用 `autoPriority: { image: 1 }`(刻意压低),因此不会抢占你已配置的专用视觉 Provider
(例如 `tools.media` 里的 stepfun / minimax)。
---
## 迁移自 `xiaomi-mimo-reasoning-fix`
1. 禁用并删除旧插件:
```json5
plugins: { entries: { "xiaomi-mimo-reasoning-fix": { enabled: false } } }
```
```bash
rm -rf ~/.openclaw/extensions/xiaomi-mimo-reasoning-fix
```
2. 启用本插件(见「安装」)。
3. 若你手写了 `models.providers.xiaomi-mimo`,把它的 `api` 从 `openai-completions` 改为
`openai-responses`。插件会通过 `normalizeTransport` 自动纠正,但让配置与实际一致更省心。
4. 已有会话可能仍持久化着 `thinkingLevel: low`,执行一次 `/think high`(或开新会话)。
---
## 故障排除 / Troubleshooting
| 现象 / Symptom | 原因与处理 / Cause & Fix |
|---|---|
| 模型列表里没有 MiMo | 没解析到密钥。检查 `XIAOMI_TOKEN_PLAN_API_KEY` / `XIAOMI_API_KEY` 是否在网关环境中,或在 `models.providers.xiaomi-mimo.apiKey` 显式配置。 |
| `404` on `/v1/responses` | 密钥类型与端点不匹配(`sk-` 打 token-plan,或 `tp-` 打 api)。 |
| `responses_feature_not_supported` | 有字段不被支持。插件已剥离 `background` / `previous_response_id` / `context_management`;若走了代理,用 `baseUrl` 指向能容忍这些字段的端点。 |
| 思考等级一直是 `low` | 旧插件的已知问题;升级到本插件后,老会话需要手动 `/think high` 一次。 |
| 插件已启用但仍是 completions | 手写的 `models.providers.xiaomi-mimo.api` 覆盖了默认值 —— 插件会自动纠正,确认时看 `openclaw models list` 输出。 |
---
## 开发 / Development
```bash
git clone https://github.com/Mirr0ch1/xiaomi-mimo-provider.git
cd xiaomi-mimo-provider
```
目录结构 / Layout:
```
├── index.js # Provider 注册、动态目录、思考等级映射、payload 规范化
├── openclaw.plugin.json # manifest:契约、configSchema、端点声明
├── package.json
└── README.md
```
把仓库路径加进 `plugins.load.paths` 即可热改热调,无需反复拷贝。
---
## 许可 / License
[MIT](LICENSE)
integration
Comments
Sign in to leave a comment