model-usage

Aggregate CodexBar cost JSON into per-model USD cost summaries.

Updated Mar 21, 2026
One-click install
npx skills add https://github.com/Polealpha/XINNIAN_PI --skill model-usage-polealpha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-usage
Source: https://github.com/Polealpha/XINNIAN_PI/tree/main/app%20windows/vendor/openclaw-runtime/skills/model-usage
Command: npx skills add https://github.com/Polealpha/XINNIAN_PI --skill model-usage-polealpha

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

It removes the guesswork of which AI model you actually spent money on by turning CodexBar local cost logs into a clear per-model usage and cost summary.

Core Features & Use Cases

  • Current model reporting: identifies the most recent day’s top-cost model (with fallbacks to the last entry in modelsUsed when breakdowns are missing).
  • All-model breakdowns: aggregates cost across daily rows to produce a ranked list of models by total cost.
  • Scriptable automation: supports piping JSON from CodexBar (or reading from a provided JSON file) and outputs either human-readable text or machine-readable JSON for dashboards or further processing.

Quick Start

Ask it to summarize your most recent CodexBar local cost logs by running the Codex provider in current mode.

Frequently Asked Questions about model-usage

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

FAQPage Schema
How do I summarize Codex and Claude model costs by day from local logs?

To summarize Codex and Claude model costs by day, you can aggregate local CodexBar cost JSON data by parsing daily rows and grouping modelBreakdowns by modelName to calculate total USD spent per model.

How do I extract the top-cost AI model from my latest usage logs?

You extract the top-cost AI model by selecting the most recent daily row from your usage logs, evaluating the modelBreakdowns array, and falling back to the last entry in modelsUsed if breakdowns are missing.

Can I pipe JSON output from CodexBar directly into a usage analytics script?

Yes, you can pipe JSON output directly by executing codexbar cost --format json and feeding the output into a script to generate either human-readable text or machine-readable JSON for dashboards.

Does this approach work for generating AI budgeting and usage auditing reports?

Yes, this approach works for budgeting and usage auditing by aggregating historical daily cost JSON rows to produce a ranked list of models by total USD cost for comprehensive reporting.

What happens if modelBreakdowns are missing from my daily cost JSON?

If modelBreakdowns are missing from your daily cost JSON, the aggregation logic applies a defined fallback behavior by selecting the last entry in the modelsUsed array for that specific daily row.