home / skills / openclaw / skills / ai-bill-clawhub

ai-bill-clawhub skill

/skills/fumarole16-afk/ai-bill-clawhub

This skill helps you monitor real-time AI API usage and costs across providers with a live dashboard and budget controls.

npx playbooks add skill openclaw/skills --skill ai-bill-clawhub

Review the files below or copy the command above to add this skill to your agents.

Files (12)
SKILL.md
1.4 KB
---
name: ai-bill-intelligence
description: Real-time AI API usage tracking and cost monitoring for OpenClaw. Track spending across OpenAI, Claude, Gemini, Kimi, DeepSeek, and Grok with live dashboard. Use when users need to monitor AI API costs, track token usage, or manage budgets for multiple AI providers.
version: 2.0.0
---

# AI Bill Intelligence

Real-time AI API usage tracking and cost monitoring dashboard for OpenClaw.

## Quick Start

1. Install the skill
2. Configure your API balances in `vault.json`
3. Start the services: `systemctl start ai-bill ai-bill-collector`
4. View dashboard at `http://localhost:8003`

## Configuration

Edit `vault.json` to set your initial balances:
```json
{
  "openai": 10.0,
  "claude": 20.0,
  "kimi": 15.0,
  "deepseek": 8.0,
  "grok": 10.0,
  "gemini": 0
}
```

## Services

- **ai-bill.service**: Web dashboard (port 8003)
- **ai-bill-collector.service**: Usage data collector (updates every 30s)

## Usage

The collector automatically reads OpenClaw session data and calculates costs in real-time. View the dashboard to see:

- Real-time spending by provider
- Remaining balances
- Token usage statistics
- Cost trends

## Pricing

Default pricing is configured in `prices.json`. Update this file to match current API rates.

## Troubleshooting

Check service status:
```bash
systemctl status ai-bill ai-bill-collector
```

View collector logs:
```bash
journalctl -u ai-bill-collector -f
```

Overview

This skill provides real-time AI API usage tracking and cost monitoring for OpenClaw. It consolidates spending and token metrics across OpenAI, Claude, Gemini, Kimi, DeepSeek, and Grok into a live dashboard. Use it to monitor budgets, spot spikes, and keep multi-provider billing under control.

How this skill works

A lightweight collector service reads OpenClaw session data and computes costs using provider rates from a local prices file. The web dashboard serves aggregated views (per provider and overall), remaining balances from vault.json, token counts, and recent cost trends. The collector updates frequently (default every 30s) so the dashboard reflects near real-time usage.

When to use it

  • You need to monitor API spending across multiple AI providers in one place.
  • You want live token usage and cost visibility for OpenClaw sessions.
  • You must enforce or track per-provider budgets and remaining balances.
  • You want a quick way to detect unexpected cost spikes or billing anomalies.
  • You run multiple projects or teams using different AI providers and need consolidated reports.

Best practices

  • Set accurate initial balances in vault.json and keep them up to date.
  • Maintain current pricing in prices.json to ensure cost calculations are correct.
  • Run the collector as a managed service and monitor its logs for failures.
  • Secure access to the dashboard (port 8003) and restrict who can edit vault and price files.
  • Regularly review trends to adjust budgets, quotas, or model choices.

Example use cases

  • Finance team tracks cumulative monthly spending across OpenAI, Gemini, and Claude to stay within budget.
  • Platform operator detects a sudden increase in token usage from a misconfigured integration and stops it quickly.
  • Product manager compares cost-per-response across providers to decide which model to standardize on.
  • DevOps uses the collector service to feed alerts into monitoring when expected spend thresholds are exceeded.
  • Small teams share a single dashboard to split AI costs fairly and reconcile charges.

FAQ

How do I set my initial budgets?

Edit vault.json with per-provider balances and restart services if necessary.

How often does the data refresh?

The collector updates by default every 30 seconds; adjust the collector schedule if needed.