Kimi Usage Monitor
by @xd4o
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.
clawhub install kimi-usage-monitorπ About This Skill
name: kimi-usage-monitor description: 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.
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
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.shWindows native
check_usage.bat # CMD
.\check_usage.ps1 # PowerShellJSON 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)
π‘ Moderate Capacity (25-50% remaining)
π΄ Low Capacity (<25% remaining)
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"
"Could not detect usage"
Authentication errors
https://www.kimi.com/code/consoleOutput 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.
π‘ Examples
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.shWindows native
check_usage.bat # CMD
.\check_usage.ps1 # PowerShellJSON output for automation (all platforms)
python3 scripts/fetch_usage.py --json
Platform Support: Linux β | macOS β | Windows (WSL) β | Windows (Native) β
π Tips & Best Practices
"Browser not available"
"Could not detect usage"
Authentication errors
https://www.kimi.com/code/console