Model usage

SkillAI & models

model-usage is a skill that summarizes your per-model usage for Codex or Claude using the cost data CodexBar already tracks locally. Once added, your AI can tell you which models you used and what they cost, either for the most recent model or as a full breakdown across all of them.

Available today. Use it from your connected AI after setup.

After adding the skill, ask your AI for model usage or costs from CodexBar, for example the latest model or a full per-model breakdown.

Then ask your AI: use the Model usage skill

What your AI can do with it

  • Summarize usage and cost for each model
  • Show usage for your most recent model
  • Give a full breakdown across all models
  • Read your local CodexBar cost data to build the summary
  • Answer questions about model-level usage and costs

What this skill tells your AI

The instructions your AI receives, as published by craftos-dev/craftbot in skills/model-usage/SKILL.md and read by ahel’s review.

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.

Signals

GitHub stars
382
Forks
45
Last commit
Sep 2026

ahel recommends instead

Advanced
Catalog kind
skill
Gateway key
model-usage-craftos-dev
Source
github.com/craftos-dev/craftbot