model-usage

Summarize CodexBar cost usage by model from exported cost JSON.

37|4|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/MerkyorLynn/Lynn --skill model-usage-merkyorlynn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-usage
Source: https://github.com/MerkyorLynn/Lynn/tree/main/skills2set/model-usage
Command: npx skills add https://github.com/MerkyorLynn/Lynn --skill model-usage-merkyorlynn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires codexbar, python3, and includes scripts (resource) and references (resource) components.

What problem does it solve?

It solves the problem of not knowing how much you spend on different models when using CodexBar locally, so you can make informed choices without manually reading raw logs.

Core Features & Use Cases

  • Per-model cost summaries: Produces a cost-only breakdown by model, either for the most recent “current model” or across all models in the log.
  • Scriptable input: Works by running CodexBar locally or by consuming an exported cost JSON file (or stdin), enabling repeatable analysis.
  • Model selection logic: For “current model,” selects the highest-cost model from the most recent daily row (with a fallback to modelsUsed when breakdowns are missing), and supports an explicit override.

Quick Start

Ask for a per-model cost report for the current day’s most recent model by running python {baseDir}/scripts/model_usage.py --provider codex --mode current.

Frequently Asked Questions about model-usage

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

FAQPage Schema
How do I get a per-model cost breakdown from CodexBar usage logs?

To get a per-model cost breakdown from CodexBar usage logs, you can run the provided Python CLI script. It aggregates the modelBreakdowns from your local cost JSON into cost-only totals to reveal your spending distribution across models.

What is the best way to summarize local CodexBar cost JSON for budgeting?

Summarizing local CodexBar cost JSON for budgeting is done by parsing the exported file or stdin input. The script aggregates modelBreakdowns into per-model cost totals, helping you optimize spending without manually reading raw logs.

Can I check my current model cost snapshot from CodexBar without exporting the full log?

Yes, you can check your current model cost snapshot by running the script in current mode. It selects the highest-cost model from the most recent daily row, automatically falling back to modelsUsed when specific breakdowns are missing.

Does this cost analysis script require a specific provider or can it analyze both Codex and Claude?

The cost analysis script supports analyzing both Codex and Claude providers. You can specify the provider when generating the JSON input via codexbar cost --format json --provider codex|claude to aggregate the respective model costs.

Do I need Python to parse CodexBar cost logs into a JSON summary?

Yes, you need Python3 installed to parse CodexBar cost logs into a JSON summary. The script runs locally as a Python CLI command to read the cost data and aggregate the per-model breakdowns for your analysis.

Why does my CodexBar cost report show a different model than expected?

Your CodexBar cost report might show an unexpected model because the current mode logic selects the highest-cost model from the most recent daily row. If breakdowns are missing, it falls back to the modelsUsed field, which may alter the output.