TokFlow for Openclaw

A local monitoring and optimization engine for tracking LLM costs and token usage patterns.

wangyaok1
v0.5.0
Feb 12, 2026
2
1.5k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install tokflow

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 tokflow 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 TokFlow?

TokFlow is a specialized monitoring platform designed to provide deep visibility into LLM resource consumption and spending. As a core component of the Openclaw Skills ecosystem, it automatically tracks usage across all paid models by parsing local session files in real-time. It empowers developers to manage their AI budgets effectively by offering a centralized dashboard for costs, efficiency ratings, and detailed provider statistics.

Beyond simple tracking, TokFlow provides intelligent optimization advice. It analyzes interaction patterns to suggest model replacements, cache optimizations, and prompt adjustments. By integrating this tool with Openclaw Skills, users can ensure their AI-driven workflows remain cost-effective without sacrificing performance.

TokFlow Use Cases

  • Monitoring daily and monthly token consumption and associated costs.
  • Comparing the cost-efficiency of various LLM models used in production.
  • Checking real-time account balances across providers like DeepSeek and SiliconFlow.
  • Identifying inefficient prompt patterns to reduce unnecessary token overhead.
  • Generating optimization reports to visualize potential savings from model switching.

How TokFlow Works

  1. The skill monitors local JSONL session files generated during agent interactions.
  2. Data is synchronized in real-time and hosted via a local API service on port 8001.
  3. The engine aggregates usage metrics, including token counts, fees, and active model distributions.
  4. Analytical scripts process the data to identify cost trends, P95 statistics, and anomalies.
  5. The optimization module generates actionable suggestions based on historical usage patterns.
  6. Users query the data using specific scripts that return structured JSON for the agent to interpret.

TokFlow Setup

To begin using this tool within Openclaw Skills, ensure the service is running on your local machine at port 8001. You can query the main dashboard using the following command:

scripts/tokflow_query.py dashboard

To check your remaining credits across all configured providers, run:

scripts/tokflow_query.py balance

TokFlow Data Schema & Taxonomy

TokFlow organizes data into several distinct schemas to provide a clear overview of your Openclaw Skills usage:

Schema Description Key Metrics
Dashboard High-level summary of usage Today/Month tokens, Total cost, Active models
Models Detailed model-specific stats Usage volume, Efficiency score, Total cost
Providers Provider-level aggregation Stats for DeepSeek, SiliconFlow, Minimax, etc.
Prompt Stats Interaction analysis Turn count, Average prompt length, Saving potential
Balance Financial tracking Real-time API account balances

TokFlow Advanced Features

  • Advanced prompt analysis (v0.5.0) including length distribution and turn-based cost tracking.
  • Real-time balance fetching via direct provider API integration.
  • Anomaly detection to identify and alert on unusual consumption spikes.
  • Predictive optimization engine that calculates estimated monetary savings for suggested changes.
  • Automated generation of comprehensive optimization reports.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*