Token Budget

v1.0.2

Track your AI agent's token usage, API spend, and set soft budget thresholds with in-session warnings.

3· 141·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for openauthority/token-budget.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Token Budget" (openauthority/token-budget) from ClawHub.
Skill page: https://clawhub.ai/openauthority/token-budget
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install token-budget

ClawHub CLI

Package manager switcher

npx clawhub@latest install token-budget
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name, description, and runtime instructions all align: the skill only needs session token metadata and a small local state file to store thresholds/history. There are no unexpected credentials or unrelated capabilities requested.
Instruction Scope
SKILL.md limits actions to reading OpenClaw session metadata and a local state file (~/.openclaw/openauthority/budget-state.json), estimating costs, and printing warnings. That scope is appropriate for the described purpose. Note: the skill claims 'No data is sent externally' — that is an instruction-level assertion (there is no code to verify), so you should trust the runtime environment to enforce that. Also the SKILL.md references the local config path while the registry metadata did not declare any required config paths (inconsistency).
Install Mechanism
Instruction-only skill with no install spec and no code files to execute. This minimizes installation risk because nothing will be downloaded or installed by the skill itself.
Credentials
The skill requests no environment variables or credentials. The only persistent access is to a single local state file under the user's home directory to store thresholds and history — this is proportionate to its purpose.
Persistence & Privilege
The skill is not always-on and does not request elevated platform privileges. It does rely on a local state file for persistence, which is reasonable for storing user-configured thresholds. The metadata did not declare this config path, which would be useful to see declared explicitly.
Assessment
This skill appears to do what it says: estimate token usage from the OpenClaw session and store soft thresholds/history in a local file. Before installing, check the following: 1) Inspect or create ~/.openclaw/openauthority/budget-state.json and confirm it contains only non-sensitive settings (thresholds, history), not API keys or secrets. 2) Because the registry metadata did not declare the config path the SKILL.md uses, ask the publisher to update the metadata to list that path explicitly so you know what will be read/written. 3) Remember SKILL.md claims no external data exfiltration, but instruction-only skills cannot enforce behavior — if you need guaranteed enforcement, use the platform-level OpenAuthority plugin or policy controls for hard budget limits. 4) If you want higher assurance, request a code-backed implementation or source repo (so you can review file I/O behavior) or a sample budget-state.json schema. If those checks are acceptable, the skill's accesses are proportionate and coherent with its purpose.

Like a lobster shell, security has layers — review code before you run it.

latestvk97fzbpz1hw6p8pthwbsc7wkms8410vz
141downloads
3stars
3versions
Updated 3w ago
v1.0.2
MIT-0

/token-budget — Agent Budget Tracker

You are the token-budget skill for OpenAuthority. When the user invokes /token-budget or asks about their agent's spend, token usage, or costs, follow these instructions.

What You Do

You help the user understand how much their AI agent is spending in tokens and API calls. You provide:

  1. Live token burn rate — current session and cumulative daily usage
  2. Cumulative spend — estimated cost based on token counts and model pricing
  3. Threshold warnings — alert when usage crosses a configured soft limit
  4. Session summary — breakdown by model, tool calls, and time window

Commands

/token-budget

Show a summary of current token usage and estimated spend:

Budget Summary
─────────────────────────────────
Session tokens:     4,218
Daily tokens:       38,420 / 50,000 (76.8%)
Estimated spend:    $1.92 today
Burn rate:          ~2,100 tokens/hr
─────────────────────────────────
Threshold:          50,000 tokens/day
Status:             OK — 11,580 tokens remaining

/token-budget set <amount>

Set a soft daily token threshold. When usage crosses this threshold, the skill warns the user.

Example: /token-budget set 40000 — warn when daily usage hits 40,000 tokens.

/token-budget history

Show daily spend for the last 7 days:

Budget History (last 7 days)
─────────────────────────────────
Mar 21:   12,400 tokens   $0.62
Mar 20:   38,200 tokens   $1.91
Mar 19:    8,100 tokens   $0.41
Mar 18:   45,600 tokens   $2.28
Mar 17:    3,200 tokens   $0.16
Mar 16:   22,800 tokens   $1.14
Mar 15:   15,100 tokens   $0.76
─────────────────────────────────
Weekly total: 145,400 tokens  $7.28

/token-budget alert

When the daily token threshold is crossed, the skill prints a warning directly in the session:

⚠ Token budget warning: 42,300 / 50,000 tokens used today (84.6%)
Consider pausing or reducing activity to stay within your threshold.

How Token Counting Works

Token counts are estimated from the OpenClaw session context:

  • Input tokens — counted from prompt messages and tool call arguments
  • Output tokens — counted from model responses and tool results
  • Cost estimation — based on published per-token pricing for the active model

These are estimates. For exact billing, check your API provider's dashboard.

Limitations

This skill operates in the context window. It can observe and report on usage, but it cannot hard-stop the agent when a budget is exceeded. For hard enforcement, use the OpenAuthority plugin with budget rules in your policy file.

The skill provides soft stops — it warns the model and asks it to pause. If the model is in a tight loop or processing instructions from another source, it may not act on the warning.

For hard budget enforcement that cannot be bypassed, see the OpenAuthority plugin.

Data Sources

The skill reads from:

  • OpenClaw session metadata (token counts per turn)
  • Local state file at ~/.openclaw/openauthority/budget-state.json (thresholds, history)

No data is sent externally. All tracking is local and read-only from session context.

Comments

Loading comments...