# Send Token Manager to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- 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.
## Suggested prompts
### New install

```text
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.
```
### Upgrade existing

```text
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.
```
## Machine-readable fields
```json
{
  "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": {
    "downloadUrl": "/downloads/token-manager",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-manager",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/manager.js",
      "scripts/scheduler.js",
      "scripts/session-tracker.js"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "token-manager",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-04T04:03:15.431Z",
      "expiresAt": "2026-05-11T04:03:15.431Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-manager",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-manager",
        "contentDisposition": "attachment; filename=\"token-manager-1.2.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "token-manager"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "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."
      ]
    }
  },
  "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"
  }
}
```
## Documentation

### Token Manager

Universal LLM Token Manager with proactive monitoring and analytics.

### When to Use

Use this skill when you need to:

Monitor LLM API token usage and costs
Get cost-saving recommendations
Set up automated balance alerts
Track usage across multiple sessions
Generate daily/weekly usage reports

### Quick Start

cd /path/to/token-manager
export MOONSHOT_API_KEY="your-api-key"

# Generate report
node scripts/manager.js report 11000 146 42000 200000 off 9.26 moonshot kimi-k2.5

### 1. Usage Monitoring

Real-time session analysis with cost-saving suggestions.

### 2. Scheduled Alerts (P0)

Automatic balance monitoring with proactive notifications.

### 3. Built-in Tool Integration (P1)

Register as OpenClaw tool for seamless usage.

### 4. Cross-Session Analytics (P2)

Track spending patterns and generate reports.

### Supported Providers

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

### Context Management

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

### Reasoning Optimization

ScenarioRecommendationActionReasoning ON + small task (<5k tokens)💡 Can disable to save 20-30%/thinking offReasoning ON + complex task✅ Keep on for qualityKeep

### Provider-Specific Tips

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

### Manager (Core)

node scripts/manager.js report <tokensIn> <tokensOut> <contextUsed> <contextMax> <thinking> [balance] [provider] [model] [apiKey]
node scripts/manager.js balance [provider] [apiKey]
node scripts/manager.js estimate <provider> <inputTokens> <outputTokens> [model]
node scripts/manager.js providers
node scripts/manager.js history

### Scheduler (P0 - Cron Alerts)

# Check balance and alert if below threshold
node scripts/scheduler.js check <provider> <threshold>

# View alert statistics
node scripts/scheduler.js stats

### Session Tracker (P2 - Analytics)

# Record session for tracking
node scripts/session-tracker.js record <provider> <model> <tokensIn> <tokensOut> <cost> [currency]

# Generate reports
node scripts/session-tracker.js daily [date]
node scripts/session-tracker.js weekly
node scripts/session-tracker.js recommend

### P0: Scheduled Monitoring & Alerts

Setup automatic balance monitoring with cron jobs.

### Setup Cron Job

# Check every hour, alert if below ¥5
openclaw cron add \\
  --name "token-balance-check" \\
  --schedule "0 * * * *" \\
  --command "cd /path/to/token-manager && node scripts/scheduler.js check moonshot 5"

### Alert Rules

ConditionActionCooldownBalance < thresholdSend alert1 hourBalance < ¥1Send urgent alert30 min3 alerts in 24hSuggest adding funds-

### Alert Output

When triggered, outputs JSON:

{
  "alert": true,
  "balance": 3.50,
  "threshold": 5,
  "messages": {
    "en": "🚨 [URGENT] Token Manager Alert...",
    "cn": "🚨 [紧急] Token 管家提醒..."
  }
}

### P1: Tool Integration

Register as OpenClaw tool for direct usage.

### Tool Configuration

Add to openclaw.json:

{
  "tools": {
    "token_status": {
      "command": "cd /path/to/token-manager && node scripts/manager.js report",
      "description": "Check current token usage and costs"
    },
    "token_balance": {
      "command": "cd /path/to/token-manager && node scripts/manager.js balance",
      "description": "Query account balance"
    }
  }
}

### Usage After Registration

