闲社服务运行正常AI智能体自动化平台
m

Minimax用量监控

技能标识:minimax-usage-cn

Monitor Minimax Coding Plan usage to stay within API limits. Fetches current usage stats and provides status alerts. Use when checking API quota, monitoring usage, or before running large AI tasks. Shows 5-hour sliding window status.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.1.0
检测标记
后台标记通过
免费
免费获取
1
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

Minimax用量监控

Minimax Usage (国内版)

监控 Minimax Coding Plan 用量,确保不超出 API 限制。



目录结构

~/.openclaw/workspace/skills/minimax-usage-cn/
├── SKILL.md
└── scripts/
└── minimax-usage.sh # 主脚本



功能

  • - 检查当前使用配额
  • 监控 5 小时滑动窗口
  • 在达到限制前获取用量警报

何时使用此技能

在以下情况使用此技能:

  • - 用户要求检查 Minimax 用量
  • 运行大型 AI 任务之前
  • 接近限制警告时

API 规范

端点: GET https://www.minimaxi.com/v1/api/openplatform/coding_plan/remains

请求头:

Authorization: Bearer APIKEY>
Content-Type: application/json

注意: 此接口仅适用于国内版 www.minimaxi.com。



响应字段


字段含义示例
remainstime订阅周期剩余时间 (秒),和5小时窗口无关8277752
currentintervaltotalcount
周期总配额 (固定1500) | 1500 |
| currentintervalusage_count | 当前窗口剩余可用次数 | 1263 |
| model_name | 模型名称 | MiniMax-M2.5 |
| starttime / endtime | 当前5小时滑动窗口起止时间 (毫秒时间戳) | 1773558000000 |

计算公式(重要!)

python

❌ 错误理解


已用 = currentintervalusage_count # 误以为这是已用量

✅ 正确理解

剩余 = currentintervalusage_count # 这是剩余可用次数 已用 = currentintervaltotalcount - currentintervalusagecount 使用率 = (currentintervaltotalcount - currentintervalusagecount) / currentintervaltotal_count * 100%

示例:API 返回 currentintervaltotalcount=1500, currentintervalusagecount=1263

  • - 剩余 = 1263 次
  • 已用 = 1500 - 1263 = 237 次
  • 使用率 = 237 / 1500 = 15.8%

状态阈值

剩余量使用率状态
>600<60%💚 绿色
375-600
60-75% | ⚠️ 注意 | | 150-375 | 75-90% | ⚠️ 警告 | | <150 | >90% | 🚨 严重 |

输出格式

🔍 正在检查 Minimax Coding Plan 用量...
✅ 用量获取成功:

📊 Coding Plan 状态 (MiniMax-M2.5):
已用: 102 / 1500 次 (6%)
剩余: 1398 次
窗口: 20:00 - 00:00 (UTC+8)
重置时间: 约 1 小时 13 分钟

💚 绿色:已用 6%。余量充足。

JSON 输出模式

用于程序化调用,添加 --json 或 -j 参数:

bash
./minimax-usage.sh --json

输出:
json
{
status: GREEN,
used: 102,
total: 1500,
remaining: 1398,
percent: 6,
model: MiniMax-M2.5,
window_start: 20:00,
window_end: 00:00,
resetsinseconds: 4380
}

Cron 定时检查

添加到 crontab 每小时检查一次:

bash

编辑 crontab


crontab -e

添加以下行(每小时检查并记录)

0 cd /home/rocfly/.openclaw/workspace/skills/minimax-usage-cn/scripts && ./minimax-usage.sh >> /home/rocfly/.openclaw/workspace/logs/minimax-usage.log 2>&1

或者带通知(需要配置邮件或 webhook)

0 cd /home/rocfly/.openclaw/workspace/skills/minimax-usage-cn/scripts && ./minimax-usage.sh --json | python3 -c import sys, json data = json.load(sys.stdin) if data[percent] > 75: print(f⚠️ 警报:已用 {data[\percent\]}%!) # 在此添加 webhook 通知

常见使用场景

场景命令
手动检查用量./minimax-usage.sh
静默检查(无输出)
./minimax-usage.sh -q | | JSON 格式输出 | ./minimax-usage.sh --json | | 配合 cron 记录 | ./minimax-usage.sh >> usage.log |

状态阈值

使用率状态提示
0-60%💚 绿色余量充足
60-75%
⚠️ 注意 | 目标为 60% | | 75-90% | ⚠️ 警告 | 接近限制 | | >90% | 🚨 严重 | 停止所有 AI 工作 |

注意事项

  • - 需要使用 Coding Plan API Key,专用于 Coding Plan 套餐
  • Coding Plan 用量每5小时重置
  • 一个 prompt 约等于 15 次模型调用
  • currentintervalusage_count 是剩余用量,不是已用量!
  • 窗口时间为 UTC+8 时区

错误处理

错误码含义解决方法
2013参数错误请检查请求参数
1004
未授权/Token 不匹配 | 请检查 API Key | | 2049 | 无效的 API Key | 请检查 API Key | | 1002 | 请求频率超限 | 请稍后再试 | | 2056 | 超出 Coding Plan 资源限制 | 请等待下一个时间段资源释放后,再次尝试 | | 1000/1024/1033 | 系统错误/内部错误 | 请稍后再试 |

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 minimax-usage-cn-1776090245 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 minimax-usage-cn-1776090245 技能

通过命令行安装

skillhub install minimax-usage-cn-1776090245

下载

⬇ 下载 minimax-usage-cn v1.1.0(免费)

文件大小: 5.37 KB | 发布时间: 2026-4-15 13:26

v1.1.0 最新 2026-4-15 13:26
minimax-usage-cn v1.1.0 introduces JSON output mode and cron usage guidance.

- Added support for JSON output via --json or -j flag for easier scripting and integration.
- Provided detailed instructions for cron job setup, including automated alert examples.
- Enhanced documentation: removed trigger/example metadata, clarified usage scenarios, and simplified structure.
- Updated requirements metadata: changed "tools" to "bins" for dependency listing.
- Minor doc cleanups for clarity and actionable guidance.
返回顶部