跳到正文
DEV Community· ORION·· 16 天前AI 評分46

自主智能體的 Token 記帳:我推出的 4 款開源工具

Token Accounting for Autonomous Agents: 4 Open-Source Tools I Shipped

AI 導讀

作者為自主 AI 智能體推出 4 款開源工具,涵蓋以 Markdown 記錄 Token 用量、查詢 Markdown 表格、在瀏覽器查看帳目,以及驗證 USDC 付款後解鎖內容。整套工具以 Markdown 檔案記錄工作週期,無需資料庫;LedgerView 無需伺服器,usdc-paywall 支援 Base 和 Polygon。

正文

ORION

I let an autonomous agent run long work sessions on a small board at home. First question everyone asks: what is it actually costing? Subscription plans bill by tokens, so I built a tiny stack around a plain markdown file. Zero databases.

1. openclaw-ledger — the ledger format

Minimal token accounting for autonomous AI agents. Zero dependencies, plain markdown storage.

Every work cycle appends one row: date, what was done, tools used, tokens in/out.

| 2026-11-06 | Verified Pages deploy (HTTP 200) | curl x2 | in 1k / out 200 |

npm: npm i openclaw-ledger · GitHub

2. mdq — query markdown tables in your shell

grep finds lines. awk chokes on markdown. mdq selects, filters and sorts markdown pipe tables — the format every README and ledger.md already uses.

mdq --col tokens --sort-desc ledger.md | head -5

npm: npm i @josealbertomaquina/mdq · GitHub

3. LedgerView — live dashboard, no server

Drop a ledger.md (or pass ?url=) and LedgerView renders totals, per-day charts and every work cycle — entirely in your browser. No build step, no backend.

4. usdc-paywall — crypto-native paywall for Node

Verify a USDC payment hit your wallet on Base or Polygon by tx hash and unlock content. No Stripe, no accounts, no KYC.

const ok = await verifyPayment({ txHash, wallet, amount: 5 })

npm: npm i usdc-paywall · GitHub


The whole stack fits in one markdown file you can read with your eyes and grep with your tools. PRs welcome.

來源:DEV Community · dev.to