cli-cost-usage
它能做什么
这项技能展示如何通过命令行查看 AI 花费和令牌用量。适合想知道每次模型调用花了多少钱、钱主要花在哪里的人。
适用场景
- ✓当用户询问 AI 用量花了多少钱的时候。
- ✓当用户想按提供商、模型或日期查看令牌用量明细的时候。
- ✓当用户想导出用量报告或查看调用日志的时候。
技能链接
https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/cli-cost-usage/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我上个月在 AI 调用上花了多少钱?请按模型分组显示。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能列出按字段分组查看费用的命令,例如提供商或模型,并可限定日期范围。它还涵盖价格查询、用量查看和调用日志。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Overview
View cost breakdowns, token usage, and call logs from the CLI. Filter by provider, model, or date range. Export usage reports and inspect per-connection spending.
Quick install
npm install -g omniroute # or: npx omniroute
omniroute --version
Subcommands
cost
Flags:
--period <range>--since <date>--until <date>--group-by <field>--api-key <key>--limit <n>
Example:
omniroute cost
pricing
Example:
omniroute pricing
pricing sync
Flags:
--provider <p>--force
Example:
omniroute pricing sync
pricing list
Flags:
--provider <p>--model <m>--limit <n>
Example:
omniroute pricing list
pricing get <model>
Example:
omniroute pricing get <model>
pricing defaults
Example:
omniroute pricing defaults
pricing show
Example:
omniroute pricing show
pricing set
Flags:
--input <p>--output <p>--cache-read <p>--cache-write <p>
Example:
omniroute pricing set
pricing diff
Flags:
--model <m>
Example:
omniroute pricing diff
usage
Example:
omniroute usage
usage analytics
Flags:
--period <range>--provider <id>
Example:
omniroute usage analytics
usage budget
Example:
omniroute usage budget
usage list
Example:
omniroute usage list
usage get [scope]
Example:
omniroute usage get [scope]
usage set <amount>
Flags:
--scope <s>--period <p>
Example:
omniroute usage set <amount>
usage reset [scope]
Example:
omniroute usage reset [scope]
usage quota
Flags:
--provider <id>--check
Example:
omniroute usage quota
usage logs
Flags:
--limit <n>--search <q>--since <ts>--follow--api-key <k>
Example:
omniroute usage logs
usage utilization
Flags:
--api-key <k>
Example:
omniroute usage utilization
usage history
Flags:
--limit <n>
Example:
omniroute usage history
usage proxy-logs
Flags:
--limit <n>
Example:
omniroute usage proxy-logs
常见问题
我能只看某一个提供商的费用吗?
可以。你可以按提供商、模型或日期范围进行筛选。
我能更新所使用的价格吗?
可以。价格命令包括同步选项,以及设置自定义价格的选项。
我能导出报告吗?
可以。这项技能涵盖导出用量报告的方法。
详情
作者的原始描述
View cost breakdowns, token usage, and call logs from the CLI. Filter by provider, model, or date range. Export usage reports and inspect per-connection spending.
热度
- GitHub 星标
- 84k
- 排名
- #1402
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …