token-manager
Universal LLM Token Manager - Monitor usage and provide cost-saving recommendations for Kimi, OpenAI, Anthropic, Gemini, and local models. Features scheduled monitoring, cross-session tracking, and proactive alerts.
Why use this skill?
Monitor your LLM token usage across Kimi, OpenAI, Anthropic, and local models. Get cost-saving alerts, usage analytics, and budget-friendly recommendations.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/kelegele/token-managerWhat This Skill Does
The Token Manager is a comprehensive LLM oversight utility designed for OpenClaw. It provides real-time monitoring of token usage, cross-session spending analytics, and proactive cost-saving recommendations. Whether you are using enterprise APIs like Kimi (Moonshot), OpenAI, Anthropic, or Gemini, or operating local models via Ollama, this skill helps you stay within budget and optimize context window efficiency. It features a robust scheduling system for balance alerts and automated reporting to prevent unexpected API costs.
Installation
To integrate this tool into your OpenClaw environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/kelegele/token-manager
Ensure you have Node.js installed and your API keys configured as environment variables (e.g., MOONSHOT_API_KEY) to enable automatic balance queries and usage reporting features.
Use Cases
- Financial Governance: Track and cap monthly LLM spending by setting thresholds and receiving proactive notifications when your balance dips below a certain amount.
- Context Optimization: Receive real-time suggestions on when to compact conversation memory or spawn sub-agents to avoid the high costs of redundant, massive context windows.
- Multi-Model Analysis: Switch between providers like Claude Sonnet and GPT-4o-mini, using the built-in estimation tools to determine the most cost-effective model for specific tasks.
- Usage Auditing: Use the session tracker to aggregate data on how your team or projects are consuming tokens, allowing for informed decisions regarding future model selection.
Example Prompts
- "Check my current Kimi balance and let me know if I have enough for a large data processing task."
- "Review the last 10 sessions and give me a report on which model has been the most expensive to run."
- "My context usage is over 80%. What are the best strategies to compact my current conversation to save tokens?"
Tips & Limitations
- Proactive alerts are most effective when the scheduler is set to run as a background service.
- While the tool provides precise metrics for supported APIs like Moonshot, OpenAI and Anthropic integrations currently rely on console-based estimations; ensure you double-check your billing dashboard periodically.
- Always prioritize local models like Ollama for prototyping or low-stakes tasks to take advantage of zero-cost token consumption.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-kelegele-token-manager": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, external-api, code-execution