Token usage analytics and budget alerting for the GreenClaw inference proxy. Query spending, set budget alerts, and track savings.
技能名称: greenclaw-usage
详细描述:
你可以使用 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
greenclaw 命令行工具使用 GREENCLAWTELEMETRYDB 环境变量指定 SQLite 数据库路径(默认为 data/telemetry.db)。
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 greenclaw-1776116533 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 greenclaw-1776116533 技能
skillhub install greenclaw-1776116533
文件大小: 1.59 KB | 发布时间: 2026-4-15 12:57