Model Usage (Linux) for Openclaw

A Linux-native tool to analyze AI model token consumption and financial costs from session logs.

hablabechir
v1.0.0
Feb 26, 2026
0
1.9k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install model-usage-linux

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 model-usage-linux 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 (Linux)?

Model Usage (Linux) is a specialized utility designed for developers and power users working with the Openclaw Skills ecosystem. It serves as a robust Linux alternative to macOS-specific tracking tools, allowing users to deep-dive into their AI agent sessions. By parsing local JSONL session logs, it provides clear visibility into model performance and resource consumption, ensuring you stay within budget while optimizing your workflows.

Model Usage (Linux) Use Cases

  • Monitoring total API expenditure across multiple LLM providers.
  • Identifying which AI models are consuming the most tokens in your Openclaw Skills setup.
  • Generating usage reports for billing or project resource allocation.
  • Debugging session costs by analyzing input, output, and cache token metrics.

How Model Usage (Linux) Works

  1. The script accesses the local session directory where Openclaw Skills store interaction history in JSONL format.
  2. It parses each session file to extract metadata, model identifiers, and token counts.
  3. The tool calculates costs based on predefined model pricing for input, output, and caching.
  4. It aggregates the data into a summarized view, categorized by model type and interaction turns.
  5. Results are displayed in the terminal or exported as JSON for further integration.

Model Usage (Linux) Setup

Navigate to your skill directory and run the following command to see a usage summary:

python3 {baseDir}/scripts/usage.py

To output the results in JSON format for automated reporting or integration with other Openclaw Skills:

python3 {baseDir}/scripts/usage.py --format json

If your session files are stored in a non-standard location, use the directory flag:

python3 {baseDir}/scripts/usage.py --sessions-dir ~/.openclaw/agents/main/sessions

Model Usage (Linux) Data Schema & Taxonomy

Metric Description
Turns Number of assistant responses per session
Input Tokens Tokens sent to the model in requests
Output Tokens Tokens generated by the model in replies
Cache Read/Write Metrics for optimized token reuse and caching
Cost (USD) Estimated financial cost based on current model rates

Model Usage (Linux) Advanced Features

  • Support for custom session directory paths to manage multiple agent profiles.
  • JSON output formatting for seamless integration with external dashboard tools or scripts.
  • Granular breakdown of cache-related token savings to evaluate model efficiency.
  • Linux-optimized performance for handling large volumes of Openclaw Skills session data.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*