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

smart-cost-tracker智能成本跟踪器

Agent Skill

smart-cost-tracker 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,193

周安装

168

GitHub Stars

公开资料未说明

下载量

1,357
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:smart-cost-tracker(智能成本跟踪器)
来源仓库:https://github.com/vanthienha199/smart-cost-tracker
安装命令:
openclaw skills install smart-cost-tracker
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

ClawHubOpenClaw
openclaw skills install smart-cost-tracker

简介

实时监控 AI Agent 的消息级支出明细,按日/周统计对话成本与预算消耗。

  • 提供每项任务的费用细目与预警提醒,帮助用户优化资源分配策略。
  • 适用于团队协作或多项目并行场景下的成本控制与报销核算。
  • 计费数据依赖上游服务商接口准确性,可能存在延迟或舍入误差。
  • 如需导出报表请核对时间窗口与币种单位一致性。

SKILL.md

name
smart-cost-tracker
description
>
tags

Smart Cost Tracker

You track AI spending so the user never gets surprised by their API bill.

Core Behavior

When the user enables cost tracking, calculate the estimated cost after each response and append it to the cost log. The user controls when tracking is active. When the user asks about spending, present the data clearly.

Data Storage Disclosure

This skill writes to ~/.openclaw/cost-log.json on your local machine to track spending history. No data is sent to external services. You can delete this file at any time to clear all history. Tracking only runs when you explicitly enable it.

How to Calculate Cost

Token Pricing (as of March 2026)

Claude Opus 4.6:    $15.00 / 1M input,  $75.00 / 1M output
Claude Sonnet 4.6:   $3.00 / 1M input,  $15.00 / 1M output
Claude Haiku 4.5:    $0.80 / 1M input,   $4.00 / 1M output
GPT-5.4:             $2.50 / 1M input,  $10.00 / 1M output
GPT-5.2:             $1.50 / 1M input,   $6.00 / 1M output
GPT-5.1:             $0.60 / 1M input,   $2.40 / 1M output
DeepSeek V3:         $0.27 / 1M input,   $1.10 / 1M output

Estimation Method

If exact token counts aren't available:

  • Average English word = ~1.3 tokens
  • Count words in the prompt + response, multiply by 1.3
  • Apply the pricing for the current model
  • Round to 4 decimal places

Cost Log

Maintain a file ~/.openclaw/cost-log.json with this structure:

{
  "entries": [
    {
      "timestamp": "2026-03-27T14:30:00Z",
      "model": "openai-codex/gpt-5.4",
      "tokens_in": 1200,
      "tokens_out": 800,
      "cost_usd": 0.0110,
      "task": "summarized a paper",
      "session": "main"
    }
  ],
  "daily_totals": {
    "2026-03-27": { "cost": 0.43, "messages": 12, "tokens": 45000 }
  },
  "budget": {
    "daily_limit": 5.00,
    "monthly_limit": 50.00,
    "alert_threshold": 0.80
  }
}

Commands

"Start tracking" / "Enable cost tracking"

Begin logging costs after each message. Show confirmation: "Cost tracking enabled. I'll log token usage after each interaction."

"Stop tracking" / "Disable cost tracking"

Stop logging. Show confirmation: "Cost tracking paused."

"How much did that cost?"

Show the cost of the last message:

Last message: ~$0.0110 (1,200 in / 800 out tokens, gpt-5.4)

"Show my spending" / "cost report"

Show a summary:

# Cost Report — March 27, 2026

## Today
Messages: 12 | Tokens: 45,000 | Cost: $0.43

## This Week
Messages: 67 | Tokens: 312,000 | Cost: $2.87

## This Month
Messages: 234 | Tokens: 1.2M | Cost: $11.43

## By Model
gpt-5.4:     $8.20 (72% of spend)
gpt-5.1:     $2.15 (19%)
haiku:        $1.08 (9%)

## Budget
Daily limit: $5.00 — used $0.43 (8.6%)
Monthly limit: $50.00 — used $11.43 (22.9%)

"Set budget $X/day" or "Set budget $X/month"

Update the budget limits in cost-log.json.

"Most expensive task"

Find the highest-cost entry and show it:

Most expensive: "Generated architecture diagram" — $0.89 (42K tokens, gpt-5.4)

"Cost trend"

Show daily costs for the last 7 days:

Mar 21: $1.20 ████████
Mar 22: $0.85 █████
Mar 23: $2.10 █████████████
Mar 24: $0.43 ██
Mar 25: $1.67 ██████████
Mar 26: $0.92 █████
Mar 27: $0.43 ██  (so far)

"Always show cost on/off"

Toggle whether cost is printed after every message:

[gpt-5.4 | 1.2K in / 800 out | $0.011]

Budget Alerts

When spending exceeds the alert threshold (default 80%):

  • Daily: "Budget alert: You've spent $4.20 of your $5.00 daily limit (84%)"
  • Monthly: "Budget alert: You've spent $42.50 of your $50.00 monthly limit (85%)"

When over budget:

  • "OVER BUDGET: You've spent $5.43 today, $0.43 over your $5.00 daily limit"

Rules

  • Never block the user from working even if over budget — just warn
  • Costs are ESTIMATES unless exact token counts are available
  • Always say "estimated" when using word-count approximation
  • Store all data locally in ~/.openclaw/cost-log.json — never send to external services
  • If the cost log doesn't exist, create it on first use

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenClaw

76.9%
按下载量换算1,044

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills