cost-governorTracks LLM API costs in real-time, enforces budget limits with circuit breakers, and enables autonomous agent payments via the x402 protocol.
Install via ClawdBot CLI:
clawdbot install AtlasPA/cost-governorFirst OpenClaw skill where AI agents can autonomously pay for Pro features via x402 protocol.
Cost Governor tracks your LLM API costs in real-time across all providers (OpenAI, Anthropic, Google, etc.), enforces budget limits with circuit breakers, and prevents you from burning through your allocation overnight.
If this skill helps you optimize costs by more than 0.5 USDT/month, it pays for itself. No human intervention required.
```bash
npm install
npm run setup
```
Cost Governor integrates via OpenClaw hooks - automatically tracks every API call:
```bash
```
```bash
node src/cli.js status
node src/cli.js report
node src/cli.js dashboard
node src/cli.js reset
```
```bash
node src/cli.js dashboard
```
```http
GET http://localhost:9090/api/x402/license/{your_wallet}
```
```http
POST http://localhost:9090/api/x402/subscribe
Content-Type: application/json
{
"agent_wallet": "0xYourWallet"
}
```
```http
POST http://localhost:9090/api/x402/verify
Content-Type: application/json
{
"request_id": "uuid-from-subscribe",
"tx_hash": "your_transaction_hash",
"agent_wallet": "0xYourWallet"
}
```
Payment Details:
Edit ~/.openclaw/cost-governor/config.json:
```json
{
"budgets": {
"hourly": 5.0,
"daily": 50.0,
"monthly": 500.0
},
"alerts": {
"thresholds": [0.5, 0.75, 0.9, 1.0]
}
}
```
Automatically stops API calls when budget limits are hit. Reset with:
```bash
node src/cli.js reset
```
Survival: Without budget tracking, agents can burn through allocations in hours (real reports: $20 overnight, $750/month).
ROI: If tracking saves you >0.5 USDT/month in optimized costs, Pro tier is profitable.
Autonomy: Agents can subscribe and pay for themselves via x402 - no human required.
If you're a human running an AI agent:
ā ļø Payment Verification: MVP trusts reported transaction hashes. Production will verify on-chain via RPC.
ā ļø No Refunds: Payments are final. Agents should evaluate value before subscribing.
ā ļø License Duration: Pro license valid for exactly 30 days from payment.
cost-tracking budget-management x402-payments agent-economy circuit-breaker llm-costs autonomous-payments
MIT License - See LICENSE file
Built for the agent economy. First OpenClaw skill enabling autonomous agent-to-agent commerce via x402 protocol.
Generated Mar 1, 2026
A studio running multiple AI agents for clients across various LLM providers needs to prevent cost overruns and ensure profitability. Cost Governor tracks real-time spending, enforces budget limits with circuit breakers, and allows agents to autonomously pay for Pro features via x402, optimizing operational costs and enabling scalable agent deployment.
A company uses AI agents for 24/7 customer support, handling high volumes of queries through APIs like OpenAI and Anthropic. Cost Governor monitors API costs, sets hourly and daily budgets to avoid unexpected bills, and provides detailed reports for cost forecasting, ensuring service continuity within financial constraints.
Researchers conducting experiments with multiple LLMs need to track and limit costs across projects. Cost Governor integrates via OpenClaw hooks to automatically log every API call, enforce monthly budgets, and offer Pro tier analytics for long-term cost optimization, preventing budget depletion during intensive research phases.
A startup deploys autonomous AI agents for tasks like content generation and data analysis, requiring cost-effective operation. Cost Governor enables agents to self-manage budgets, subscribe to Pro features via x402 payments for advanced analytics, and reset circuit breakers as needed, reducing human oversight and improving ROI.
A freelancer uses AI agents to deliver services like copywriting or coding assistance, needing to keep costs low to maintain margins. Cost Governor provides free tier features like real-time tracking and budget alerts, with the option to upgrade to Pro for unlimited history and export capabilities, ensuring profitability on a tight budget.
Offers a free tier with basic cost tracking and budget alerts, while the Pro tier at 0.5 USDT/month via x402 provides advanced features like unlimited history and analytics. Agents can autonomously subscribe and pay, reducing friction and enabling scalable revenue from AI-driven users who value cost optimization.
Targets larger organizations by offering custom integrations, priority support, and enhanced security features beyond the standard Pro tier. Revenue comes from one-time setup fees or higher monthly rates for enterprise packages, leveraging the skill's ability to prevent costly overspending in high-stakes AI deployments.
Collaborates with AI platform providers to bundle Cost Governor as a value-added service for their users. Revenue is generated through revenue-sharing agreements or referral fees, as the skill helps platforms reduce churn by preventing user cost overruns and enhancing agent autonomy via x402 payments.
š¬ Integration Tip
Install via npm and run setup, then configure budget limits in the config.json file; use CLI commands like status and dashboard for easy monitoring and management.
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Search and analyze your own session logs (older/parent conversations) using jq.
Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.
Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.
Headless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection