#10973: docs: add model-level usage summary via CodexBar CLI
scripts
stale
Cluster:
Skill and Session Management Fixes
### Summary
Adds a small utility script and documentation support for summarizing
per-model usage costs using CodexBar’s local cost logs.
This helps users understand:
- which models are used most
- per-model cost distribution
- quick CLI-based usage summaries
### What’s included
- New script: `scripts/model_usage.py`
- Summarizes per-model costs for Codex or Claude
- Uses CodexBar CLI JSON output
- Designed to be simple, scriptable, and beginner-friendly
- macOS-only for now (CodexBar limitation)
### Why
OpenClaw users often want visibility into model usage and cost.
CodexBar already exposes this data, but there was no documented or
scriptable way to summarize it per model within the OpenClaw repo.
### Related issue
Closes #10964
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Tweaks README onboarding blurb by splitting it into two sentences/lines for readability.
- Adds `scripts/model_usage.py`, a small CLI helper that shells out to `codexbar cost --format json` and aggregates spend by model.
- Intended to help OpenClaw users get a quick per-model cost breakdown using CodexBar’s local cost logs (macOS-oriented).
<h3>Confidence Score: 4/5</h3>
- This PR is close to mergeable, but the new script needs basic failure-mode handling to avoid crashing in common environments.
- Changes are small and isolated (README wording + a standalone utility script). The main merge risk is the Python script’s current behavior of raising raw exceptions when CodexBar is missing/returns unexpected JSON types, which will frustrate users and conflicts with the stated macOS limitation.
- scripts/model_usage.py
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#22924: feat(model-usage): merge basic observability modes (errors/overview)
by futuremind2026 · 2026-02-21
73.2%
#6730: feat: Make OpenAI Codex CLI models usable - reasoning effort directive
by levineam · 2026-02-02
72.4%
#11901: feat: enhance /total_usage command with time units, model breakdown...
by cclank · 2026-02-08
70.6%
#4223: fix: compaction safeguard falls through when ctx.model is unavailable
by hanxiao · 2026-01-29
69.5%
#8475: models: discover local Windsurf/Cursor/Antigravity models
by gitSITTI · 2026-02-04
68.5%
#3649: docs: remove numeric model selection references and document /models
by Jackten · 2026-01-29
68.1%
#7671: feat(status): add dedicated Model row to /status output
by terry-li-hm · 2026-02-03
67.9%
#8258: feat: Add smart model tiering for cost optimization
by revenuestack · 2026-02-03
67.8%
#13215: fix: pass agentId to loadCostUsageSummary in /usage cost command
by veast · 2026-02-10
67.0%
#9257: this is my first fork
by demonking369 · 2026-02-05
66.9%