model-usage-linux
$
npx mdskill add aAAaqwq/AGI-Super-Team/model-usage-linuxParse Linux session files to reveal token costs and model usage.
- Analyzes OpenClaw JSONL files to calculate spending and token counts.
- Depends on session data stored in the ~/.openclaw directory.
- Computes metrics by counting turns, tokens, and cache operations.
- Outputs structured JSON reports showing per-model cost breakdowns.
SKILL.md
.github/skills/model-usage-linuxView on GitHub ↗
---
name: model-usage-linux
description: "Track OpenClaw AI token usage and cost per model on Linux by parsing session JSONL files. Use when asked about: token usage, API cost, how much has been spent, which model was used most, usage summary, billing, cost breakdown. Linux replacement for the macOS-only model-usage/CodexBar skill."
---
# Model Usage (Linux)
Parse OpenClaw session files to summarize token usage and cost per model.
## Quick start
```bash
python3 {baseDir}/scripts/usage.py
```
## Options
```bash
# JSON output
python3 {baseDir}/scripts/usage.py --format json
# Custom sessions dir
python3 {baseDir}/scripts/usage.py --sessions-dir ~/.openclaw/agents/main/sessions
```
## Output
Shows per-model breakdown:
- Turns (assistant replies)
- Input / output tokens
- Cache read / write tokens
- Cost in USD
Sessions live at: `~/.openclaw/agents/main/sessions/*.jsonl`