session-cost

Analyze OpenClaw session logs to report token usage, costs, and performance by model.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/khaney64/session-cost --skill session-cost
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-cost
Source: https://github.com/khaney64/session-cost/tree/main
Command: npx skills add https://github.com/khaney64/session-cost --skill session-cost

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

OpenClaw users need visibility into API spending, token usage, and performance across sessions to optimize costs and performance.

Core Features & Use Cases

  • Analyze and summarize per-model token usage, costs, and latency from OpenClaw session logs.
  • Generate per-model and per-session breakdowns for cost-management and performance tuning.
  • Use the results to answer questions about API spending, usage patterns, and model efficiency across sessions.

Quick Start

Run node scripts/session-cost.js to generate a summary of your OpenClaw sessions and costs.

Frequently Asked Questions about session-cost

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze API token usage and costs from session logs?

This Skill analyzes OpenClaw session logs to report token usage and costs grouped by model, aggregating input, output, and cache tokens from JSONL session files to generate structured cost summaries.

What is the best way to get a per-model breakdown of API spending?

The best way to get a per-model breakdown of API spending is to run the session-cost script, which aggregates token costs and usage metrics from your session logs into per-model and per-session summaries.

Can I output session cost summaries in JSON or Discord formats?

Yes, you can output session cost summaries in text, JSON, or Discord-friendly formats. The script structures aggregated token usage and cost data to support these export formats.

Does the session cost analyzer work without external dependencies?

Yes, the session cost analyzer works without external dependencies. It runs as a standalone Node.js script and reads JSONL session files directly from the default path.

How do I report on cache token usage across different models?

To report on cache token usage across different models, the script reads your OpenClaw session logs and aggregates cache tokens alongside input and output tokens to provide a complete usage summary.

What performance metrics can I extract from OpenClaw session logs?

You can extract token usage, costs, and latency performance metrics from OpenClaw session logs. The analyzer aggregates these metrics to help optimize API spending and model efficiency across sessions.