LLM Cost Guard for Openclaw

A real-time LLM API spending tracker and budget enforcer designed to prevent runaway costs for AI agents and multi-user applications.

mariusfit
v1.0.0
Feb 25, 2026
0
448
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install llm-cost-guard

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 llm-cost-guard 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 LLM Cost Guard?

LLM Cost Guard is a specialized utility within the Openclaw Skills library that provides granular control over AI spending. It allows developers to monitor token usage across multiple providers, enforcing strict daily or monthly financial limits to avoid unexpected API bills.

By recording every LLM call including tokens in/out and specific model rates, this tool ensures transparency for AI-driven workflows. It is particularly valuable for developers managing multi-user environments or complex agentic systems where cost attribution and budget enforcement are critical requirements of the Openclaw Skills ecosystem.

LLM Cost Guard Use Cases

  • Managing Homelab AI automation by tracking independent budgets for various Openclaw Skills agents.
  • Implementing multi-user chatbot quotas to provide free daily tiers while preventing resource abuse.
  • Performing comprehensive cost audits to analyze monthly AI spend breakdowns by model, provider, and user.
  • Preventing runaway costs in autonomous agent loops through real-time budget blocking.

How LLM Cost Guard Works

  1. The skill intercepts or receives manual log entries of LLM API calls containing model name and token counts.
  2. It calculates the exact cost based on built-in February 2026 pricing rates for providers like OpenAI, Anthropic, and Groq.
  3. The system compares the cumulative spend against user-defined daily or monthly budget thresholds.
  4. If usage reaches 80%, an alert is triggered via the configured notification channel (WhatsApp, Telegram, or Discord).
  5. Upon hitting 100% of the budget, the skill blocks further requests to ensure financial safety.

LLM Cost Guard Setup

To begin managing your AI spend with Openclaw Skills, install the utility and set your first daily budget:

# Set a daily budget of $5.00
llm-cost-guard set-limit daily 5.00

# Log your first LLM call manually to test tracking
llm-cost-guard log --model gpt-4o --input-tokens 1500 --output-tokens 800 --user dev-admin

# Check your current budget status
llm-cost-guard status

LLM Cost Guard Data Schema & Taxonomy

The skill maintains a local, privacy-first JSON database. No external telemetry is used, keeping all financial data within your controlled environment.

Data Point Description
dailyCostLimit Maximum USD allowed per 24-hour cycle
monthlyCostLimit Maximum USD allowed per calendar month
perUserDailyCostLimit Specific quota assigned to individual API consumers
dataPath Local storage path: ~/.openclaw/workspace/llm-cost-guard-data.json

LLM Cost Guard Advanced Features

  • Built-in pricing tables for 2026 flagship models from OpenAI, Anthropic, and Groq.
  • Automated cron integration for morning spend summaries and midnight counter resets.
  • Zero-dependency architecture using only Node.js stdlib for maximum security and performance within Openclaw Skills.
  • Multi-channel alerting support for WhatsApp, Telegram, and Discord integrations.
  • Live tailing of LLM calls via the watch command for real-time debugging.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*