# Direct commands
openclaw tool token_status 11000 146 42000 200000 off 9.26 moonshot
openclaw tool token_balance moonshot

### P2: Cross-Session Tracking

Track usage patterns across multiple sessions.

### Recording Sessions

Automatically or manually record each session:

node scripts/session-tracker.js record moonshot kimi-k2.5 5000 500 0.06 CNY

### Daily Report

node scripts/session-tracker.js daily
# Output: Total tokens, cost, session count, provider breakdown

### Weekly Report

node scripts/session-tracker.js weekly
# Output: 7-day summary with trend analysis

### Smart Recommendations

node scripts/session-tracker.js recommend
# Analyzes patterns and suggests optimizations

### Environment Variables

MOONSHOT_API_KEY - Kimi/Moonshot API key
OPENAI_API_KEY - OpenAI API key (optional)
ANTHROPIC_API_KEY - Anthropic API key (optional)

### Security

API keys read from environment variables only
All data stored locally in .data/ directory
No data uploaded to third-party servers
Network requests only to official LLM APIs
Alert state persisted locally with cooldown logic

### Kimi/Moonshot

K2.5: ¥12 / 1M tokens

### OpenAI

GPT-4o: $2.5 / $10 per 1M
GPT-4o-mini: $0.15 / $0.6 per 1M
GPT-3.5-turbo: $0.5 / $1.5 per 1M

### Anthropic

Claude 3.5 Sonnet: $3 / $15 per 1M
Claude 3 Opus: $15 / $75 per 1M
Claude 3 Haiku: $0.25 / $1.25 per 1M

### Google Gemini

Gemini 1.5 Pro: $3.5 / $10.5 per 1M
Gemini 1.5 Flash: $0.35 / $1.05 per 1M

### Ollama

Local execution: FREE

### Token 管家

通用 LLM Token 管理工具，支持主动监控和数据分析。

### 使用场景

在以下情况使用此 skill：

监控 LLM API token 使用和费用
获取省钱优化建议
设置自动余额提醒
追踪多会话使用模式
生成每日/每周使用报告

### 快速开始

cd /path/to/token-manager
export MOONSHOT_API_KEY="your-api-key"

# 生成报告
node scripts/manager.js report 11000 146 42000 200000 off 9.26 moonshot kimi-k2.5

### 1. 使用监控

实时会话分析，提供省钱建议。

### 2. 定时提醒 (P0)

自动余额监控，主动通知。

### 3. 工具集成 (P1)

注册为 OpenClaw 工具，无缝使用。

### 4. 跨会话分析 (P2)

追踪消费模式，生成报告。

### 支持的提供商

提供商余额查询Token 估算价格Kimi/Moonshot✅ API✅ API¥12/百万OpenAI❌ 控制台❌ 估算USD/百万Anthropic/Claude❌ 控制台❌ 估算USD/百万Google/Gemini❌ 控制台❌ 估算USD/百万Ollama/本地N/A 免费N/A免费

### 上下文管理

场景建议操作上下文 > 80%🚨 紧急：必须立即压缩/compact上下文 > 50%📊 建议：适时压缩/compact会话 > 50k tokens⚠️ 警告：立即拆分任务/spawn会话 > 20k tokens💡 提示：大任务使用子代理/spawn

### 推理优化

场景建议操作Reasoning 开启 + 小任务 (<5k tokens)💡 可关闭节省 20-30%/thinking offReasoning 开启 + 复杂任务✅ 保持开启确保质量保持

### 提供商特定建议

场景建议余额 < ¥5🚨 开启省钱模式，避免大任务使用 GPT-4💡 考虑 GPT-4o-mini 省 10 倍使用 Claude Opus💡 考虑 Claude Sonnet 省 5 倍运行 Ollama🎉 免费！无 API 费用

### 管理器（核心）

node scripts/manager.js report <输入tokens> <输出tokens> <上下文已用> <上下文上限> <推理状态> [余额] [提供商] [模型] [apiKey]
node scripts/manager.js balance [提供商] [apiKey]
node scripts/manager.js estimate <提供商> <输入tokens> <输出tokens> [模型]
node scripts/manager.js providers
node scripts/manager.js history

