Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

tokenmeter

bởi cheenu1092-oss

Coding Agents & IDEs
1.2kLượt tải do clawskills.sh công bố
0Lượt xem
0 lượt thíchĐăng nhập để thích kỹ năng này
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

Track AI token usage and costs across providers.

Mô tả

Kỹ năng này làm gì

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.

Khi nào nên dùng

  • 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

Quy trình ví dụ

ĐẦU VÀO

User asks: how much did we spend this week?

AGENT
  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

ĐẦU RA

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

Cài đặt

clawhub install cheenu1092-oss/tokenmeter

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết