Generates cost and usage summaries for AI models based on local usage data.

Install

mkdir -p .claude/skills/model-usage && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/572" && unzip -o skill.zip -d .claude/skills/model-usage && rm skill.zip

Installs to .claude/skills/model-usage

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns.
102 charsno explicit “when” trigger
Beginner

Key capabilities

  • Summarize costs by model
  • Analyze current session usage
  • Process full usage history
  • Output summaries in text or JSON format

How it works

The tool parses CodexBar cost logs to aggregate spending data by model. It identifies the most recent daily entries or processes the entire history to calculate total costs per provider.

Inputs & outputs

You give it
CodexBar cost JSON file
You get back
Per-model cost summary

When to use model-usage

  • Calculate daily AI API costs
  • Summarize usage for Claude or Codex models
  • Review model-specific token breakdowns
  • Audit development environment spending

About this skill

Model usage

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.

CodexBar ships CLI builds for macOS and Linux. When codexbar is on PATH, the skill reads local usage directly; the bundled Python summarizer also accepts exported CodexBar JSON through --input anywhere Python is available.

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>.
  • macOS and Linux: use the bundled Homebrew formula installer above for live local usage reads. Linux users can also use CodexBar's AUR package or official release tarballs.
  • Other platforms: use --input with exported CodexBar JSON.
  • 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.

When not to use it

  • Calculating costs for non-CodexBar providers
  • Real-time billing monitoring

Prerequisites

CodexBar CLICodexBar cost JSON logs

Limitations

  • Tokens are not split by model in output
  • Live CLI usage currently restricted to macOS

How it compares

It automates the extraction and aggregation of cost data from raw JSON logs, which would otherwise require manual parsing.

Compared to similar skills

model-usage side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
model-usage (this skill)52moReviewBeginner
quant-analyst1032moNo flagsAdvanced
stock-analyzer712moReviewBeginner
pair-trade-screener111moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

quant-analyst

zenobi-us

Expert quantitative analyst specializing in financial modeling, algorithmic trading, and risk analytics. Masters statistical methods, derivatives pricing, and high-frequency trading with focus on mathematical rigor, performance optimization, and profitable strategy development.

103355

stock-analyzer

FrancyJGLisboa

Provides comprehensive technical analysis for stocks and ETFs using RSI, MACD, Bollinger Bands, and other indicators. Activates when user requests stock analysis, technical indicators, trading signals, or market data for specific ticker symbols.

71214

pair-trade-screener

tradermonty

Statistical arbitrage tool for identifying and analyzing pair trading opportunities. Detects cointegrated stock pairs within sectors, analyzes spread behavior, calculates z-scores, and provides entry/exit recommendations for market-neutral strategies. Use when user requests pair trading opportunities, statistical arbitrage screening, mean-reversion strategies, or market-neutral portfolio construction. Supports correlation analysis, cointegration testing, and spread backtesting.

1198

risk-metrics-calculation

wshobson

Calculate portfolio risk metrics including VaR, CVaR, Sharpe, Sortino, and drawdown analysis. Use when measuring portfolio risk, implementing risk limits, or building risk monitoring systems.

881

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

agent-trading-predictor

ruvnet

Agent skill for trading-predictor - invoke with $agent-trading-predictor

942

Search skills

Search the agent skills registry