model-usage
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.zipInstalls 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.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
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
- Fetch cost JSON via CodexBar CLI or pass a JSON file.
- 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
modelsUsedwhen 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
--inputwith 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.mdfor CLI flags and cost JSON fields.
When not to use it
- →Calculating costs for non-CodexBar providers
- →Real-time billing monitoring
Prerequisites
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| model-usage (this skill) | 5 | 2mo | Review | Beginner |
| quant-analyst | 103 | 2mo | No flags | Advanced |
| stock-analyzer | 71 | 2mo | Review | Beginner |
| pair-trade-screener | 11 | 1mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by openclaw
View all by openclaw →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.
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.
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.
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.
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".
agent-trading-predictor
ruvnet
Agent skill for trading-predictor - invoke with $agent-trading-predictor