闲社服务运行正常AI智能体自动化平台
g

绿爪用量分析

技能标识:greenclaw-usage

Token usage analytics and budget alerting for the GreenClaw inference proxy. Query spending, set budget alerts, and track savings.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

绿爪用量分析

技能名称: greenclaw-usage

详细描述:

GreenClaw 用量分析

你可以使用 greenclaw 命令行工具查询令牌用量、成本分析以及管理预算警报。通过 npx greenclaw 运行(需先执行 pnpm install 和 pnpm build)。所有命令均输出 JSON 格式结果。

可用命令

用量查询

每日汇总:

bash
npx greenclaw usage summary --period day

每周或每月汇总:

bash
npx greenclaw usage summary --period week
npx greenclaw usage summary --period month

按模型、层级或提供商细分:

bash
npx greenclaw usage breakdown --by model --period day
npx greenclaw usage breakdown --by tier --period week
npx greenclaw usage breakdown --by provider --period month

随时间变化的趋势:

bash
npx greenclaw usage trends --period day --last 7
npx greenclaw usage trends --period week --last 4

预算警报

列出警报规则:

bash
npx greenclaw alerts list

设置每日成本预算:

bash
npx greenclaw alerts set --name 每日预算 --metric daily_cost --threshold 50 --unit usd --period day

设置每周令牌限额:

bash
npx greenclaw alerts set --name 每周令牌 --metric weekly_cost --threshold 100 --unit usd --period week

设置按模型成本上限:

bash
npx greenclaw alerts set --name gpt-4 上限 --metric permodelcost --threshold 30 --unit usd --period day --model gpt-4

立即检查警报:

bash
npx greenclaw alerts check

查看警报历史:

bash
npx greenclaw alerts history --last 10

移除警报规则:

bash
npx greenclaw alerts remove <规则ID>

原始追踪

聚合统计:

bash
npx greenclaw traces --stats

按层级或模型筛选:

bash
npx greenclaw traces --tier HEARTBEAT
npx greenclaw traces --model gpt-4o-mini

如何呈现结果

  • - 解析 JSON 输出,并以清晰可读的格式呈现
  • 对于汇总:显示总令牌数、成本、节省金额和请求数量
  • 对于细分:显示包含分组键、令牌数、成本、节省金额的表格
  • 对于警报:解释哪些规则被触发以及当前指标值
  • 美元金额四舍五入保留两位小数
  • 使用自然语言解释节省情况(例如:今天通过将 412 个请求路由到更便宜的模型,您节省了 8.91 美元)

环境

greenclaw 命令行工具使用 GREENCLAWTELEMETRYDB 环境变量指定 SQLite 数据库路径(默认为 data/telemetry.db)。

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 greenclaw-1776116533 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 greenclaw-1776116533 技能

通过命令行安装

skillhub install greenclaw-1776116533

下载

⬇ 下载 greenclaw-usage v1.0.0(免费)

文件大小: 1.59 KB | 发布时间: 2026-4-15 12:57

v1.0.0 最新 2026-4-15 12:57
Initial release of greenclaw-usage:

- Provides token usage analytics and budget alerting for the GreenClaw inference proxy.
- Includes CLI commands to query usage summaries, breakdowns, and trends.
- Enables setting and managing budget alerts for costs and token usage, with support for per-model alerts.
- Allows viewing raw trace statistics filtered by tier or model.
- Guides on presenting analytics data and savings in readable formats.
- Uses an environment variable for database configuration.
返回顶部