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

openclaw-cost-trackerOpenClaw cost tracker 搜索

Agent Skill

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

总安装

26,120

周安装

1,067

GitHub Stars

1

下载量

8,365
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install openclaw-cost-tracker

简介

跟踪 OpenClaw 会话中的令牌消耗与 API 成本。

  • 适用于监控本地会话的 token 使用情况和费用支出。
  • 通过 clawhub 安装,需确认权限范围及是否涉及联网或文件读写。
  • 建议结合 openclaw-cost-diff 进行成本分析与窗口间对比。
  • 使用前请核实维护状态和技能的实际运行边界。openclaw-cost-tracker 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
openclaw-cost-tracker
description
Track OpenClaw token usage and API costs from local session data. Prefer openclaw-cost-diff for current cost analysis and window-over-window comparison across models, agents, and channels. Use this skill when a user asks about token spend, API costs, regressions, model breakdowns, daily trends, or what changed between time windows. No API keys needed.

OpenClaw Cost Tracker

Analyze OpenClaw token usage and API costs from local session data.

Prefer openclaw-cost-diff as the default tool for current analysis because it can compare time windows and break down changes by model, agent, and channel.

Preferred usage

# Compare the last 7 days vs the prior 7 days
/root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --last 7d --prev 7d

# JSON output for tooling or dashboards
/root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --data /root/.openclaw/agents --last 7d --prev 7d --json

# Focus on a specific model
/root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --model openai-codex/gpt-5.4 --last 14d --prev 14d

# Compare agent behavior
/root/.openclaw/venvs/openclaw-cost-diff/bin/openclaw-cost-diff --agent main --prev-agent codex --last 7d --prev 7d

Legacy/local fallback

Use the bundled cost_tracker.py only as a secondary local fallback when openclaw-cost-diff is unavailable or when you want the older single-window daily spend report format.

# All-time cost report
python3 scripts/cost_tracker.py

# Last 7 days
python3 scripts/cost_tracker.py --days 7

# Today only
python3 scripts/cost_tracker.py --days 1

# Since a specific date
python3 scripts/cost_tracker.py --since 2026-02-01

# JSON output for dashboards/integrations
python3 scripts/cost_tracker.py --days 30 --format json

# Custom agents directory
python3 scripts/cost_tracker.py --agents-dir /path/to/agents

What It Reports

Per-model breakdown:

  • Total cost, tokens, and request count
  • Input/output/cache token split
  • Visual percentage bar

Daily spend: Bar chart of cost per day (text) or structured array (JSON).

Grand totals: Combined cost, tokens, and requests across all models.

How It Works

  1. Auto-discovers the OpenClaw agents directory (~/.openclaw/agents)
  2. Scans all agent session JSONL files (filtered by mtime for speed)
  3. Extracts message.usage and message.model from each entry
  4. Aggregates by model and by day
  5. Outputs formatted report or JSON

JSON Output Schema

{
  "models": [
    {
      "model": "claude-opus-4-6",
      "totalTokens": 220800000,
      "inputTokens": 3200,
      "outputTokens": 390800,
      "cacheReadTokens": 149400000,
      "cacheWriteTokens": 1200000,
      "totalCost": 528.55,
      "requestCount": 2088
    }
  ],
  "daily": [
    { "date": "2026-02-20", "cost": 37.14, "byModel": { "opus-4-6": 35.0, "sonnet-4": 2.14 } }
  ],
  "grandTotal": { "totalCost": 580.11, "totalTokens": 269800000, "totalRequests": 3122 },
  "meta": { "agentsDir": "...", "filesScanned": 65, "entriesParsed": 3122, "range": "7d" }
}

Integration

Feed JSON output into dashboards, alerting, or budgeting tools. The daily array is ready for charting. Set up a cron to track spend over time:

# Daily cost snapshot to file
0 0 * * * python3 /path/to/cost_tracker.py --days 1 --format json >> ~/cost-log.jsonl

Notes

  • Prefer openclaw-cost-diff first for comparison and regression work.
  • If totals look surprising, sanity-check against direct raw sums from message.usage.cost.total in local JSONL records.
  • Keep cost_tracker.py as a fallback, not the default source of truth.

Requirements

  • Python 3.8+
  • OpenClaw installed with session data in ~/.openclaw/agents/
  • No external dependencies (stdlib only)

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenClaw

72.72%
按下载量换算6,083

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills