← 返回
数据分析 中文

CostLens

Calculate OpenClaw usage cost from offline event logs, apply budget thresholds, and export operator-facing reports.
根据离线事件日志计算 OpenClaw 使用成本,应用预算阈值,并导出运维报告。
mike007jd
数据分析 clawhub v1.0.1 2 版本 100000 Key: 无需
★ 0
Stars
📥 798
下载
💾 20
安装
2
版本
#budget#cost#latest#llm#monitoring#openclaw

概述

CostLens

Turn JSON usage events into cost summaries, budget checks, and offline reports.

When to use

  • You already have token usage events and need a quick spend summary.
  • You want a simple budget gate in local automation or CI.
  • You need an exportable JSON report without relying on a hosted billing dashboard.

Commands

node {baseDir}/bin/costlens.js monitor --events ./events.json --budget 10.00 --threshold 80
node {baseDir}/bin/costlens.js budget check --events ./events.json --budget 5.00 --format json
node {baseDir}/bin/costlens.js report --events ./events.json --out ./reports/cost-report.json

Built-in default rates

ModelInput/1kOutput/1k
---------
gpt-4.1$0.01$0.03
gpt-4o-mini$0.00015$0.0006
claude-3-5-sonnet$0.003$0.015
default$0.002$0.008

Events can override the defaults with inputCostPer1k and outputCostPer1k.

Event shape

[
  {
    "model": "gpt-4.1",
    "promptTokens": 1500,
    "completionTokens": 800,
    "timestamp": "2026-02-26T10:00:00Z"
  }
]

Output

  • Total calls, total tokens, and total cost
  • Per-model breakdowns for calls, tokens, and cost
  • Per-day spend trends
  • Budget usage percentage and alert level (ok, warning, or critical)

Boundaries

  • Pricing is based on built-in defaults plus per-event overrides. It is not a live pricing feed.
  • CostLens is optimized for offline JSON analysis, not streaming metering or invoice reconciliation.

版本历史

共 2 个版本

  • v1.0.1 当前
    2026-05-03 03:32 安全 安全
  • v1.0.0
    2026-03-29 19:07 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 64,850
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 366 📥 139,952
security-compliance

Safe Install

mike007jd
通过策略验证、ClawShield 扫描、快照存储与回滚控制来安装 OpenClaw 技能。
★ 0 📥 809