model-usage

Summarizes per-model cost usage from CodexBar local cost JSON for Codex or Claude.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/srgaba/open-claw --skill model-usage-srgaba
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-usage
Source: https://github.com/srgaba/open-claw/tree/main/project/skills/model-usage
Command: npx skills add https://github.com/srgaba/open-claw --skill model-usage-srgaba

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? CodexBar's raw cost JSON contains daily rows and model breakdowns that are hard to read directly. This Skill turns that data into a clear per-model cost summary, answering questions like which model you used most recently and how much each model cost. ## Core Features & Use Cases - Current Model Detection: Identifies the most recent model from the latest daily entry, picking the highest-cost model in the breakdown or falling back to modelsUsed. - All-Models Breakdown: Aggregates cost per model across daily rows, with optional filtering to the last N days. - Flexible Input and Output: Reads from the codexbar CLI, a JSON file, or stdin, and outputs plain text or structured JSON. - Use Case: Ask which Claude model you used today and its cost, then get a JSON summary you can pipe into a spending report. ## Quick Start Ask the assistant to show your current Codex model usage and cost from CodexBar, or request a full per-model breakdown for Claude as JSON.

Frequently Asked Questions about model-usage

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

FAQPage Schema
How do I check per-model cost usage with CodexBar?

Run the bundled model_usage.py script with a provider and mode, for example --provider codex --mode current for the latest model or --mode all for a full breakdown. It reads codexbar cost JSON and prints text or JSON summaries.

How to get the current Claude model cost from codexbar cost JSON?

Use --provider claude --mode current. The script finds the most recent daily row with modelBreakdowns, picks the highest-cost model, and falls back to the last entry in modelsUsed when breakdowns are missing.

Can I use codexbar cost data without the CLI installed?

Yes. Save codexbar cost output to a file and pass it with --input, or pipe it via stdin using --input -. The script parses the JSON directly instead of invoking the codexbar binary.

Does CodexBar cost tracking work on Linux?

The Skill metadata currently targets macOS (darwin) with installation via the steipete/tap/codexbar Homebrew cask. Linux CLI support is noted as a TODO pending documented install paths.

Why does the model usage script report no model data found?

This happens when the cost payload has no daily rows with modelBreakdowns or modelsUsed entries. Verify that codexbar cost returns local JSONL session logs for the selected provider, since cost data is local-only.