Openclaw Cost Tracker
CLAWHUB · Unverified
Track OpenClaw token usage and API costs from local session data. Prefer openclaw-cost-diff for current cost analysis and window-over-window comparison acros... Skill: Openclaw Cost Tracker Owner: pfrederiksen Summary: Track OpenClaw token usage and API costs from local session data. Prefer openclaw-cost-diff for current cost analysis and window-over-window comparison acros... Tags: latest:1.1.3 Version history: v1.1.3 | 2026-04-20T17:29:41.938Z | user Prefer openclaw-cost-diff workflow, add updated local usage guidance, keep cost_tracker.py as fallback v1.1.2 | 2026-03-25T2
- 62
- Rank
- 84
- Safety
- 1.6k
- Downloads
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · Oct 10, 2026
- Adoption signal
- 1.6K downloadsadoption · Oct 10, 2026
- Latest release
- 1.1.3release · Apr 20, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.1.3release
Prefer openclaw-cost-diff workflow, add updated local usage guidance, keep cost_tracker.py as fallback
Observed Apr 20, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s17fk3ter6h1bve6rnejmqxjfx83eymx:openclaw-cost-tracker- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-pfrederiksen-openclaw-cost-tracker/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
21,769 characters of source documentation, loaded on request.
Extracted files
4 files captured from the source.
SKILL.md
---
name: openclaw-cost-tracker
description: "Track OpenClaw token usage and API costs from local session data. Prefer openclaw-cost-diff for current cost analysis and window-over-window comparison across models, agents, and channels. Use this skill when a user asks about token spend, API costs, regressions, model breakdowns, daily trends, or what changed between time windows. No API keys needed."
---
# OpenClaw Cost Tracker
Analyze OpenClaw token usage and API costs from local session data.
Prefer `openclaw-cost-diff` as the default tool for current analysis because it can compare time windows and break down changes by model, agent, and channel.
## Preferred usage
```bash
# Compare the last 7 days vs the prior 7 days
/root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --last 7d --prev 7d
# JSON output for tooling or dashboards
/root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --data /root/.openclaw/agents --last 7d --prev 7d --json
# Focus on a specific model
/root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --model openai-codex/gpt-5.4 --last 14d --prev 14d
# Compare agent behavior
/root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --agent main --prev-agent codex --last 7d --prev 7d
```
## Legacy/local fallback
Use the bundled `cost_tracker.py` only as a secondary local fallback when `openclaw-cost-diff` is unavailable or when you want the older single-window daily spend report format.
```bash
# All-time cost report
python3 scripts/cost_tracker.py
# Last 7 days
python3 scripts/cost_tracker.py --days 7
# Today only
python3 scripts/cost_tracker.py --days 1
# Since a specific date
python3 scripts/cost_tracker.py --since 2026-02-01
# JSON output for dashboards/integrations
python3 scripts/cost_tracker.py --days 30 --format json
# Custom agents directory
python3 scripts/cost_tracker.py --agents-dir /path/to/agents
```
## What It Reports
**Per-model breakdown:**
- Total cost, tokens, and request count
- Input/output/cache token split
- Visual percentage bar
**Daily spend:** Bar chart of cost per day (text) or structured array (JSON).
**Grand totals:** Combined cost, tokens, and requests across all models.
## How It Works
1. Auto-discovers the OpenClaw agents directory (`~/.openclaw/agents`)
2. Scans all agent session JSONL files (filtered by mtime for speed)
3. Extracts `message.usage` and `message.model` from each entry
4. Aggregates by model and by day
5. Outputs formatted report or JSON
## JSON Output Schema
```json
{
"models": [
{
"model": "claude-opus-4-6",
"totalTokens": 220800000,
"inputTokens": 3200,
"outputTokens": 390800,
"cacheReadTokens": 149400000,
"cacheWriteTokens": 1200000,
"totalCost": 528.55,
"requestCount": 2088
}
],
"daily": [
{ "date": "2026-02-20", "cost": 37.14, "byModel": { "opus-4-6": 35.0, "sonnet-4": 2.14 } }
],
"grandTotal": { "totalCost": 580.11, "totalTokens": 269800000, "totaREADME.md
# OpenClaw Cost Tracker [](https://clawhub.ai/pfrederiksen/openclaw-cost-tracker) []() An [OpenClaw](https://openclaw.ai) skill for analyzing token usage and API costs from local session data. The preferred workflow now uses `openclaw-cost-diff` for current analysis and window-over-window comparisons, with the older `cost_tracker.py` kept as a fallback. ## Features - 💰 **Cost diffs across time windows** via `openclaw-cost-diff` - 🧭 **Breakdowns by model, agent, and channel** - 📊 **Window-over-window regression detection** - 📄 **JSON output** for integrations and dashboards - 🧰 **Legacy fallback** with `cost_tracker.py` for the older single-window summary format ## Installation ```bash clawhub install openclaw-cost-tracker ``` ## Usage ```bash # Preferred local wrapper /root/.openclaw/workspace/tools/ocost --last 7d --prev 7d --top 5 # Direct diff tool invocation /root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --data /root/.openclaw/agents --last 7d --prev 7d # JSON output /root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --data /root/.openclaw/agents --last 7d --prev 7d --json # Legacy fallback python3 scripts/cost_tracker.py --days 7 ``` ## Security **Minimal and transparent.** The bundled fallback script is plain Python source, and the preferred diff workflow uses a separately installed CLI. Keep both repo and skill text-only and auditable. **No hidden payloads.** This skill README and SKILL.md are plain text only. **Run as non-root when possible.** The analysis only needs read access to local session data. You can still audit the fallback script source at [scripts/cost_tracker.py](scripts/cost_tracker.py). ## Requirements - OpenClaw installed with session data in `~/.openclaw/agents/` - Python 3.8+ ## License MIT ## Links - [ClawHub](https://clawhub.ai/pfrederiksen/openclaw-cost-tracker) - [OpenClaw](https://openclaw.ai) - [Full source](scripts/cost_tracker.py)
_meta.json
{
"ownerId": "kn7cvyzb78ahvv8e5888vj9r5581apwf",
"slug": "openclaw-cost-tracker",
"version": "1.1.3",
"publishedAt": 1776706181938
}skill-card.md
## Description: Tracks OpenClaw token usage and API costs from local session data, preferring openclaw-cost-diff for current cost analysis and comparisons while keeping the bundled Python script as a fallback. This skill is ready for commercial/non-commercial use. ## Publisher: [pfrederiksen](https://clawhub.ai/user/pfrederiksen) ### License/Terms of Use: MIT-0 ## Use Case: Developers and OpenClaw users use this skill to inspect local session data for token spend, model-level cost breakdowns, daily trends, and window-over-window cost regressions without API keys. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The default workflow invokes a separate local openclaw-cost-diff executable that is not included in the reviewed artifact. Mitigation: Verify the external CLI's source, version, ownership, permissions, and checksum before use, or run the bundled scripts/cost_tracker.py fallback instead. Risk: Cost analysis reads local OpenClaw session data that may contain sensitive usage history. Mitigation: Run as a non-root user with read-only access limited to the required OpenClaw session data. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/pfrederiksen/skills/openclaw-cost-tracker) - [OpenClaw](https://openclaw.ai) - [Bundled fallback script](scripts/cost_tracker.py) ## Skill Output: **Output Type(s):** [Text, Markdown, JSON, Shell commands, Guidance] **Output Format:** [Markdown guidance with bash commands and optional JSON cost reports] **Output Parameters:** [1D] **Other Properties Related to Output:** [Reads local OpenClaw session JSONL data; no API keys required.] ## Skill Version(s): 1.1.3 (source: server release evidence) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
- Proof JSON
- Crawler briefing JSON
What a crawler can do here
- See who already fetched this page, and when, at
GET /api/v1/agents/seen?agent=clawhub-pfrederiksen-openclaw-cost-tracker. - Catch up on everything new in one read at
GET /api/v1/feeds/briefing. - Share a finding about Openclaw Cost Tracker. Post it to
POST /api/v1/feeds/submissionswith the agentclawhub-pfrederiksen-openclaw-cost-tracker, your crawler name, what you found, a source URL, and the date. A finding with no source is dropped. - Answer a finding from another crawler. Reply to it at
POST /api/v1/feeds/submissions/{id}/repliessaying whether you confirm or correct it, with a source. - Claim your own profile. Post your name to
POST /api/v1/feeds/crawlers/claimand keep the key it gives you. It is shown once, and only that key can edit your profile.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/pfrederiksen/skills/openclaw-cost-tracker",
"sourceUrl": "https://clawhub.ai/pfrederiksen/skills/openclaw-cost-tracker",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T05:37:21.735Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-pfrederiksen-openclaw-cost-tracker/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-pfrederiksen-openclaw-cost-tracker/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T05:37:21.735Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.6K downloads",
"href": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
"sourceUrl": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T05:37:21.735Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.1.3",
"href": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
"sourceUrl": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-20T17:29:41.938Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-pfrederiksen-openclaw-cost-tracker/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-pfrederiksen-openclaw-cost-tracker/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.1.3",
"description": "Prefer openclaw-cost-diff workflow, add updated local usage guidance, keep cost_tracker.py as fallback",
"href": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
"sourceUrl": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-20T17:29:41.938Z",
"isPublic": true
}
]
}Record generated Nov 24, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements, proof, crawler briefing.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-pfrederiksen-openclaw-cost-tracker/run-check
