← 返回 Skills 市场
xd4o

Kimi Usage Monitor

作者 xD4O · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
950
总下载
4
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install kimi-usage-monitor
功能描述
Monitor Kimi K2.5 API usage and quota from the Kimi console. Use when the agent needs to (1) Check remaining usage percentage and reset timers, (2) Make autonomous decisions about task prioritization based on available quota, (3) Monitor rate limit status before starting intensive operations, (4) Log usage patterns over time for resource planning. Essential for self-managing agents operating under quota constraints.
使用说明 (SKILL.md)

Kimi Usage Monitor

Monitor Kimi K2.5 usage quotas from the Kimi console to make informed decisions about task prioritization and resource allocation.

When to Use This Skill

  • Before intensive operations: Check quota before starting multi-step research or coding tasks
  • Autonomous planning: Self-prioritize tasks based on remaining usage percentage
  • Rate limit awareness: Know when quotas reset to time high-priority work
  • Usage tracking: Log patterns for long-term capacity planning

Quick Start

Prerequisites: Chrome with OpenClaw extension attached

  1. Open Chrome → https://www.kimi.com/code/console?from=membership
  2. Click OpenClaw extension icon (badge should show ON)
  3. Ensure you're logged into Kimi
# Check current usage (Linux/macOS/WSL)
./check_usage.sh

# Windows native
check_usage.bat           # CMD
.\check_usage.ps1         # PowerShell

# JSON output for automation (all platforms)
python3 scripts/fetch_usage.py --json

Platform Support: Linux ✅ | macOS ✅ | Windows (WSL) ✅ | Windows (Native) ✅

Usage Data Available

The Kimi console shows:

Metric Description Decision Threshold
Weekly Usage Percentage of weekly quota consumed >75% = prioritize
Weekly Reset Hours until quota resets Plan heavy tasks after reset
Rate Limit Additional rate limiting quota Secondary resource
Rate Reset Hours until rate limit resets Short-term buffer

Autonomous Decision Guidelines

When operating autonomously, use these heuristics:

🟢 High Capacity (>50% remaining)

  • Proceed with full capability
  • Accept multi-step research tasks
  • Spawn subagents as needed
  • Enable verbose reasoning

🟡 Moderate Capacity (25-50% remaining)

  • Batch similar operations
  • Prefer concise outputs
  • Use subagents sparingly
  • Disable non-essential reasoning

🔴 Low Capacity (\x3C25% remaining)

  • Essential tasks only
  • Single-step operations
  • Avoid subagent spawning
  • Prioritize user-directed work over proactive tasks

Pre-Flight Checks for Intensive Operations

Before spawning subagents or starting multi-step tasks, check capacity:

# Check if operation should proceed
python3 scripts/preflight_check.py [light|standard|intensive]

# Light: single query, simple task (needs 10%)
# Standard: normal subagent, research (needs 25%)
# Intensive: multi-subagent, deep research (needs 50%)

Returns exit code 0 if cleared, 1 if blocked. Use in scripts:

if python3 scripts/preflight_check.py intensive; then
    # Proceed with intensive operation
    sessions_spawn "Complex research task..."
fi

Subagent Guard

Check specifically before spawning subagents:

python3 scripts/subagent_guard.py

Returns JSON with can_spawn boolean:

{
  "can_spawn": true,
  "usage_percent": 45,
  "remaining_percent": 55,
  "resets_hours": 36
}

Integration Ideas

Hourly monitoring cron:

# Add to crontab or OpenClaw jobs
0 * * * * cd /path/to/kimi-usage-monitor && python3 scripts/usage_logger.py

Pre-task validation:

import subprocess
result = subprocess.run(
    ["python3", "scripts/preflight_check.py", "intensive"],
    capture_output=True
)
if result.returncode == 0:
    # Proceed with task
    pass

Script Reference

Script Purpose
scripts/fetch_usage.py Main usage scraper (browser-based)
scripts/usage_logger.py Autonomous logging + decision wrapper
scripts/preflight_check.py Pre-flight validation for operations
scripts/subagent_guard.py Check before spawning subagents
check_usage.sh Quick CLI wrapper

Note: Alternative Playwright-based scraper (fetch_kimi_usage.py) available for non-OpenClaw environments (requires system dependencies).

Troubleshooting

"Browser not available"

  • Ensure Chrome extension is attached (badge shows ON)
  • Verify the Kimi console tab is open

"Could not detect usage"

  • Make sure you're logged into Kimi
  • Check that the console page has fully loaded

Authentication errors

  • Re-authenticate at https://www.kimi.com/code/console
  • The browser tool uses your existing Chrome session

Output Format

Human-Readable (default)

📊 Kimi Usage Monitor
========================================

