A TypeScript-powered SQLite utility for real-time tracking of AI model token usage and automated budget enforcement.
The fastest way to install a skill directly from the registry.
npx clawhub@latest install agent-usage-tracker
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-usage-tracker 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 Usage Tracker provides a robust local accounting framework for developers building with LLMs. It solves the challenge of cost visibility by persisting token usage data into a SQLite database, allowing for real-time cost calculation based on specific model pricing. This skill is essential for maintaining financial predictability and operational transparency in any project utilizing Openclaw Skills.
By integrating this tracker, you can move beyond opaque provider dashboards and implement fine-grained control over your AI spend. It provides the infrastructure needed to log every interaction, calculate expenses on the fly, and manage budget policies that can warn or halt agents when spending limits are reached.
To set up the tracking workflow within your Openclaw Skills environment, ensure you have the core TypeScript files from the source directory and initialize the tracker as follows:
# Navigate to your project directory
cd your-agent-project
# Ensure dependencies are installed
npm install sqlite3
import { UsageTracker } from './src/UsageTracker';
import { CostCalculator } from './src/CostCalculator';
const tracker = new UsageTracker('agent_usage.sqlite');
const calculator = new CostCalculator();
The Agent Usage Tracker organizes data into a structured format for easy querying and reporting:
| Property | Description |
|---|---|
model_id |
The normalized ID of the LLM used (e.g., gpt-4, claude-3). |
prompt_tokens |
The count of tokens sent to the model. |
completion_tokens |
The count of tokens generated by the model. |
total_cost |
The calculated cost based on the CostCalculator pricing logic. |
session_id |
A unique identifier to group usage by specific agent runs. |
metadata |
A JSON field for provider-specific details like tool calls or request IDs. |
Loading
A high-performance TypeScript task queue for OpenClaw that orchestrates multi-agent workflows with priority scheduling and dependency management.

A robust SQLite-backed storage system for AI agents that provides long-term memory, metadata management, and semantic retrieval.

A high-performance communication layer providing direct messaging, pub/sub events, and persistent storage for autonomous agent interactions.

A comprehensive toolkit for automating image uploads, messaging, and visual analysis within the Feishu (Lark) communication platform.

An intelligent news aggregation skill that filters and delivers the top 10 trending news stories from major Chinese platforms directly to your communication tools.

A professional tool for automatically generating technical solution documents, including architecture design, tech stacks, and scheduling.








































