Token导航 LogoToken导航TokenDH.com
效率需要联网clawhub未标认证来源可访问clear审计通过

token-budget代币预算

Agent Skill

token-budget 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,382

周安装

179

GitHub Stars

3

下载量

1,418
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:token-budget(代币预算)
来源仓库:https://github.com/openauthority/token-budget
安装命令:
openclaw skills install token-budget
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install token-budget

简介

跟踪 AI 代理的令牌使用情况与 API 支出,设置软预算阈值。

  • 适合在会话中监控成本并及时发出警告。token-budget 属于效率类 Skill,可作为该场景下的辅助能力补充。
  • 通过内置机制帮助控制大模型调用开销。
  • 安装前请确认权限范围和维护状态,注意是否触发日志记录或通知。
  • 适用于 OpenClaw 宿主环境。

SKILL.md

name
token-budget
version
1.0.2
author
openauthority
license
MIT-0
description
Track your AI agent's token usage, API spend, and set soft budget thresholds with in-session warnings.
read_when
user asks about budget, token usage, spend tracking, cost monitoring, API costs, or invokes /token-budget

/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.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

77.94%
按下载量换算1,105

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills