model-usage
它能做什么
它指导 AI 智能体读取 CodexBar 费用日志,并汇总每个模型的使用费用。它适合想知道自己为哪些 AI 模型付了多少钱的人。
适用场景
- ✓你想知道最近使用 Codex 或 Claude 花了多少钱的时候。
- ✓你想按模型查看花费明细的时候。
- ✓你需要在日志中查看某一个特定模型的费用的时候。
技能链接
https://github.com/openclaw/openclaw/blob/main/skills/model-usage/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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
- Fetch cost JSON via CodexBar CLI or pass a JSON file.
- 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
modelsUsedwhen 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
--inputwith 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.mdfor 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
评论
- …
同一仓库的更多技能
discord-user-post
394k让你的智能体通过 Discord 桌面应用,以你的身份发送你已批准的消息,并在发送前确认具体频道。
discrawl
394k让你的智能体搜索和总结本地保存的 Discord 消息档案,查看档案的新旧程度,并阅读私信。
gitcrawl
394k让你的智能体搜索已保存的 GitHub 议题和拉取请求档案,将重复内容归类,并在 GitHub 上核实它们的当前状态。
graincrawl
394k让你的智能体搜索已保存的 Granola 会议记录和转写稿,查看它们的新旧程度,并统计某段时间内的数量。