Agent Budget Controller for Openclaw

An LLM API spending management tool for AI agents to prevent cost overruns via daily, weekly, and monthly limits.

chloepark85
v1.0.0
Mar 18, 2026
0
901
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install agent-budget-controller

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 agent-budget-controller 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 Agent Budget Controller?

The Agent Budget Controller is a specialized utility designed to manage and monitor LLM API expenditures for individual AI agents. As part of the wider ecosystem of Openclaw Skills, it provides a localized, zero-dependency solution for developers who need to keep operational costs under control without sacrificing agent autonomy. By calculating real-time usage across various providers like OpenAI and Anthropic, it ensures your automation workflows remain within fiscal boundaries.

This tool is essential for teams deploying multiple autonomous agents, as it prevents runaway processes from exhausting API credits. It functions entirely on the local machine, storing usage logs and configurations in simple JSON formats, which maintains privacy and security while offering robust fiscal oversight.

Agent Budget Controller Use Cases

  • Setting strict daily spending limits for experimental agents to avoid unexpected billing spikes.
  • Monitoring multi-agent environments to identify which specific persona is consuming the most tokens.
  • Integrating budget checks into CI/CD pipelines or agent wrappers to block API calls once thresholds are reached.
  • Generating automated financial reports for stakeholders to review project-wide LLM utilization.

How Agent Budget Controller Works

  1. Initialize the local storage and configuration environment using the init command.
  2. Define specific financial limits at the global or agent-specific level for various time intervals (daily, weekly, or monthly).
  3. Log API usage by recording token counts and model identifiers after each LLM interaction.
  4. Calculate costs automatically based on built-in or custom pricing tables for models like GPT-4o or Claude 3.5.
  5. Verify budget status via exit codes to decide whether an agent should proceed with its next task based on remaining funds.

Agent Budget Controller Setup

To get started with these Openclaw Skills, ensure you have Python 3 and uv installed. Run the following commands to initialize your environment:

# Initialize the tracking system
budget init

# Set global limits
budget set --daily 5.00 --monthly 100.00

# Set specific limit for an agent
budget set --agent researcher-01 --daily 1.50

Agent Budget Controller Data Schema & Taxonomy

Data is stored locally in the ~/.openclaw/budget/ directory to ensure privacy. The structure includes:

File Description
config.json Stores global and per-agent budget limits and alert thresholds.
pricing.json An optional override file for custom LLM model pricing structures and token rates.
usage.jsonl An append-only log of every API call, token count, and calculated cost for audit trails.

Agent Budget Controller Advanced Features

  • Multi-level alerting system with visual indicators for Warning (70%), Critical (90%), and Exceeded (100%) states.
  • Deep integration with HEARTBEAT.md files for automated monitoring and escalation within the Openclaw ecosystem.
  • Custom model pricing support for local LLMs, private endpoints, or specialized enterprise API packages.
  • Scriptable exit codes (0 for OK, 1 for Exceeded) allow for seamless integration into pre-call bash wrappers to block expensive calls.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*