跳到正文
Skillpedia
分析与电子表格394k · #64

model-usage

它能做什么

它指导 AI 智能体读取 CodexBar 费用日志,并汇总每个模型的使用费用。它适合想知道自己为哪些 AI 模型付了多少钱的人。

适用场景

  • ✓你想知道最近使用 Codex 或 Claude 花了多少钱的时候。
  • ✓你想按模型查看花费明细的时候。
  • ✓你需要在日志中查看某一个特定模型的费用的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“我上个月在 Claude 模型上花了多少钱?请按模型列出明细。”

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

工作原理

技能从 CodexBar 命令或你导出的文件中读取本地使用数据,然后按模型对费用进行分组。它会显示最近使用的模型,或所有模型的完整汇总。

技术内容(原始 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.

CodexBar ships CLI builds for macOS and Linux. When codexbar is on PATH, the skill reads local usage directly; the bundled Python summarizer also accepts exported CodexBar JSON through --input anywhere Python is available.

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>.
  • macOS and Linux: use the bundled Homebrew formula installer above for live local usage reads. Linux users can also use CodexBar's AUR package or official release tarballs.
  • Other platforms: use --input with exported CodexBar JSON.
  • 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 费用日志,因此它使用电脑上已有的数据或导出的文件即可工作。

它能只显示当前的模型吗?

可以。当前模式会显示最近一天记录中费用最高的模型。

它涵盖哪些 AI 服务?

它涵盖 CodexBar 中的 Codex 和 Claude 使用情况。

详情

作者的原始描述

Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns.

repo: openclaw/openclaw

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能