{
  "schemaVersion": "1.0",
  "item": {
    "slug": "token-manager",
    "name": "Token Manager",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/kelegele/token-manager",
    "canonicalUrl": "https://clawhub.ai/kelegele/token-manager",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/token-manager",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-manager",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/manager.js",
      "scripts/scheduler.js",
      "scripts/session-tracker.js"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/token-manager"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/token-manager",
    "agentPageUrl": "https://openagent3.xyz/skills/token-manager/agent",
    "manifestUrl": "https://openagent3.xyz/skills/token-manager/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/token-manager/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Token Manager",
        "body": "Universal LLM Token Manager with proactive monitoring and analytics."
      },
      {
        "title": "When to Use",
        "body": "Use this skill when you need to:\n\nMonitor LLM API token usage and costs\nGet cost-saving recommendations\nSet up automated balance alerts\nTrack usage across multiple sessions\nGenerate daily/weekly usage reports"
      },
      {
        "title": "Quick Start",
        "body": "cd /path/to/token-manager\nexport MOONSHOT_API_KEY=\"your-api-key\"\n\n# Generate report\nnode scripts/manager.js report 11000 146 42000 200000 off 9.26 moonshot kimi-k2.5"
      },
      {
        "title": "1. Usage Monitoring",
        "body": "Real-time session analysis with cost-saving suggestions."
      },
      {
        "title": "2. Scheduled Alerts (P0)",
        "body": "Automatic balance monitoring with proactive notifications."
      },
      {
        "title": "3. Built-in Tool Integration (P1)",
        "body": "Register as OpenClaw tool for seamless usage."
      },
      {
        "title": "4. Cross-Session Analytics (P2)",
        "body": "Track spending patterns and generate reports."
      },
      {
        "title": "Supported Providers",
        "body": "ProviderBalance QueryToken EstimatePricingKimi/Moonshot✅ API✅ API¥12/1M tokensOpenAI❌ Console❌ ApproxUSD/1M tokensAnthropic/Claude❌ Console❌ ApproxUSD/1M tokensGoogle/Gemini❌ Console❌ ApproxUSD/1M tokensOllama/LocalN/A FreeN/AFREE"
      },
      {
        "title": "Context Management",
        "body": "ScenarioRecommendationActionContext > 80%🚨 Critical: Must compact immediately/compactContext > 50%📊 Suggest: Consider compacting/compactSession > 50k tokens⚠️ Warning: Split tasks now/spawnSession > 20k tokens💡 Tip: Use sub-agents for large tasks/spawn"
      },
      {
        "title": "Reasoning Optimization",
        "body": "ScenarioRecommendationActionReasoning ON + small task (<5k tokens)💡 Can disable to save 20-30%/thinking offReasoning ON + complex task✅ Keep on for qualityKeep"
      },
      {
        "title": "Provider-Specific Tips",
        "body": "ScenarioRecommendationBalance < ¥5🚨 Enable save mode, avoid large tasksUsing GPT-4💡 Consider GPT-4o-mini for 10x savingsUsing Claude Opus💡 Consider Claude Sonnet for 5x savingsRunning Ollama🎉 Free! No API costs"
      },
      {
        "title": "Manager (Core)",
        "body": "node scripts/manager.js report <tokensIn> <tokensOut> <contextUsed> <contextMax> <thinking> [balance] [provider] [model] [apiKey]\nnode scripts/manager.js balance [provider] [apiKey]\nnode scripts/manager.js estimate <provider> <inputTokens> <outputTokens> [model]\nnode scripts/manager.js providers\nnode scripts/manager.js history"
      },
      {
        "title": "Scheduler (P0 - Cron Alerts)",
        "body": "# Check balance and alert if below threshold\nnode scripts/scheduler.js check <provider> <threshold>\n\n# View alert statistics\nnode scripts/scheduler.js stats"
      },
      {
        "title": "Session Tracker (P2 - Analytics)",
        "body": "# Record session for tracking\nnode scripts/session-tracker.js record <provider> <model> <tokensIn> <tokensOut> <cost> [currency]\n\n# Generate reports\nnode scripts/session-tracker.js daily [date]\nnode scripts/session-tracker.js weekly\nnode scripts/session-tracker.js recommend"
      },
      {
        "title": "P0: Scheduled Monitoring & Alerts",
        "body": "Setup automatic balance monitoring with cron jobs."
      },
      {
        "title": "Setup Cron Job",
        "body": "# Check every hour, alert if below ¥5\nopenclaw cron add \\\n  --name \"token-balance-check\" \\\n  --schedule \"0 * * * *\" \\\n  --command \"cd /path/to/token-manager && node scripts/scheduler.js check moonshot 5\""
      },
      {
        "title": "Alert Rules",
        "body": "ConditionActionCooldownBalance < thresholdSend alert1 hourBalance < ¥1Send urgent alert30 min3 alerts in 24hSuggest adding funds-"
      },
      {
        "title": "Alert Output",
        "body": "When triggered, outputs JSON:\n\n{\n  \"alert\": true,\n  \"balance\": 3.50,\n  \"threshold\": 5,\n  \"messages\": {\n    \"en\": \"🚨 [URGENT] Token Manager Alert...\",\n    \"cn\": \"🚨 [紧急] Token 管家提醒...\"\n  }\n}"
      },
      {
        "title": "P1: Tool Integration",
        "body": "Register as OpenClaw tool for direct usage."
      },
      {
        "title": "Tool Configuration",
        "body": "Add to openclaw.json:\n\n{\n  \"tools\": {\n    \"token_status\": {\n      \"command\": \"cd /path/to/token-manager && node scripts/manager.js report\",\n      \"description\": \"Check current token usage and costs\"\n    },\n    \"token_balance\": {\n      \"command\": \"cd /path/to/token-manager && node scripts/manager.js balance\",\n      \"description\": \"Query account balance\"\n    }\n  }\n}"
      },
      {
        "title": "Usage After Registration",
        "body": "# Direct commands\nopenclaw tool token_status 11000 146 42000 200000 off 9.26 moonshot\nopenclaw tool token_balance moonshot"
      },
      {
        "title": "P2: Cross-Session Tracking",
        "body": "Track usage patterns across multiple sessions."
      },
      {
        "title": "Recording Sessions",
        "body": "Automatically or manually record each session:\n\nnode scripts/session-tracker.js record moonshot kimi-k2.5 5000 500 0.06 CNY"
      },
      {
        "title": "Daily Report",
        "body": "node scripts/session-tracker.js daily\n# Output: Total tokens, cost, session count, provider breakdown"
      },
      {
        "title": "Weekly Report",
        "body": "node scripts/session-tracker.js weekly\n# Output: 7-day summary with trend analysis"
      },
      {
        "title": "Smart Recommendations",
        "body": "node scripts/session-tracker.js recommend\n# Analyzes patterns and suggests optimizations"
      },
      {
        "title": "Environment Variables",
        "body": "MOONSHOT_API_KEY - Kimi/Moonshot API key\nOPENAI_API_KEY - OpenAI API key (optional)\nANTHROPIC_API_KEY - Anthropic API key (optional)"
      },
      {
        "title": "Security",
        "body": "API keys read from environment variables only\nAll data stored locally in .data/ directory\nNo data uploaded to third-party servers\nNetwork requests only to official LLM APIs\nAlert state persisted locally with cooldown logic"
      },
      {
        "title": "Kimi/Moonshot",
        "body": "K2.5: ¥12 / 1M tokens"
      },
      {
        "title": "OpenAI",
        "body": "GPT-4o: $2.5 / $10 per 1M\nGPT-4o-mini: $0.15 / $0.6 per 1M\nGPT-3.5-turbo: $0.5 / $1.5 per 1M"
      },
      {
        "title": "Anthropic",
        "body": "Claude 3.5 Sonnet: $3 / $15 per 1M\nClaude 3 Opus: $15 / $75 per 1M\nClaude 3 Haiku: $0.25 / $1.25 per 1M"
      },
      {
        "title": "Google Gemini",
        "body": "Gemini 1.5 Pro: $3.5 / $10.5 per 1M\nGemini 1.5 Flash: $0.35 / $1.05 per 1M"
      },
      {
        "title": "Ollama",
        "body": "Local execution: FREE"
      },
      {
        "title": "Token 管家",
        "body": "通用 LLM Token 管理工具，支持主动监控和数据分析。"
      },
      {
        "title": "使用场景",
        "body": "在以下情况使用此 skill：\n\n监控 LLM API token 使用和费用\n获取省钱优化建议\n设置自动余额提醒\n追踪多会话使用模式\n生成每日/每周使用报告"
      },
      {
        "title": "快速开始",
        "body": "cd /path/to/token-manager\nexport MOONSHOT_API_KEY=\"your-api-key\"\n\n# 生成报告\nnode scripts/manager.js report 11000 146 42000 200000 off 9.26 moonshot kimi-k2.5"
      },
      {
        "title": "1. 使用监控",
        "body": "实时会话分析，提供省钱建议。"
      },
      {
        "title": "2. 定时提醒 (P0)",
        "body": "自动余额监控，主动通知。"
      },
      {
        "title": "3. 工具集成 (P1)",
        "body": "注册为 OpenClaw 工具，无缝使用。"
      },
      {
        "title": "4. 跨会话分析 (P2)",
        "body": "追踪消费模式，生成报告。"
      },
      {
        "title": "支持的提供商",
        "body": "提供商余额查询Token 估算价格Kimi/Moonshot✅ API✅ API¥12/百万OpenAI❌ 控制台❌ 估算USD/百万Anthropic/Claude❌ 控制台❌ 估算USD/百万Google/Gemini❌ 控制台❌ 估算USD/百万Ollama/本地N/A 免费N/A免费"
      },
      {
        "title": "上下文管理",
        "body": "场景建议操作上下文 > 80%🚨 紧急：必须立即压缩/compact上下文 > 50%📊 建议：适时压缩/compact会话 > 50k tokens⚠️ 警告：立即拆分任务/spawn会话 > 20k tokens💡 提示：大任务使用子代理/spawn"
      },
      {
        "title": "推理优化",
        "body": "场景建议操作Reasoning 开启 + 小任务 (<5k tokens)💡 可关闭节省 20-30%/thinking offReasoning 开启 + 复杂任务✅ 保持开启确保质量保持"
      },
      {
        "title": "提供商特定建议",
        "body": "场景建议余额 < ¥5🚨 开启省钱模式，避免大任务使用 GPT-4💡 考虑 GPT-4o-mini 省 10 倍使用 Claude Opus💡 考虑 Claude Sonnet 省 5 倍运行 Ollama🎉 免费！无 API 费用"
      },
      {
        "title": "管理器（核心）",
        "body": "node scripts/manager.js report <输入tokens> <输出tokens> <上下文已用> <上下文上限> <推理状态> [余额] [提供商] [模型] [apiKey]\nnode scripts/manager.js balance [提供商] [apiKey]\nnode scripts/manager.js estimate <提供商> <输入tokens> <输出tokens> [模型]\nnode scripts/manager.js providers\nnode scripts/manager.js history"
      },
      {
        "title": "调度器 (P0 - 定时提醒)",
        "body": "# 检查余额，低于阈值时提醒\nnode scripts/scheduler.js check <提供商> <阈值>\n\n# 查看提醒统计\nnode scripts/scheduler.js stats"
      },
      {
        "title": "会话追踪器 (P2 - 分析)",
        "body": "# 记录会话\nnode scripts/session-tracker.js record <提供商> <模型> <输入tokens> <输出tokens> <费用> [货币]\n\n# 生成报告\nnode scripts/session-tracker.js daily [日期]\nnode scripts/session-tracker.js weekly\nnode scripts/session-tracker.js recommend"
      },
      {
        "title": "P0: 定时监控与提醒",
        "body": "使用 cron 设置自动余额监控。"
      },
      {
        "title": "设置定时任务",
        "body": "# 每小时检查，低于 ¥5 时提醒\nopenclaw cron add \\\n  --name \"token-balance-check\" \\\n  --schedule \"0 * * * *\" \\\n  --command \"cd /path/to/token-manager && node scripts/scheduler.js check moonshot 5\""
      },
      {
        "title": "提醒规则",
        "body": "条件动作冷却时间余额 < 阈值发送提醒1 小时余额 < ¥1发送紧急提醒30 分钟24 小时内 3 次提醒建议充值-"
      },
      {
        "title": "提醒输出",
        "body": "触发时输出 JSON：\n\n{\n  \"alert\": true,\n  \"balance\": 3.50,\n  \"threshold\": 5,\n  \"messages\": {\n    \"en\": \"🚨 [URGENT] Token Manager Alert...\",\n    \"cn\": \"🚨 [紧急] Token 管家提醒...\"\n  }\n}"
      },
      {
        "title": "P1: 工具集成",
        "body": "注册为 OpenClaw 工具直接使用。"
      },
      {
        "title": "工具配置",
        "body": "添加到 openclaw.json：\n\n{\n  \"tools\": {\n    \"token_status\": {\n      \"command\": \"cd /path/to/token-manager && node scripts/manager.js report\",\n      \"description\": \"Check current token usage and costs\"\n    },\n    \"token_balance\": {\n      \"command\": \"cd /path/to/token-manager && node scripts/manager.js balance\",\n      \"description\": \"Query account balance\"\n    }\n  }\n}"
      },
      {
        "title": "注册后使用",
        "body": "# 直接命令\nopenclaw tool token_status 11000 146 42000 200000 off 9.26 moonshot\nopenclaw tool token_balance moonshot"
      },
      {
        "title": "P2: 跨会话追踪",
        "body": "追踪多会话使用模式。"
      },
      {
        "title": "记录会话",
        "body": "自动或手动记录每个会话：\n\nnode scripts/session-tracker.js record moonshot kimi-k2.5 5000 500 0.06 CNY"
      },
      {
        "title": "每日报告",
        "body": "node scripts/session-tracker.js daily\n# 输出：总 token、费用、会话数、提供商分布"
      },
      {
        "title": "每周报告",
        "body": "node scripts/session-tracker.js weekly\n# 输出：7 天摘要及趋势分析"
      },
      {
        "title": "智能建议",
        "body": "node scripts/session-tracker.js recommend\n# 分析模式并提供优化建议"
      },
      {
        "title": "环境变量",
        "body": "MOONSHOT_API_KEY - Kimi/Moonshot API 密钥\nOPENAI_API_KEY - OpenAI API 密钥（可选）\nANTHROPIC_API_KEY - Anthropic API 密钥（可选）"
      },
      {
        "title": "安全说明",
        "body": "API 密钥仅从环境变量读取\n所有数据本地存储在 .data/ 目录\n无数据上传到第三方服务器\n网络请求仅访问官方 LLM API\n提醒状态本地持久化，带冷却逻辑"
      },
      {
        "title": "Kimi/Moonshot",
        "body": "K2.5: ¥12 / 百万 tokens"
      },
      {
        "title": "OpenAI",
        "body": "GPT-4o: $2.5 / $10 每百万\nGPT-4o-mini: $0.15 / $0.6 每百万\nGPT-3.5-turbo: $0.5 / $1.5 每百万"
      },
      {
        "title": "Anthropic",
        "body": "Claude 3.5 Sonnet: $3 / $15 每百万\nClaude 3 Opus: $15 / $75 每百万\nClaude 3 Haiku: $0.25 / $1.25 每百万"
      },
      {
        "title": "Google Gemini",
        "body": "Gemini 1.5 Pro: $3.5 / $10.5 每百万\nGemini 1.5 Flash: $0.35 / $1.05 每百万"
      },
      {
        "title": "Ollama",
        "body": "本地运行：免费"
      }
    ],
    "body": "Token Manager\n\nUniversal LLM Token Manager with proactive monitoring and analytics.\n\nWhen to Use\n\nUse this skill when you need to:\n\nMonitor LLM API token usage and costs\nGet cost-saving recommendations\nSet up automated balance alerts\nTrack usage across multiple sessions\nGenerate daily/weekly usage reports\nQuick Start\ncd /path/to/token-manager\nexport MOONSHOT_API_KEY=\"your-api-key\"\n\n# Generate report\nnode scripts/manager.js report 11000 146 42000 200000 off 9.26 moonshot kimi-k2.5\n\nCore Features\n1. Usage Monitoring\n\nReal-time session analysis with cost-saving suggestions.\n\n2. Scheduled Alerts (P0)\n\nAutomatic balance monitoring with proactive notifications.\n\n3. Built-in Tool Integration (P1)\n\nRegister as OpenClaw tool for seamless usage.\n\n4. Cross-Session Analytics (P2)\n\nTrack spending patterns and generate reports.\n\nSupported Providers\nProvider\tBalance Query\tToken Estimate\tPricing\nKimi/Moonshot\t✅ API\t✅ API\t¥12/1M tokens\nOpenAI\t❌ Console\t❌ Approx\tUSD/1M tokens\nAnthropic/Claude\t❌ Console\t❌ Approx\tUSD/1M tokens\nGoogle/Gemini\t❌ Console\t❌ Approx\tUSD/1M tokens\nOllama/Local\tN/A Free\tN/A\tFREE\nCost-Saving Recommendations\nContext Management\nScenario\tRecommendation\tAction\nContext > 80%\t🚨 Critical: Must compact immediately\t/compact\nContext > 50%\t📊 Suggest: Consider compacting\t/compact\nSession > 50k tokens\t⚠️ Warning: Split tasks now\t/spawn\nSession > 20k tokens\t💡 Tip: Use sub-agents for large tasks\t/spawn\nReasoning Optimization\nScenario\tRecommendation\tAction\nReasoning ON + small task (<5k tokens)\t💡 Can disable to save 20-30%\t/thinking off\nReasoning ON + complex task\t✅ Keep on for quality\tKeep\nProvider-Specific Tips\nScenario\tRecommendation\nBalance < ¥5\t🚨 Enable save mode, avoid large tasks\nUsing GPT-4\t💡 Consider GPT-4o-mini for 10x savings\nUsing Claude Opus\t💡 Consider Claude Sonnet for 5x savings\nRunning Ollama\t🎉 Free! No API costs\nCommands\nManager (Core)\nnode scripts/manager.js report <tokensIn> <tokensOut> <contextUsed> <contextMax> <thinking> [balance] [provider] [model] [apiKey]\nnode scripts/manager.js balance [provider] [apiKey]\nnode scripts/manager.js estimate <provider> <inputTokens> <outputTokens> [model]\nnode scripts/manager.js providers\nnode scripts/manager.js history\n\nScheduler (P0 - Cron Alerts)\n# Check balance and alert if below threshold\nnode scripts/scheduler.js check <provider> <threshold>\n\n# View alert statistics\nnode scripts/scheduler.js stats\n\nSession Tracker (P2 - Analytics)\n# Record session for tracking\nnode scripts/session-tracker.js record <provider> <model> <tokensIn> <tokensOut> <cost> [currency]\n\n# Generate reports\nnode scripts/session-tracker.js daily [date]\nnode scripts/session-tracker.js weekly\nnode scripts/session-tracker.js recommend\n\nP0: Scheduled Monitoring & Alerts\n\nSetup automatic balance monitoring with cron jobs.\n\nSetup Cron Job\n# Check every hour, alert if below ¥5\nopenclaw cron add \\\n  --name \"token-balance-check\" \\\n  --schedule \"0 * * * *\" \\\n  --command \"cd /path/to/token-manager && node scripts/scheduler.js check moonshot 5\"\n\nAlert Rules\nCondition\tAction\tCooldown\nBalance < threshold\tSend alert\t1 hour\nBalance < ¥1\tSend urgent alert\t30 min\n3 alerts in 24h\tSuggest adding funds\t-\nAlert Output\n\nWhen triggered, outputs JSON:\n\n{\n  \"alert\": true,\n  \"balance\": 3.50,\n  \"threshold\": 5,\n  \"messages\": {\n    \"en\": \"🚨 [URGENT] Token Manager Alert...\",\n    \"cn\": \"🚨 [紧急] Token 管家提醒...\"\n  }\n}\n\nP1: Tool Integration\n\nRegister as OpenClaw tool for direct usage.\n\nTool Configuration\n\nAdd to openclaw.json:\n\n{\n  \"tools\": {\n    \"token_status\": {\n      \"command\": \"cd /path/to/token-manager && node scripts/manager.js report\",\n      \"description\": \"Check current token usage and costs\"\n    },\n    \"token_balance\": {\n      \"command\": \"cd /path/to/token-manager && node scripts/manager.js balance\",\n      \"description\": \"Query account balance\"\n    }\n  }\n}\n\nUsage After Registration\n# Direct commands\nopenclaw tool token_status 11000 146 42000 200000 off 9.26 moonshot\nopenclaw tool token_balance moonshot\n\nP2: Cross-Session Tracking\n\nTrack usage patterns across multiple sessions.\n\nRecording Sessions\n\nAutomatically or manually record each session:\n\nnode scripts/session-tracker.js record moonshot kimi-k2.5 5000 500 0.06 CNY\n\nDaily Report\nnode scripts/session-tracker.js daily\n# Output: Total tokens, cost, session count, provider breakdown\n\nWeekly Report\nnode scripts/session-tracker.js weekly\n# Output: 7-day summary with trend analysis\n\nSmart Recommendations\nnode scripts/session-tracker.js recommend\n# Analyzes patterns and suggests optimizations\n\nEnvironment Variables\nMOONSHOT_API_KEY - Kimi/Moonshot API key\nOPENAI_API_KEY - OpenAI API key (optional)\nANTHROPIC_API_KEY - Anthropic API key (optional)\nSecurity\nAPI keys read from environment variables only\nAll data stored locally in .data/ directory\nNo data uploaded to third-party servers\nNetwork requests only to official LLM APIs\nAlert state persisted locally with cooldown logic\nPricing Reference\nKimi/Moonshot\nK2.5: ¥12 / 1M tokens\nOpenAI\nGPT-4o: $2.5 / $10 per 1M\nGPT-4o-mini: $0.15 / $0.6 per 1M\nGPT-3.5-turbo: $0.5 / $1.5 per 1M\nAnthropic\nClaude 3.5 Sonnet: $3 / $15 per 1M\nClaude 3 Opus: $15 / $75 per 1M\nClaude 3 Haiku: $0.25 / $1.25 per 1M\nGoogle Gemini\nGemini 1.5 Pro: $3.5 / $10.5 per 1M\nGemini 1.5 Flash: $0.35 / $1.05 per 1M\nOllama\nLocal execution: FREE\nToken 管家\n\n通用 LLM Token 管理工具，支持主动监控和数据分析。\n\n使用场景\n\n在以下情况使用此 skill：\n\n监控 LLM API token 使用和费用\n获取省钱优化建议\n设置自动余额提醒\n追踪多会话使用模式\n生成每日/每周使用报告\n快速开始\ncd /path/to/token-manager\nexport MOONSHOT_API_KEY=\"your-api-key\"\n\n# 生成报告\nnode scripts/manager.js report 11000 146 42000 200000 off 9.26 moonshot kimi-k2.5\n\n核心功能\n1. 使用监控\n\n实时会话分析，提供省钱建议。\n\n2. 定时提醒 (P0)\n\n自动余额监控，主动通知。\n\n3. 工具集成 (P1)\n\n注册为 OpenClaw 工具，无缝使用。\n\n4. 跨会话分析 (P2)\n\n追踪消费模式，生成报告。\n\n支持的提供商\n提供商\t余额查询\tToken 估算\t价格\nKimi/Moonshot\t✅ API\t✅ API\t¥12/百万\nOpenAI\t❌ 控制台\t❌ 估算\tUSD/百万\nAnthropic/Claude\t❌ 控制台\t❌ 估算\tUSD/百万\nGoogle/Gemini\t❌ 控制台\t❌ 估算\tUSD/百万\nOllama/本地\tN/A 免费\tN/A\t免费\n省钱优化建议\n上下文管理\n场景\t建议\t操作\n上下文 > 80%\t🚨 紧急：必须立即压缩\t/compact\n上下文 > 50%\t📊 建议：适时压缩\t/compact\n会话 > 50k tokens\t⚠️ 警告：立即拆分任务\t/spawn\n会话 > 20k tokens\t💡 提示：大任务使用子代理\t/spawn\n推理优化\n场景\t建议\t操作\nReasoning 开启 + 小任务 (<5k tokens)\t💡 可关闭节省 20-30%\t/thinking off\nReasoning 开启 + 复杂任务\t✅ 保持开启确保质量\t保持\n提供商特定建议\n场景\t建议\n余额 < ¥5\t🚨 开启省钱模式，避免大任务\n使用 GPT-4\t💡 考虑 GPT-4o-mini 省 10 倍\n使用 Claude Opus\t💡 考虑 Claude Sonnet 省 5 倍\n运行 Ollama\t🎉 免费！无 API 费用\n命令\n管理器（核心）\nnode scripts/manager.js report <输入tokens> <输出tokens> <上下文已用> <上下文上限> <推理状态> [余额] [提供商] [模型] [apiKey]\nnode scripts/manager.js balance [提供商] [apiKey]\nnode scripts/manager.js estimate <提供商> <输入tokens> <输出tokens> [模型]\nnode scripts/manager.js providers\nnode scripts/manager.js history\n\n调度器 (P0 - 定时提醒)\n# 检查余额，低于阈值时提醒\nnode scripts/scheduler.js check <提供商> <阈值>\n\n# 查看提醒统计\nnode scripts/scheduler.js stats\n\n会话追踪器 (P2 - 分析)\n# 记录会话\nnode scripts/session-tracker.js record <提供商> <模型> <输入tokens> <输出tokens> <费用> [货币]\n\n# 生成报告\nnode scripts/session-tracker.js daily [日期]\nnode scripts/session-tracker.js weekly\nnode scripts/session-tracker.js recommend\n\nP0: 定时监控与提醒\n\n使用 cron 设置自动余额监控。\n\n设置定时任务\n# 每小时检查，低于 ¥5 时提醒\nopenclaw cron add \\\n  --name \"token-balance-check\" \\\n  --schedule \"0 * * * *\" \\\n  --command \"cd /path/to/token-manager && node scripts/scheduler.js check moonshot 5\"\n\n提醒规则\n条件\t动作\t冷却时间\n余额 < 阈值\t发送提醒\t1 小时\n余额 < ¥1\t发送紧急提醒\t30 分钟\n24 小时内 3 次提醒\t建议充值\t-\n提醒输出\n\n触发时输出 JSON：\n\n{\n  \"alert\": true,\n  \"balance\": 3.50,\n  \"threshold\": 5,\n  \"messages\": {\n    \"en\": \"🚨 [URGENT] Token Manager Alert...\",\n    \"cn\": \"🚨 [紧急] Token 管家提醒...\"\n  }\n}\n\nP1: 工具集成\n\n注册为 OpenClaw 工具直接使用。\n\n工具配置\n\n添加到 openclaw.json：\n\n{\n  \"tools\": {\n    \"token_status\": {\n      \"command\": \"cd /path/to/token-manager && node scripts/manager.js report\",\n      \"description\": \"Check current token usage and costs\"\n    },\n    \"token_balance\": {\n      \"command\": \"cd /path/to/token-manager && node scripts/manager.js balance\",\n      \"description\": \"Query account balance\"\n    }\n  }\n}\n\n注册后使用\n# 直接命令\nopenclaw tool token_status 11000 146 42000 200000 off 9.26 moonshot\nopenclaw tool token_balance moonshot\n\nP2: 跨会话追踪\n\n追踪多会话使用模式。\n\n记录会话\n\n自动或手动记录每个会话：\n\nnode scripts/session-tracker.js record moonshot kimi-k2.5 5000 500 0.06 CNY\n\n每日报告\nnode scripts/session-tracker.js daily\n# 输出：总 token、费用、会话数、提供商分布\n\n每周报告\nnode scripts/session-tracker.js weekly\n# 输出：7 天摘要及趋势分析\n\n智能建议\nnode scripts/session-tracker.js recommend\n# 分析模式并提供优化建议\n\n环境变量\nMOONSHOT_API_KEY - Kimi/Moonshot API 密钥\nOPENAI_API_KEY - OpenAI API 密钥（可选）\nANTHROPIC_API_KEY - Anthropic API 密钥（可选）\n安全说明\nAPI 密钥仅从环境变量读取\n所有数据本地存储在 .data/ 目录\n无数据上传到第三方服务器\n网络请求仅访问官方 LLM API\n提醒状态本地持久化，带冷却逻辑\n价格参考\nKimi/Moonshot\nK2.5: ¥12 / 百万 tokens\nOpenAI\nGPT-4o: $2.5 / $10 每百万\nGPT-4o-mini: $0.15 / $0.6 每百万\nGPT-3.5-turbo: $0.5 / $1.5 每百万\nAnthropic\nClaude 3.5 Sonnet: $3 / $15 每百万\nClaude 3 Opus: $15 / $75 每百万\nClaude 3 Haiku: $0.25 / $1.25 每百万\nGoogle Gemini\nGemini 1.5 Pro: $3.5 / $10.5 每百万\nGemini 1.5 Flash: $0.35 / $1.05 每百万\nOllama\n本地运行：免费"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/kelegele/token-manager",
    "publisherUrl": "https://clawhub.ai/kelegele/token-manager",
    "owner": "kelegele",
    "version": "1.2.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/token-manager",
    "downloadUrl": "https://openagent3.xyz/downloads/token-manager",
    "agentUrl": "https://openagent3.xyz/skills/token-manager/agent",
    "manifestUrl": "https://openagent3.xyz/skills/token-manager/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/token-manager/agent.md"
  }
}