model-usage
Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns.
❔ da accertare
⚪ mai vettata — nessuno l'ha ancora guardata; non vuol dire che sia a posto
C:\Users\Ettore\AppData\Roaming\npm\node_modules\openclaw\skills\model-usage\SKILL.mdC:\Users\Ettore\AppData\Roaming\npm\node_modules\openclaw\skills\model-usagename: model-usage
description: "Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns."
metadata:
{
"openclaw":
{
"emoji": "📊",
"os": ["darwin"],
"requires": { "bins": ["codexbar"] },
"install":
[
{
"id": "brew-cask",
"kind": "brew",
"formula": "steipete/tap/codexbar",
"bins": ["codexbar"],
"label": "Install CodexBar (brew cask)",
},
],
},
}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.
Live CodexBar CLI invocation is currently documented for macOS only. The bundled Python summarizer is portable: if you already have exported CodexBar JSON, --input mode works 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 --prettyCurrent 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: use the bundled CodexBar CLI install path above for live local usage reads.
- Linux/other platforms: use
--inputwith exported CodexBar JSON until this skill documents a supported local CodexBar install path for that platform. - 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 currentOutput
- 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.
Conteggio esatto dall'endpoint Anthropic count_tokens (gratuito, solo rate-limited), envelope del messaggio già sottratto. I caratteri sono un dato locale, servono da riscontro.
Questa skill è in sola lettura: sono file del pacchetto npm: un aggiornamento di openclaw le riscrive. Per lavorarci sopra si copia la cartella nello workspace di un agente e si modifica lì.
- references/codexbar-cli.md1.1 kB
- scripts/model_usage.py11.2 kB
- scripts/test_model_usage.py5.5 kB
- SKILL.md2.4 kB
nessuna modifica fatta da qui: nessun backup
questo workspace non è un repo git
Scrittura consentita solo dentro le cartelle skills\ dei workspace del registro e solo sul file SKILL.md (deroga alla stanza Identità autorizzata da Ettore il 2026-08-10). Ogni salvataggio crea prima un backup datato; nessun file viene mai cancellato.