Skip to main content
See how many tokens and dollars your agents have spent β€” locally, with one command, no external service.
Run praisonai at least once so a session exists β€” otherwise the report is empty.

Quick Start

1

See your spend

2

Change the grouping

3

Narrow the window or script it


How It Works

The command reads the already-persisted total_tokens and cost fields on each session record in the local session store, filters by --days, groups by --by, and renders a table or JSON. No new data is written, no network calls, no configuration.
Cost values match praisonai tracker β€” both read from the same pricing reference.

Choosing --by

Pick the dimension that answers your question. day sorts chronologically; model and project sort by highest token count first.

Options

An invalid --by value prints --by must be one of: day, model, project and exits with code 1.

Output Formats

Zero values render as -, and a final Total row sums the report.

Empty Stores and Warnings

Empty and broken reports are always distinguishable.
  • No sessions yet? The command prints No usage recorded yet and exits 0.
  • A damaged or unreadable store surfaces as Usage may be incomplete: ... in table mode, or in the top-level errors array in JSON mode.

Best Practices

Wire praisonai usage --days 7 --json into a cron or CI job and alert if cost exceeds a threshold.
Run praisonai usage --by model weekly to see which model your agents actually spend the most on.
Use praisonai usage --project <id> inside a workspace and praisonai usage --by project in the default shell to compare workloads.
--json is stable for scripting β€” pipe into jq or a small dashboard rather than parsing the table.

Token Usage Protocol

Wire custom sinks and queries (databases, dashboards)

Sessions

The store praisonai usage reads from

Cost Tracker

Per-run token and cost tracking