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
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 modelsUsed when breakdowns are missing.
Override with --model <name> when you need a specific model.
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.
1---2name: model-usage3description: Model usage4---5# Model usage67## Overview89Get 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.1011TODO: add Linux CLI support guidance once CodexBar CLI install path is documented for Linux.1213## Quick start14151. Fetch cost JSON via CodexBar CLI or pass a JSON file.162. Use the bundled script to summarize by model.1718```bash19python {baseDir}/scripts/model_usage.py --provider codex --mode current20python {baseDir}/scripts/model_usage.py --provider codex --mode all21python {baseDir}/scripts/model_usage.py --provider claude --mode all --format json --pretty22```2324## Current model logic2526- Uses the most recent daily row with `modelBreakdowns`.27- Picks the model with the highest cost in that row.28- Falls back to the last entry in `modelsUsed` when breakdowns are missing.29- Override with `--model <name>` when you need a specific model.3031## Inputs3233- Default: runs `codexbar cost --format json --provider <codex|claude>`.34- File or stdin:3536```bash37codexbar cost --provider codex --format json > /tmp/cost.json38python {baseDir}/scripts/model_usage.py --input /tmp/cost.json --mode all39cat /tmp/cost.json | python {baseDir}/scripts/model_usage.py --input - --mode current40```4142## Output4344- Text (default) or JSON (`--format json --pretty`).45- Values are cost-only per model; tokens are not split by model in CodexBar output.4647## References4849- Read `references/codexbar-cli.md` for CLI flags and cost JSON fields.50
Run npx skillmds@latest add comeonoliver/model-usage in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Model usage It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
ComeOnOliver (@comeonoliver) published this skill. Their other Agent Skills are listed on their SkillMD profile.