← 返回
未分类 中文

Cost Guardian by Dexter Labs

Monitor and control OpenClaw API costs. Tracks token usage across all sessions, estimates spend by model, alerts on budget overruns, and recommends cheaper m...
监控并控制 OpenClaw API 费用。追踪所有会话的 token 使用量,按模型估算支出,超预算时提醒,并推荐更廉价的模型。
tso1079 tso1079 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 339
下载
💾 0
安装
1
版本
#latest

概述

Cost Guardian — OpenClaw Cost Monitor & Optimizer

Know what your agent costs. Before it becomes a problem.

When to Use

USE this skill when:

  • "How much am I spending?"
  • "What's my API cost?"
  • "Which sessions cost the most?"
  • "Am I over budget?"
  • "How can I reduce costs?"
  • Setting up daily/weekly cost reports
  • Optimizing model usage for crons and automated tasks

DON'T use this skill for:

  • Billing issues with Anthropic/OpenAI (contact providers directly)
  • Managing API keys (use OpenClaw's secrets system)

Quick Start

Get a Cost Report (All Time)

python3 scripts/cost-report.py --all

Last 24 Hours

python3 scripts/cost-report.py --hours 24

With Budget Alert ($5/day)

python3 scripts/cost-report.py --budget 5.00

JSON Output (for dashboards)

python3 scripts/cost-report.py --all --json

What It Reports

  • Estimated cost by model and session
  • Token breakdown — input, output, context (cached)
  • Top spending sessions — find what's burning tokens
  • Model efficiency — how much you'd save switching routine tasks to cheaper models
  • Budget alerts — 🟡 at 80% and 🔴 when over budget
  • Cron cost tracking — automated jobs often account for 30-50% of spend

Setting Up Automated Reports

Daily Cost Report via Cron

Tell your agent:

> "Set up a daily cost report that runs at 8 AM and alerts me if I'm over $5/day"

The agent should create a cron job that:

  1. Runs python3 /scripts/cost-report.py --hours 24 --budget 5.00
  2. Delivers the report via your preferred channel

Model Optimization

The report flags when expensive models (Opus) are being used for routine tasks that Sonnet handles fine:

  • Email checking crons → Sonnet
  • Heartbeat checks → Sonnet
  • Site health monitoring → Sonnet or Haiku
  • Complex reasoning, strategy, writing → Keep on Opus

Supported Models & Pricing

ModelInput $/1MOutput $/1MCache $/1M
-----------------------------------------
Claude Opus 4$15.00$75.00$1.875
Claude Sonnet 4$3.00$15.00$0.30
Claude Haiku 3.5$0.80$4.00$0.08
GPT-4o$2.50$10.00$1.25
GPT-4.1$2.00$8.00$0.50
GPT-4.1-mini$0.40$1.60$0.10
GPT-4.1-nano$0.10$0.40$0.025
OpenRouter/auto~$3.00~$15.00~$0.30

Pricing is estimated and may vary. Update scripts/cost-report.py MODEL_PRICING dict for current rates.

Roadmap

  • [ ] Auto model-switching recommendations per session type
  • [ ] Historical trend tracking (daily/weekly/monthly)
  • [ ] Cost anomaly detection (sudden spikes)
  • [ ] Per-project cost allocation
  • [ ] Web dashboard with charts

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 08:25 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,188 📥 959,483
ai-agent

Find Skills

root
帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时
★ 1,545 📥 592,767
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 881 📥 357,717