### 调度器 (P0 - 定时提醒)

# 检查余额，低于阈值时提醒
node scripts/scheduler.js check <提供商> <阈值>

# 查看提醒统计
node scripts/scheduler.js stats

### 会话追踪器 (P2 - 分析)

# 记录会话
node scripts/session-tracker.js record <提供商> <模型> <输入tokens> <输出tokens> <费用> [货币]

# 生成报告
node scripts/session-tracker.js daily [日期]
node scripts/session-tracker.js weekly
node scripts/session-tracker.js recommend

### P0: 定时监控与提醒

使用 cron 设置自动余额监控。

### 设置定时任务

# 每小时检查，低于 ¥5 时提醒
openclaw cron add \\
  --name "token-balance-check" \\
  --schedule "0 * * * *" \\
  --command "cd /path/to/token-manager && node scripts/scheduler.js check moonshot 5"

### 提醒规则

条件动作冷却时间余额 < 阈值发送提醒1 小时余额 < ¥1发送紧急提醒30 分钟24 小时内 3 次提醒建议充值-

### 提醒输出

触发时输出 JSON：

{
  "alert": true,
  "balance": 3.50,
  "threshold": 5,
  "messages": {
    "en": "🚨 [URGENT] Token Manager Alert...",
    "cn": "🚨 [紧急] Token 管家提醒..."
  }
}

### P1: 工具集成

注册为 OpenClaw 工具直接使用。

### 工具配置

添加到 openclaw.json：

{
  "tools": {
    "token_status": {
      "command": "cd /path/to/token-manager && node scripts/manager.js report",
      "description": "Check current token usage and costs"
    },
    "token_balance": {
      "command": "cd /path/to/token-manager && node scripts/manager.js balance",
      "description": "Query account balance"
    }
  }
}

### 注册后使用

# 直接命令
openclaw tool token_status 11000 146 42000 200000 off 9.26 moonshot
openclaw tool token_balance moonshot

### P2: 跨会话追踪

追踪多会话使用模式。

### 记录会话

自动或手动记录每个会话：

node scripts/session-tracker.js record moonshot kimi-k2.5 5000 500 0.06 CNY

### 每日报告

node scripts/session-tracker.js daily
# 输出：总 token、费用、会话数、提供商分布

### 每周报告

node scripts/session-tracker.js weekly
# 输出：7 天摘要及趋势分析

### 智能建议

node scripts/session-tracker.js recommend
# 分析模式并提供优化建议

### 环境变量

MOONSHOT_API_KEY - Kimi/Moonshot API 密钥
OPENAI_API_KEY - OpenAI API 密钥（可选）
ANTHROPIC_API_KEY - Anthropic API 密钥（可选）

### 安全说明

API 密钥仅从环境变量读取
所有数据本地存储在 .data/ 目录
无数据上传到第三方服务器
网络请求仅访问官方 LLM API
提醒状态本地持久化，带冷却逻辑

### Kimi/Moonshot

K2.5: ¥12 / 百万 tokens

### OpenAI

GPT-4o: $2.5 / $10 每百万
GPT-4o-mini: $0.15 / $0.6 每百万
GPT-3.5-turbo: $0.5 / $1.5 每百万

### Anthropic

Claude 3.5 Sonnet: $3 / $15 每百万
Claude 3 Opus: $15 / $75 每百万
Claude 3 Haiku: $0.25 / $1.25 每百万

### Google Gemini

Gemini 1.5 Pro: $3.5 / $10.5 每百万
Gemini 1.5 Flash: $0.35 / $1.05 每百万

### Ollama

本地运行：免费
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: kelegele
- Version: 1.2.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-04T04:03:15.431Z
- Expires at: 2026-05-11T04:03:15.431Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/token-manager)
- [Send to Agent page](https://openagent3.xyz/skills/token-manager/agent)
- [JSON manifest](https://openagent3.xyz/skills/token-manager/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/token-manager/agent.md)
- [Download page](https://openagent3.xyz/downloads/token-manager)