Xpersona
T

Token Cost Monitor

CLAWHUB · Unverified

Monitor OpenClaw API costs in real-time, set budget alerts, and optimize model spending. Track token usage by session and model, get cost optimization tips,... Skill: Token Cost Monitor Owner: redwoo Summary: Monitor OpenClaw API costs in real-time, set budget alerts, and optimize model spending. Track token usage by session and model, get cost optimization tips,... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-03-27T01:15:41.830Z | user Initial release - API cost tracking and budget alerts Archive index: Archive v1.0.0: 5 files, 6699 bytes Files: README.md (2948b), scr

62
Rank
84
Safety
984
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 984 downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17c2bv9a7vypph86zj1a0jjrd83qxkb:token-cost-monitor
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-redwoo-token-cost-monitor/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

12,570 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: token-cost-monitor
description: >
  Monitor OpenClaw API costs in real-time, set budget alerts, and optimize model 
  spending. Track token usage by session and model, get cost optimization tips, 
  and prevent budget overruns. Use when: checking API spending, setting budget 
  alerts, optimizing model costs, analyzing usage trends.
homepage: https://github.com/openclaw/openclaw
metadata:
  openclaw:
    files: ["scripts/*"]
official: false
---

# Token Cost Monitor

Monitor OpenClaw API costs in real-time, set budget alerts, and optimize model spending.

## Why This Matters

**Real user stories:**
- One user spent $18.75 overnight on heartbeat checks asking "Is it daytime yet?"
- Federico Viticci spent $3,600 in a single month
- Regular users report $200/day bills from misconfigured automations

## Quick Commands

**Check current session costs:**
```bash
# View token usage and estimated cost
openclaw /status
openclaw /usage
```

**Set up cost alerts:**
```bash
# Alert when daily spend exceeds $10
echo "Alert if daily_cost > $10"

# Alert when monthly spend exceeds $100
echo "Alert if monthly_cost > $100"
```

## Cost Optimization Strategies

### 1. Model Routing

**Use cheaper models for simple tasks:**
- Claude Haiku: $0.25/1M input tokens (fast, cheap)
- Claude Sonnet: $3/1M input tokens (balanced)
- Claude Opus: $15/1M input tokens (expensive, powerful)

**Routing rules:**
```
Simple queries (weather, facts) → Haiku
Complex analysis → Sonnet
Creative writing → Opus (only if needed)
```

### 2. Context Management

**Reduce token waste:**
- Clear old conversation context regularly
- Don't store tool outputs in context
- Use concise system prompts
- Limit heartbeat frequency

### 3. Heartbeat Optimization

**Common mistake:**
```
❌ Every 30 min: "Is it daytime yet?" → $18.75/night
✅ Every 6 hours: Check emails + calendar → $2/day
```

**Best practices:**
- Combine multiple checks into one heartbeat
- Use longer intervals (4-6 hours)
- Skip nighttime heartbeats (23:00-08:00)
- Track heartbeat costs separately

## Cost Tracking Dashboard

### Daily Cost Breakdown

| Category | Tokens | Cost |
|----------|--------|------|
| Heartbeat checks | 50,000 | $0.50 |
| Web searches | 100,000 | $1.00 |
| Code generation | 200,000 | $2.00 |
| Document analysis | 150,000 | $1.50 |
| **Total** | **500,000** | **$5.00/day** |

### Monthly Projection

```
Daily average: $5.00
Monthly projection: $150.00
Budget limit: $100.00
⚠️ Warning: Will exceed budget by $50
```

## Budget Alerts Setup

### Tier 1: Light User ($10-30/month)
```
Daily limit: $1.00
Alert at: $0.80/day
Actions: Reduce heartbeat frequency, use Haiku more
```

### Tier 2: Regular User ($40-80/month)
```
Daily limit: $2.50
Alert at: $2.00/day
Actions: Optimize context, review model routing
```

### Tier 3: Power User ($100-500/month)
```
Daily limit: $10.00
Alert at: $8.00/day
Actions: Audit all automations, implement strict routing
```

## Cost Reduction Checklist

### Immediate Actions

README.md

# Token Cost Monitor 💰

