跳到正文
Skillpedia
分析与电子表格11k · #11727

model-usage

它能做什么

这项技能让 AI 使用 CodexBar 工具的本地费用日志,按模型报告你的 AI 使用费用。适合想知道哪些 AI 模型花费最多的人。

适用场景

  • ✓当你想知道最近在 Codex 或 Claude 中使用的是哪个模型时。
  • ✓当你想查看按模型划分的完整费用明细时。
  • ✓当你需要一份脚本可以读取的、按模型汇总的费用报告的时候。

技能链接

https://github.com/spinabot/brigade/blob/main/skills/model-usage/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/spinabot/brigade/blob/main/skills/model-usage/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用简单的列表告诉我,我在每个 Claude 模型上分别花了多少钱。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会读取 CodexBar 工具中的费用数据,或你提供的文件。然后它会按模型对费用进行分组,可以选择最近使用的模型,或列出所有模型,并以纯文本或 JSON 格式输出。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Model usage

Overview

Get per-model usage cost from CodexBar's local cost logs. Supports "current model" (most recent daily entry) or "all models" summaries for Codex or Claude.

TODO: add Linux CLI support guidance once CodexBar CLI install path is documented for Linux.

Quick start

  1. Fetch cost JSON via CodexBar CLI or pass a JSON file.
  2. Use the bundled script to summarize by model.
python {baseDir}/scripts/model_usage.py --provider codex --mode current
python {baseDir}/scripts/model_usage.py --provider codex --mode all
python {baseDir}/scripts/model_usage.py --provider claude --mode all --format json --pretty

Current model logic

  • Uses the most recent daily row with modelBreakdowns.
  • Picks the model with the highest cost in that row.
  • Falls back to the last entry in modelsUsed when breakdowns are missing.
  • Override with --model <name> when you need a specific model.

Inputs

  • Default: runs codexbar cost --format json --provider <codex|claude>.
  • File or stdin:
codexbar cost --provider codex --format json > /tmp/cost.json
python {baseDir}/scripts/model_usage.py --input /tmp/cost.json --mode all
cat /tmp/cost.json | python {baseDir}/scripts/model_usage.py --input - --mode current

Output

  • Text (default) or JSON (--format json --pretty).
  • Values are cost-only per model; tokens are not split by model in CodexBar output.

References

  • Read references/codexbar-cli.md for CLI flags and cost JSON fields.
常见问题

费用数据来自哪里?

来自 CodexBar 的本地费用日志,该技能通过 CodexBar 命令行工具读取。

Token 数量会按模型拆分吗?

不会。数据提供每个模型的费用,但 Token 数量不按模型拆分。

它可以改用已保存的文件吗?

可以。你可以提供已保存的费用文件,或通过管道输入数据,而不必实时运行该工具。

详情

作者的原始描述

Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.

repo: spinabot/brigade

热度

GitHub 星标
11k
排名
#11727
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能