model-usage

GitHub

通过 CodexBar CLI 获取并汇总模型级别的用量与成本数据,支持当前或全部模型的统计。

skills/model-usage/SKILL.md linuxhsj/openclaw-zero-token

Trigger Scenarios

查询 Codex 或 Claude 的模型使用量 请求按模型分组的费用摘要 需要脚本化解析 cost JSON

Install

npx skills add linuxhsj/openclaw-zero-token --skill model-usage -g -y
More Options

Use without installing

npx skills use linuxhsj/openclaw-zero-token@model-usage

指定 Agent (Claude Code)

npx skills add linuxhsj/openclaw-zero-token --skill model-usage -a claude-code -g -y

安装 repo 全部 skill

npx skills add linuxhsj/openclaw-zero-token --all -g -y

预览 repo 内 skill

npx skills add linuxhsj/openclaw-zero-token --list

SKILL.md

Frontmatter
{
    "name": "model-usage",
    "metadata": {
        "openclaw": {
            "os": [
                "darwin"
            ],
            "emoji": "📊",
            "install": [
                {
                    "id": "brew-cask",
                    "bins": [
                        "codexbar"
                    ],
                    "kind": "brew",
                    "label": "Install CodexBar (brew cask)",
                    "formula": "steipete\/tap\/codexbar"
                }
            ],
            "requires": {
                "bins": [
                    "codexbar"
                ]
            }
        }
    },
    "description": "Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage\/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON."
}

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.

TODO: add Linux CLI support guidance once CodexBar CLI install path is documented for Linux.

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>.
  • 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.

Version History

  • a654bcf Current 2026-07-25 07:13

Same Skill Collection

diffs/skills/diffs/SKILL.md
extensions/acpx/skills/acp-router/SKILL.md
extensions/diffs/skills/diffs/SKILL.md
extensions/feishu/skills/feishu-doc/SKILL.md
extensions/feishu/skills/feishu-drive/SKILL.md
extensions/feishu/skills/feishu-perm/SKILL.md
extensions/feishu/skills/feishu-wiki/SKILL.md
extensions/open-prose/skills/prose/SKILL.md
extensions/tavily/skills/tavily/SKILL.md
open-prose/skills/prose/SKILL.md
skills/1password/SKILL.md
skills/apple-notes/SKILL.md
skills/apple-reminders/SKILL.md
skills/bear-notes/SKILL.md
skills/blogwatcher/SKILL.md
skills/blucli/SKILL.md
skills/bluebubbles/SKILL.md
skills/browser-cdp/SKILL.md
skills/clawhub/SKILL.md
skills/discord/SKILL.md
skills/eightctl/SKILL.md
skills/gemini/SKILL.md
skills/gh-issues/SKILL.md
skills/gifgrep/SKILL.md
skills/github/SKILL.md
skills/gog/SKILL.md
skills/goplaces/SKILL.md
skills/healthcheck/SKILL.md
skills/himalaya/SKILL.md
skills/imsg/SKILL.md
skills/mcporter/SKILL.md
skills/nano-banana-pro/SKILL.md
skills/nano-pdf/SKILL.md
skills/notion/SKILL.md
skills/obsidian/SKILL.md
skills/openai-image-gen/SKILL.md
skills/openai-whisper-api/SKILL.md
skills/openai-whisper/SKILL.md
skills/openhue/SKILL.md
skills/oracle/SKILL.md
skills/ordercli/SKILL.md
skills/peekaboo/SKILL.md
skills/session-logs/SKILL.md
skills/sherpa-onnx-tts/SKILL.md
skills/slack/SKILL.md
skills/songsee/SKILL.md
skills/sonoscli/SKILL.md
skills/spotify-player/SKILL.md
skills/summarize/SKILL.md

Metadata

Files
0
Version
a654bcf
Hash
dbdd6e60
Indexed
2026-07-25 07:13

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-22 05:41
浙ICP备14020137号-1 $mapa de visitantes$