← 返回 Skills 市场
mike007jd

CostLens

作者 mike007jd · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
508
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install costlens
功能描述
Calculate OpenClaw usage cost from offline event logs, apply budget thresholds, and export operator-facing reports.
使用说明 (SKILL.md)

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

Model Input/1k Output/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.
安全使用建议
This skill appears to do what it says: local offline analysis of JSON token events using Node.js. Before installing/running, ensure you have Node 18+ and run it only on event files you trust because it will read the events JSON and write report files to the paths you provide. It does not contact external services or require credentials. If you plan to let an autonomous agent invoke this skill, remember it can read any events file path you pass to it — avoid passing files that contain secrets or unrelated data.
功能分析
Type: OpenClaw Skill Name: costlens Version: 1.0.1 The 'costlens' skill is a legitimate utility for calculating LLM token costs and checking budgets from offline JSON event logs. The code in src/index.js performs standard file I/O and arithmetic operations without any network activity, data exfiltration, or suspicious execution patterns.
能力评估
Purpose & Capability
The skill declares a Node.js CLI that reads offline JSON event files, applies local pricing, checks budgets, and exports reports — and the code, README, SKILL.md, fixtures, and tests all implement exactly that. Required binaries (node) are appropriate and proportional.
Instruction Scope
SKILL.md instructs the agent to run the local Node CLI against a local events JSON file and optionally write a report file. The runtime instructions and the implemented code only read local files, compute aggregates, and write local outputs; they do not request additional system files, environment variables, or remote endpoints.
Install Mechanism
No install spec is provided (instruction-only + included source files). This minimizes install-time risk. The repository contains only local Node source, no downloads or external installers.
Credentials
The skill declares no required environment variables, credentials, or config paths, and the code does not read environment secrets. All data inputs are explicit file paths (events, out) supplied by the user.
Persistence & Privilege
The skill does not request always:true and does not modify other skills or global agent settings. It only writes report files to paths supplied by the user.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install costlens
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /costlens 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
README and SKILL.md compliance update for OpenClaw / ClawHub alignment.
v1.0.0
Initial release
元数据
Slug costlens
版本 1.0.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

CostLens 是什么?

Calculate OpenClaw usage cost from offline event logs, apply budget thresholds, and export operator-facing reports. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 508 次。

如何安装 CostLens?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install costlens」即可一键安装,无需额外配置。

CostLens 是免费的吗?

是的,CostLens 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

CostLens 支持哪些平台?

CostLens 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 CostLens?

由 mike007jd(@mike007jd)开发并维护,当前版本 v1.0.1。

💬 留言讨论