A utility to accurately calculate, aggregate, and display cumulative LLM token usage across all OpenClaw agents, featuring a Python CLI and an optional Control UI analytics button.
The fastest way to install a skill directly from the registry.
npx clawhub@latest install agent-token-usage
Copy the skill folder to one of these locations
~/.openclaw/skills/ <project>/skills/ Priority: Workspace > Local > Bundled
Copy this prompt to OpenClaw to install it automatically.
Help me install agent-token-usage using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).
Get the raw skill files in a ZIP archive.
The agent-token-usage skill is designed to solve a critical accounting challenge in multi-agent environments: tracking actual cumulative token usage. Unlike standard session listings that only display the last context window size, this utility parses the canonical raw session logs (.jsonl) to sum every single LLM API call. It provides developers and administrators with precise visibility into how much computation each individual agent consumes. Keep your resource usage transparent and optimize your API budgets seamlessly with this and other Openclaw Skills.
It ships with two distinct components: a robust Python command-line interface (CLI) and an optional web integration that patches a statistics button into your Control UI. By calculating real LLM throughput and weighted billable-equivalent tokens, it allows you to easily identify which agent is burning the most compute or driving the highest cost.
~/.openclaw/agents/<agent>/sessions/*.jsonl to locate canonical session transaction logs while systematically ignoring trajectory files.type is message and the role is assistant to ensure a strict 1:1 match with physical LLM API requests.To start using this skill directly from your CLI, navigate to your workspace and run the Python script:
# Standard usage (aggregates usage for today based on UTC)
python ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py
# Group by your local timezone instead of UTC
python ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py --tz local
# Query token statistics for a specific historical date
python ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py --date 2026-05-20
To inject the stats visualizer button into your Control UI dashboard, install the UI patch:
bash ~/.openclaw/workspace/skills/agent-token-usage/apply-ui.sh
If you ever need to remove the UI modifications, simply run the cleanup script:
bash ~/.openclaw/workspace/skills/agent-token-usage/remove-ui.sh
The agent-token-usage skill processes underlying data from standard log paths and evaluates token tracking fields based on the following metrics schema:
| Token Type | Meaning | Approximate Billing Weight |
|---|---|---|
input |
New, non-cached prompt tokens submitted to the model | 1.0x |
output |
Tokens generated dynamically by the model response | 1.0x (base, typically priced higher) |
cacheRead |
Prompt tokens read from active context cache | ~0.1x (highly discounted) |
cacheWrite |
Prompt tokens written to the context cache window | ~1.25x (slight premium) |
total |
Mathematical sum of all physical throughput | N/A |
~bill |
Weighted estimate of billable-equivalent tokens | Calculated based on standard multipliers |
scripts/agent_token_usage.pyapply-ui.sh and remove-ui.shdist/control-ui/data/agent-token-usage.json (integrated cleanly via same-origin fetch to bypass Content Security Policy restrictions).--billable flag that translates physical token counts into equivalent-billable tokens based on provider caching multipliers.--tz local) to align resource accounting with the operator's real-world business day.--format json), which integrates smoothly with external DevOps logging dashboards powered by Openclaw Skills.Loading
An automated Alibaba Cloud ECS disaster recovery and backup automation agent skill for cross-AZ full-instance and disk-level recovery.

An execution-free performance testing router that intelligently intercepts user intents and delegates Alibaba Cloud PTS actions to dedicated sub-skills.

An advanced automation script that inserts new slides into existing PPTX files with 100% style and layout consistency by cloning slide XML elements.

Automates the upgrade of an Android application's Auth0 SDK from v3 to the next major v4 release by auditing call sites and applying code changes safely.

PrepKit is an advanced instructional framework based on the ADDIE model, specifically tailored for AI agents to design and develop elite training materials for informatics competitions like NOI, CSP, and GESP.

A read-only governance preflight tool that evaluates proposed AI agent actions for authorization, boundaries, risks, and required evidence before execution.








































