Model Usage for Openclaw

A technical utility to extract, summarize, and visualize per-model cost data from CodexBar's local logs for precise AI spend management.

bkes994408-cmd
v1.0.0
Mar 18, 2026
0
805
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install token-usage-dashboard

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install token-usage-dashboard using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Model Usage?

The Model Usage skill is a powerful diagnostic tool designed for developers who need granular insights into their LLM consumption. By leveraging the CodexBar CLI, this entry in the Openclaw Skills library parses local cost logs to provide a clear breakdown of expenditures across different providers like Codex and Claude.

It solves the problem of opaque AI billing by identifying which specific models—such as GPT-4 or Claude 3.5 Sonnet—are driving costs. Whether you need a quick glance at your most recent session or a comprehensive historical report, this skill transforms raw JSON data into actionable financial intelligence.

Model Usage Use Cases

  • Tracking daily AI spend to stay within project budgets.
  • Identifying the most expensive models in a multi-model workflow.
  • Generating automated cost reports for stakeholders or personal auditing.
  • Auditing cost spikes over a 30-day period to detect inefficient prompting or loops.

How Model Usage Works

  1. The skill interfaces with the CodexBar CLI to fetch raw cost data in JSON format for a specified provider.
  2. A specialized Python script parses the modelBreakdowns and modelsUsed fields within the local logs.
  3. The logic identifies the current model by selecting the entry with the highest cost in the most recent daily record.
  4. If historical data is requested, the skill aggregates costs across all recorded models to provide a full breakdown.
  5. Results are formatted as human-readable text or structured JSON for further programmatic use.

Model Usage Setup

To integrate this capability into your workflow via Openclaw Skills, follow these steps:

# Install the required CodexBar dependency via Homebrew
brew tap steipete/tap
brew install --cask codexbar

# Run a summary for your current Codex usage
python scripts/model_usage.py --provider codex --mode current

# Generate a 30-day token usage dashboard
python scripts/token_usage_dashboard.py --provider codex --days 30 --output /tmp/dashboard.html --open

Model Usage Data Schema & Taxonomy

The skill processes structured JSON data from CodexBar. Key fields and outputs include:

Field Description
provider The AI service provider (e.g., codex, claude).
modelBreakdowns Object containing cost distribution per specific model ID.
cost Total monetary spend identified for the timeframe.
format Output can be toggled between plain text and pretty-printed JSON.

Model Usage Advanced Features

  • Multi-provider support for both Codex and Claude ecosystems.
  • Dashboard generation with HTML output for visual cost trend analysis.
  • Automated spike detection using configurable thresholds (e.g., 2.0x multiplier).
  • Support for piped input (stdin), allowing integration into larger shell-based automation pipelines.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*