跳到正文
TakoAPI
返回技能列表

tokenmeter

由 cheenu1092-oss 提供

Coding Agents & IDEs
1.2k下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Track AI token usage and costs across providers.

描述

该技能的功能

Tracks LLM token usage and calculates API-equivalent costs, storing all data locally in SQLite at ~/.tokenmeter/usage.db. Session files from OpenClaw and Claude Code are parsed to produce per-model cost breakdowns, including prompt cache read and write tokens. Shows how much a flat-rate subscription like Claude Max saves compared to pay-as-you-go API billing.

It accounts for prompt cache read and write tokens separately, which most cost calculators ignore, giving a more accurate API-equivalent spend figure.

何时使用

  • Checking how much you spent on Claude this week
  • Comparing Claude Max plan value against API billing costs
  • Finding which models account for the largest share of spending
  • Monitoring daily token usage across multiple agent instances
  • Month-end billing reconciliation before the billing cycle closes

示例工作流

输入

User asks: how much did we spend this week?

智能体
  1. 1

    Checks if tokenmeter is installed at ~/clawd/tokenmeter, clones and sets up the Python venv if missing

  2. 2

    Activates the venv and runs tokenmeter import --auto to pull in latest session files

  3. 3

    Runs tokenmeter costs --period week to get a per-model cost breakdown

  4. 4

    Parses output to extract totals and per-model percentages

  5. 5

    Responds with a plain-English summary including Max plan savings estimate

输出

Weekly API-equivalent cost broken down by model, with savings compared to the flat subscription cost

安装

clawhub install cheenu1092-oss/tokenmeter

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接