🗓️  Weekly Usage
   Used: 45%
   Remaining: 55%
   Resets in: 36 hours
   Status: 🟡 Moderate — plan accordingly

⚡ Rate Limit
   Used: 2%
   Resets in: 3 hours

JSON (--json flag)

{
  "weekly_usage_percent": 45,
  "weekly_resets_hours": 36,
  "rate_limit_percent": 2,
  "rate_limit_resets_hours": 3,
  "timestamp": "2026-02-12 21:15:00"
}

License

MIT License - Feel free to modify and distribute.

安全使用建议
This skill appears to do what it says, but before installing consider: 1) Trust: it requires and uses the OpenClaw CLI/extension to snapshot your Chrome tab — that gives it access to the Kimi console page (and potentially any visible tab content). Only install if you trust the skill source and OpenClaw integration. 2) Fail-open behavior: subagent_guard returns can_spawn: true and allows spawns when the check fails; if you prefer fail-closed behavior, modify subagent_guard/preflight_check to default to deny on error. 3) Review and test locally: run scripts manually to verify they only read local browser content and do not transmit data externally. 4) Least privilege: run this skill in an environment with the minimal account/session needed and audit any automated runs (cron/OpenClaw jobs). 5) If you need stronger guarantees, ask the author for provenance or adapt the code to log checks and fail-closed on errors.
功能分析
Type: OpenClaw Skill Name: kimi-usage-monitor Version: 1.0.0 The skill 'kimi-usage-monitor' is designed to monitor Kimi K2.5 API usage via browser automation using the OpenClaw CLI. All scripts (`fetch_usage.py`, `preflight_check.py`, `subagent_guard.py`, `usage_logger.py`) interact with the `openclaw` tool to snapshot the `kimi.com/code/console` page and parse usage data. There is no evidence of data exfiltration, malicious execution (e.g., `curl|bash`, `eval` on untrusted input), persistence mechanisms, or prompt injection attempts in `SKILL.md` that would subvert the agent's core purpose. The instructions and code are entirely aligned with the stated goal of resource monitoring and autonomous decision-making based on API quotas.
能力评估
Purpose & Capability
The skill's name and description match what the files implement: scripts use the OpenClaw CLI to snapshot a Chrome tab at the Kimi console and parse usage data; preflight, subagent guard, and logger scripts all coherently support quota-aware decision-making. There are no unrelated env vars, binaries, or installs requested.
Instruction Scope
SKILL.md instructs the agent to rely on a Chrome session with the OpenClaw extension and run the provided scripts — that matches the code. Important behavioral notes: fetch_usage.py snapshots the browser tab content (so it reads full page HTML), and subagent_guard defaults to allowing spawns when the usage check fails (it prints can_spawn: true and exits 0 on error). Those behaviors are consistent with the skill's purpose but are policy-relevant (privacy of page content, and a fail-open default on check failures).
Install Mechanism
There is no install spec; the skill is delivered as script files and runtime instructions only. No downloads from external URLs or package installs are requested.
Credentials
The skill requests no environment variables, credentials, or config paths. It uses the local openclaw CLI and local Python — both are proportional to the stated function of reading a browser page via OpenClaw.
Persistence & Privilege
always is false and the skill does not request to modify other skills or system settings. It provides cron examples for periodic runs but does not attempt permanent elevated presence or to write system-wide configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kimi-usage-monitor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kimi-usage-monitor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
kimi-usage-monitor 1.0.0 - Initial release. - Provides tools to monitor Kimi K2.5 API usage and quotas directly from the console using browser-based automation. - Enables agents to make autonomous decisions about task prioritization and resource allocation based on real-time usage data. - Includes scripts for checking current usage, quota resets, rate limits, and safe subagent spawning. - Supports output in both human-readable and JSON formats for integration and automation. - Compatible with Linux, macOS, Windows (native and WSL). - Includes troubleshooting steps and suggested integration patterns for resource planning.
元数据
Slug kimi-usage-monitor
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Kimi Usage Monitor 是什么?

Monitor Kimi K2.5 API usage and quota from the Kimi console. Use when the agent needs to (1) Check remaining usage percentage and reset timers, (2) Make autonomous decisions about task prioritization based on available quota, (3) Monitor rate limit status before starting intensive operations, (4) Log usage patterns over time for resource planning. Essential for self-managing agents operating under quota constraints. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 950 次。

如何安装 Kimi Usage Monitor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kimi-usage-monitor」即可一键安装,无需额外配置。

Kimi Usage Monitor 是免费的吗?

是的,Kimi Usage Monitor 完全免费(开源免费),可自由下载、安装和使用。

Kimi Usage Monitor 支持哪些平台?

Kimi Usage Monitor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Kimi Usage Monitor?

由 xD4O(@xd4o)开发并维护,当前版本 v1.0.0。

💬 留言讨论