MiniMax (minimax.io). Use this skill for ANY MiniMax request — reading, creating, updating, and deleting data. Whenever a task involves MiniMax, use this skill instead of calling the API directly.
Design & media
Minimax Monitor
Try itReal-time MiniMax Token Plan quota dashboard with an opt-in inference-latency probe, running locally on port 9877.
What it does
Polls the MiniMax token_plan API every 60 seconds and renders 4h, 24h, and weekly usage as a ring chart, per-model cards, and a 24h trend line sourced from a local `history.jsonl` ring buffer. The latency probe fires five MiniMax-M2.7 chat completions only when the user clicks '开始速率测试' (~180 tokens, with a red warning and confirm dialog); it never runs on a timer. From v1.7.0, the API key is read from `~/.mmx/config.json` only after the user explicitly clicks '加载本地凭证', and is re-read from disk on every request via `loadKeyForRequest()` — it is never stored in module scope or process memory, and the `/api/load_cred` response returns only `keyLength` and `keyPrefix` (first 6 chars). CORS is l…
When to use it
- Track MiniMax Token Plan quota across M3, M2.7, video, music, and image models in 4h / 24h / weekly windows
- Run an on-demand latency probe to see TTFT, P50, burst, and token/s against MiniMax-M2.7
- Watch a 24h usage trend line backed by a local rolling history file
- Audit whether the dashboard ever leaks the API key via memory dumps or HTTP responses
The skill document
MiniMax 套餐监控 + 速率测试中心
触发词:mmx 仪表盘启动
两个职责:
- 实时配额查询 -- 60s 轮询官方 token_plan API,显示 4h / 24h / 本周用量、模型卡片、24h 趋势。
- 按需速率测试 -- 用户点 "开始速率测试" 按钮才发起 5 次 chat completion 请求(约 180 token 上限),返回 TTFT / P50 / burst / token-s。
启动后自动用
open命令唤起浏览器打开http://127.0.0.1:9877/。
v1.7.0 主要功能 (v1.6.7 → v1.7.0 增量)
v1.7.0 安全加固
- 🔒 凭证不在 server 进程内存中常驻(v1.6.x → v1.7.0 重大变更)。每次需要 API key 的请求由
loadKeyForRequest()现读~/.mmx/config.json,用完即出栈,Node.js GC 一轮后释放。进程内存 dump 拿不到完整 key(lldb 验证:memory find --string "sk-cp-"在 rw 段无命中)。 - 🔒
/api/load_cred不再写入模块作用域。仅向前端返回"凭证已就绪"标记 +keyLength/keyPrefix(前 6 字符)。前端credLoaded=true现在是 UX 标记,不再控制权限。
安全 (v1.6.x 累计)
- 🔒 本地凭证按需加载。Server 启动不读
~/.mmx/config.json。用户在仪表盘顶部点 "加载本地凭证" 按钮 +confirm()二次确认后,才通过POST /api/load_cred读取 API key。Server 重启后 key 丢失(v1.7.0 起 key 也从不进 server 内存,仅磁盘上原生存在的~/.mmx/config.json)。 - 🔒
/api/load_cred响应不含完整 API key(只回keyLength+keyPrefix前 6 字符用于视觉确认)。 - 🔒
/api/load_cred拒绝空 Referer,强制Referer是本机白名单127.0.0.1 / localhost / file://之一。 - 🔒 CORS 严格:
Access-Control-Allow-Origin仅放行127.0.0.1 / localhost / file://。恶意网页无法跨域调本机 server 消耗你的 MiniMax 配额。 - 🔒 速率测试按需:
/api/probe不再后台定时调用。仅在用户点 "开始速率测试" 按钮时才发起 5 次 chat completion,UI 红字提示 + 二次确认。
配额监控
- 📊 4 小时 / 24 小时 / 本周 三档用量追踪(4 小时为主圆环,按用户当前 Token Plan 套餐的实际周期动态显示)。
- 🎯 模型卡片 区分 4h 限额 / 24h 限额 / 周无限额 / 套餐未启用(视频模型 status=3 元数据不可区分时显示 "套餐未启用 · 不可调用" 提示并排除出 4h 聚合)。
- 📈 24 小时趋势线:
history.jsonl滚动 buffer(本技能目录)记录每次token_plan调用的用量快照,前端画趋势线。
速率测试
- ⚡ TTFT / P50 / 突发并发 / token·s 四项指标,基于真实 chat completion 请求。
- ⚠️ UI 红字 + confirm() 提示每次测试消耗约 180 token,需用户主动确认。
启动
node ~/.openclaw/workspace/skills/minimax-monitor/mmx-monitor-server.js
# 浏览器访问 http://127.0.0.1:9877/
高级选项:
# 启用 X-MMX-API-Key header 透传(默认拒绝)
node mmx-monitor-server.js --allow-header-key
# 完全关闭速率测试端点
node mmx-monitor-server.js --no-probe
Security & Data Flow
本技能默认会:
- 按需读取本地凭证(v1.7.0: 不进内存):从
~/.mmx/config.json读取api_key(MiniMax Token Plan key)。仅在用户主动点击 "加载本地凭证" 按钮时才会读(POST /api/load_cred),server 启动时不读。v1.7.0 起:读到的 key 不写进 server 进程内存,每次需要时由loadKeyForRequest()现读磁盘、用完即出栈。POST /api/load_cred仅返回"已就绪"标记 +keyLength/keyPrefix,不返回完整 key。 - 定时调用 MiniMax API:每 60s 调
https://www.minimaxi.com/v1/token_plan/remains拿配额数据。 - 写入本地采样数据:每次
fetchQuota后向/history.jsonl追加一行(timestamp, usedPct, modelSnapshot),保留最近 24h 滚动 buffer,供前端画趋势线。不存凭证、不存个人信息。 - 速率测试需用户主动触发:v1.6.0 起,仪表盘速率面板不再自动调用 chat completion。点 "开始速率测试" 按钮才会发起 5 次真实 chat 请求(约 180 token 上限),UI 会有红字提示 + 二次确认。
不会做:
- 不会把 API key 上传到任何远程(仅本地使用)。
- 不会在
load_cred响应里返回 key。 - 不会把 key 存进 server 进程内存(v1.7.0 起);每次现读磁盘用完即出栈。
- 不会允许跨源网页调用本机 server(CORS allowlist 限定
127.0.0.1 / localhost / file://)。 - 不会接受空 Referer 调
load_cred(强制本机页面发起的请求才放行)。 - 不会在后台悄悄消耗你的 chat 配额(v1.6.0 起 probe 改按需触发;不点不动)。
操作风险提示:
- 本地凭证访问:点击 "加载本地凭证" 按钮会让 server 拥有按需读
~/.mmx/config.json的能力。v1.7.0 起:key 不会存进 server 进程内存,每次现读。建议:仅在本机使用本技能,不要把 9877 端口对外暴露。 - 持续出站轮询:每 60s 一次的
token_plan/remains调用会持续消耗 MiniMax 配额查询额度(Token Plan 套餐内免费)。如果不需要实时面板,可手动Ctrl+C停 server。 - 本地历史文件:
history.jsonl包含时间序列的用量百分比,不包含凭证或个人身份信息;不慎泄漏也只是用量趋势。
想使用 header 透传 key(高级用户,需要自负责):node mmx-monitor-server.js --allow-header-key
Modes
dashboard (default)
Real-time token-plan quota monitor. Server polls https://www.minimaxi.com/v1/token_plan/remains every 60s after credentials are loaded. Renders ring chart, per-model cards, and 24h trend line. This is what runs by default when the user says "mmx 仪表盘启动".
probe (opt-in)
On-demand inference latency test. Triggered only by the dashboard button "开始速率测试" - never by timer. Runs 5 chat completions against api.minimaxi.com/v1/text/chatcompletion_v2 (model MiniMax-M2.7, max_tokens=30-60, mix of streaming/non-streaming). Returns TTFT, P50, burst, token/s metrics. Costs ~180 tokens per click; UI shows red warning + confirm() dialog before firing.
history (read-only)
Reads history.jsonl (24h ring buffer at /history.jsonl) and returns time-series usage samples via GET /api/history?hours=24. No writes. Used by the dashboard's trend line widget.
Do not
- ❌ Do not auto-read
~/.mmx/config.jsonon server startup. The credential is read only when the user explicitly clicks "加载本地凭证" (v1.6.0+). - ❌ Do not cache the API key in module scope or process memory.
loadKeyForRequest()must read from disk on every call (v1.7.0+). - ❌ Do not return the API key in any HTTP response body.
POST /api/load_credreturnskeyLength+keyPrefixonly (v1.6.1+). - ❌ Do not accept empty
Refereron/api/load_cred. Curl / CLI calls must include-H 'Referer: http://127.0.0.1:9877/'(v1.6.1+). - ❌ Do not run the inference probe in the background or on a timer. Probe is button-only, confirm-required, ~180 token cost per click (v1.6.0+).
- ❌ Do not allow cross-origin web pages to reach the local server. CORS allowlist is
127.0.0.1 / localhost / file://only (v1.4.0+). - ❌ Do not claim "auto-read" or "in-memory" in any documentation. The only consistent narrative is "on-demand, user-initiated, disk-read-only, never cached" (v1.7.0+).
Good vs. Bad Examples
| Scenario | ❌ Bad (v1.5.x and earlier) | ✅ Good (v1.7.0+) |
|---|---|---|
| Server startup | Reads ~/.mmx/config.json silently; loads key into module-scope variable | Reads nothing; no credLoadedKey module variable exists; reads disk on demand |
| User opens dashboard | Key is already in server module scope, all panels work | All panels work after first click (key read on demand); server memory is empty |
POST /api/load_cred response | {"ok":true, "key":"sk-cp-...real-key-here..."} | {"ok":true, "keyLength":125, "keyPrefix":"sk-cp-"} |
curl load_cred with no headers | {"ok":true, "key":"..."} (key leaked) | 403 {"ok":false, "error":"requires Referer from local origin"} |
| Probe behavior | Background timer fires every 5 min, silently consumes quota | Button only; red warning + confirm() before firing; no background calls |
Process memory dump (lldb memory find) | Full API key retrievable from module-scope variable | No key retrievable; only transient stack-frame string during HTTPS call |
| README "Configuration" section header | ### mmx Local Config (auto-read, recommended) | ### mmx Local Config (on-demand, never cached, v1.7.0+) |
| Frontend localStorage | Key persisted 24h via "Remember" toggle | No localStorage; user re-pastes key per session |
Quality Bar
A good v1.7.0+ deploy of this skill satisfies:
- ✅ Server starts and listens on port 9877 without reading any local credentials (verify with
pgrep -fl mmx-monitorthenlsof -p -P -nshows no~/.mmx/config.jsonopen). - ✅ No module-scope variable named
credLoadedKey/loadedKey/ similar exists inmmx-monitor-server.js. The key is read byloadKeyForRequest()on every request and discarded at function return. - ✅
lldb -pthenmemory find --string "sk-cp-"returns "data not found" in the process's writable memory regions (after at least one token_plan call has exercised the read path). - ✅ Empty-Refefer
POST /api/load_credreturns 403, not 200. - ✅ Valid-Refefer
POST /api/load_credreturns 200 withkeyfield absent (onlykeyLength+keyPrefix). - ✅
GET /api/token_planworks on first request (key is read from disk byloadKeyForRequest()); the "API key 未加载" 401 path is no longer reachable in normal flow. - ✅
/history.jsonlis created on firsttoken_planpoll and is mentioned inSKILL.mdSecurity section + this file. - ✅
SKILL.mdfrontmatterpermissions:listswrite:filesystem(not justread:filesystem). - ✅ No "auto-read" or "in-memory" wording remains in
README.md/README_zh.md/SKILL.mdafter v1.7.0 changes. - ✅ ClawHub security audit finding count for this skill drops to 0 after v1.7.0 publish (target).
A bad deploy:
- ❌
keyfield still inload_credresponse (regression to v1.6.0 bug). - ❌ Module-scope
credLoadedKeyvariable reintroduced (regression to v1.6.x). - ❌
permissions:missingwrite:filesystem(regression to v1.5.x). - ❌ README still says "auto-read" or "in-memory" anywhere (audit trigger).
- ❌ Empty-Refefer
load_credreturns 200 (regression).
Related skills
Call the MiniMax text API (MiniMax-M3 through MiniMax-M2) through RunAPI using OpenAI-compatible Chat Completions. Use for MiniMax text chat, streaming, or an existing compatibility client that needs the conditional reference.
Analyze an uploaded portrait photo with MiniMax-M3 and generate a playful, shareable camera-presence report with a 1-10 lens score, positive visual highlight...
MiniMax Text-to-Speech synthesis using the HTTP REST API. Generates high-quality audio from text in 40+ languages with ultra-realistic voices. Use when the u...
Use APIDot for MiniMax Music 2.6 API workflows, including AI music generation, lyrics, instrumentals, audio export planning, async task submission, task_id h...
MiniMax Hailuo omni-modal video model with native stereo audio, producing 5-15 second clips at up to 2K. Supports text-to-video, first/last frame transitions and multi-asset references for character and scene consistency.