model-usage

Analyze CodexBar cost logs to report per-model usage and costs.

46|6|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/aresbit/MateBot --skill model-usage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-usage
Source: https://github.com/aresbit/MateBot/tree/main/skills/model-usage
Command: npx skills add https://github.com/aresbit/MateBot --skill model-usage

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill analyzes CodexBar's local cost logs to provide per-model usage and cost summaries for Codex and Claude, enabling cost-aware decision-making.

Core Features & Use Cases

  • Current model usage: identify the current most relevant model from daily breakdowns and choose it as the primary usage metric.
  • All-model breakdown: aggregate per-model costs across daily entries to reveal which models incur the highest costs.
  • Inputs and outputs: accept CodexBar JSON cost data or a JSON file and emit concise text or JSON summaries suitable for dashboards or automation.

Quick Start

Use the model-usage tool to summarize per-model costs from CodexBar's local logs:

  • python {baseDir}/scripts/model_usage.py --provider codex --mode current
  • python {baseDir}/scripts/model_usage.py --provider codex --mode all
  • cat /path/to/cost.json | python {baseDir}/scripts/model_usage.py --mode all --input -

Frequently Asked Questions about model-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze per-model usage and costs from CodexBar local logs?

You can analyze per-model usage and costs by running the model_usage.py script with either a CodexBar JSON file or by invoking the CLI directly, selecting current or all-model modes to aggregate daily breakdowns into concise summaries.

What is the difference between current-model and all-model breakdown in cost analysis?

Current-model breakdown identifies the most relevant active model from daily entries as the primary usage metric, while all-model breakdown aggregates per-model costs across all daily entries to reveal which models incur the highest total expenses.

Do I need CodexBar CLI installed to generate per-model cost summaries?

Yes, you need the CodexBar CLI installed to automatically generate fresh cost data, though you can alternatively pipe an existing cost JSON file directly into the script to bypass the CLI dependency.

Can I use a JSON file as input instead of running the CodexBar CLI for cost analysis?

Yes, you can pass an existing cost JSON file via standard input or file path to compute per-model usage totals and latest day costs without executing the CodexBar CLI directly.

How do I identify which Claude or Codex models are incurring the highest costs?

You can identify the highest cost models by running the script in all-model mode, which aggregates per-model costs across all daily breakdown entries to reveal the most expensive Claude and Codex models.

What format are the per-model usage summaries output in?

The script outputs concise text or JSON summaries computed from daily breakdowns and modelBreakdowns, making the results suitable for direct integration into dashboards or automation pipelines.