Skip to main content
Every time your agent runs with a session store, it records total_tokens and cost per session. praisonai usage reports those totals β€” no config, no network.

Quick Start

1

Run the report

Print the last 30 days, grouped by day.
2

Group by model or project

Switch the grouping dimension with --by.
3

Window the results

Limit the report to a time window with --days (0 = all history).
4

Emit JSON

Produce machine-readable output for scripts.
5

See per-tool reliability

Reports calls, success rate, average latency, and the last error for each tool used.

How It Works

The command reads the current-project and global default session stores, filters by time window, groups the rows, then renders a table or JSON.

Options

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

Which --by should I pick?

Pick the grouping that answers your question. tool sorts by most-called first, so your busiest (or busiest-failing) tool rises to the top.

Per-Tool Reliability

praisonai usage --by tool reports per-tool call counts, success rate, average and last latency, and the last error β€” read from the local session store, same as every other grouping.
Last ms and Last error are picked by when the tool itself last ran, not by when the session was last updated. If no tool calls are recorded, the command prints No tool usage recorded yet.
The tally counts tool outcomes that reach the AFTER_TOOL hook β€” which covers normalised tool failures (the common case). A raw exception that escapes the tool retry loop does not fire AFTER_TOOL and is not counted.

JSON Output

--json prints a stable shape for dashboards and pipelines.
Table output shows cost to 4 decimal places ($0.0034); JSON rounds to 6. With --by tool, each row describes a tool instead of a spend bucket:
Tool mode omits the top-level total_tokens / cost fields β€” it reports outcomes, not spend.

Common Patterns

Run a quick weekly review of spend by day.
Audit which model costs the most across all history.
Feed a JSON report into a spreadsheet or dashboard.
Spot flaky or slow tools.

Best Practices

Rows only exist once agents run with a session store. Enable one with memory="history" or a session_id so praisonai usage has data to report.
A short window (--days 7) scans fewer sessions and returns quicker during active development.
Pipe --json into jq or a spreadsheet instead of parsing the table.
Passing --project <id> reads only that project’s store β€” the global bucket is skipped.
Run praisonai usage --by tool --days 7 as part of your weekly review. Rows are sorted by call count first, so the busiest tool is on top β€” and the Success column immediately shows which ones are quietly failing. Pipe --json into jq in CI to fail a build when any tool drops below your target success rate.

CLI Reference

Full command tree, including session commands

Session Resume

The session store these totals come from