← 返回
AI智能 中文

ClawCost

Track OpenClaw agent costs. Check daily/weekly spending and model breakdown.
{ "answer": "追踪OpenClaw代理成本。查看每日/每周支出及模型明细。" }
shallify
AI智能 clawhub v1.0.2 1 版本 99901.9 Key: 无需
★ 0
Stars
📥 1,018
下载
💾 41
安装
1
版本
#latest

概述

ClawCost

Run this command:

python3 {baseDir}/scripts/clawcost.py --budget 10

Output

JSON with:

  • balance: {initial, spent, remaining} or null
  • today: cost, budget, pct
  • week: total week cost
  • total: all-time cost, tokens
  • models: breakdown all-time
  • models_today: breakdown for today only
  • daily: cost per day (last 7 days)

Set Balance

User sets INITIAL balance (when they top up):

python3 {baseDir}/scripts/clawcost.py --set-balance 50.00

Remaining auto-calculates: initial - total_spent

How to Present

Tone: Friendly, like a helpful assistant checking expenses. Use emojis sparingly.

Format: Use tree-style (├ └) for clean output:

💰 clawleaks
├ Balance $42.98 / $50 remaining
├ Today   $1.36 / $10 (14%) ✅
├ Week    $7.02
└ Total   $7.02 (15.5M tok)

📈 Sonnet $3.99 (57%) • Haiku $2.06 (29%) • Opus $0.97 (14%)

Rules:

  • Skip $0 models
  • Add brief insight ("Opus only 14%, nice savings 👍")

Alerts (IMPORTANT):

  • If today.pct > 80%: Start with ⚠️ "Warning: Daily budget {pct}% used!"
  • If today.pct > 100%: Start with 🚨 "OVER BUDGET! ${cost} spent"
  • If balance.remaining < 5: Warn "💸 Low balance: ${remaining} left"
  • If balance is null: Suggest "Set initial balance with --set-balance"
  • If budget is fine: End with ✅

Contextual:

  • Quick question → short answer
  • Wants detail → full breakdown + daily
  • Over budget → always show warning first, suggest switching to Haiku

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-29 04:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,362 📥 319,004
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 714 📥 244,121
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 839 📥 213,456