[![ClawHub](https://img.shields.io/badge/ClawHub-skill-blue)](https://clawhub.ai)
[![OpenClaw](https://img.shields.io/badge/OpenClaw-compatible-green)](https://github.com/openclaw/openclaw)

Monitor OpenClaw API costs in real-time, set budget alerts, and optimize model spending.

## Why This Matters

**Real user stories:**
- One user spent $18.75 overnight on heartbeat checks asking "Is it daytime yet?"
- Federico Viticci spent $3,600 in a single month
- Regular users report $200/day bills from misconfigured automations

## Features

- **Real-time Cost Tracking** - Monitor API spending by session, task, and model
- **Budget Alerts** - Get notified when approaching daily/monthly limits
- **Model Routing** - Automatically route queries to cost-effective models
- **Cost Optimization Tips** - Receive actionable recommendations to reduce spending
- **Historical Analysis** - Track spending trends over time

## Installation

```bash
# Via ClawHub
openclaw skills install token-cost-monitor
```

## Usage

### Check Current Costs

Ask the agent:
```
"What's my OpenClaw spending today?"
```

### Set Budget Alert

Ask the agent:
```
"Alert me if daily spending exceeds $10"
```

### Optimize Model Routing

Ask the agent:
```
"Route simple queries to Haiku, complex tasks to Sonnet"
```

### Generate Cost Report

Ask the agent:
```
"Show me my top 5 most expensive tasks this week"
```

## Cost Optimization Strategies

### Model Pricing (2026)

| Model | Input | Output | Best For |
|-------|-------|--------|----------|
| Claude Haiku | $0.25/1M | $1.25/1M | Simple queries, facts |
| Claude Sonnet | $3/1M | $15/1M | General tasks |
| Claude Opus | $15/1M | $75/1M | Complex analysis |

### Quick Wins

1. **Reduce heartbeat frequency** - From 30min to 6 hours (saves 80%)
2. **Route to cheaper models** - Use Haiku for simple queries (saves 90%)
3. **Clear context regularly** - Prevent context bloat (saves 30-50%)
4. **Batch similar tasks** - Combine multiple checks into one call

## External Endpoints

| Endpoint | Data Sent | Purpose |
|----------|-----------|---------|
| None | N/A | All cost tracking is local |

## Security & Privacy

- **No external API calls** - All cost tracking is local
- **No credentials stored** - Reads from OpenClaw session data
- **No data exfiltration** - All analysis happens on-device

## Model Invocation

This skill analyzes OpenClaw session data to provide cost insights. It does not make external API calls.

## Trust Statement

By using this skill, no external data is sent. All cost analysis is performed locally using OpenClaw session metadata. Only install if you trust the skill author.

## Requirements

- OpenClaw v1.0+
- Access to session usage data (`/status`, `/usage` commands)

## Support

- Documentation: https://github.com/openclaw/openclaw
- OpenClaw Discord: https://discord.gg/clawd

## License

MIT License - See LICENSE file in GitHub repository

_meta.json

{
  "ownerId": "kn7dahgnw91a1qz1ax3b4sznzs81nchj",
  "slug": "token-cost-monitor",
  "version": "1.0.0",
  "publishedAt": 1774574141830
}

skill-card.md

## Description:

Provides OpenClaw cost-reference guidance, budget-alert suggestions, and model-spending optimization tips for token usage reviews.

This skill is ready for commercial/non-commercial use.

## Publisher:

[redwoo](https://clawhub.ai/user/redwoo)

### License/Terms of Use:

MIT-0

## Use Case:

External OpenClaw users and developers use this skill to review token-cost patterns, set budget guidance, and identify model-routing or context-management changes that may reduce API spend.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill may overstate active monitoring, alerting, and budget-control capabilities.

Mitigation: Treat outputs as guidance and verify actual usage, alerting, and enforcement through OpenClaw session data or separate budget controls.

Risk: Optional Slack and email alert examples could disclose cost data if run with real endpoints or unsanitized values.

Mitigation: Run external alert examples only with explicit user intent, approved destinations, and sanitized cost summaries.

## Reference(s):

- [OpenClaw](https://github.com/openclaw/openclaw)
- [Token Cost Monitor on ClawHub](https://clawhub.ai/redwoo/skills/token-cost-monitor)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with inline shell command examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Includes local cost-reference output from a shell script; does not provide live enforcement of budget limits.]

## Skill Version(s):

1.0.0 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Token Cost Monitor and adjacent AI workflows.