When To Use This
Usetm cost to see what you spent and what KV caching saved you, without configuring a separate cost-tracking proxy. Spend comes from BillingTransaction.details (populated by the billing service at charge time, so it reconciles with the ledger). Cache savings is cached_tokens x input rate — what those tokens would have cost at full price, served at ~$0 by the cache.
Cache savings is always computed over the exact window. Per-model dollar spend is calendar-month granular (one serverless transaction per user per month): --month YYYY-MM is exact, while --window 24h|7d|30d and --start/--end report the overlapping monthly spend (noted in the output).
Usage
Examples
Last 30-day spend + cache savings, per model.
Last 7-day total (per-model defaults to current month).
Exact calendar-month spend + savings for May 2026.
Exact-window spend + cache savings.
Machine-friendly JSON for piping into other tools.
Details
Show per-model serverless spend and KV-cache savings. Spend comes fromBillingTransaction.details (authoritative, reconciles
with the ledger; calendar-month granularity). Cache savings is computed as
cached_tokens x input rate — the cost those tokens would have incurred at
full input price, served at ~$0 thanks to caching — with cached tokens read
from the serverless usage history for the exact window.
Every view shows the same shape: a per-model table plus the serverless
subtotal and total cache saved. --window 24h|7d|30d (rolling),
--month YYYY-MM (exact calendar month), and --start/--end (exact range)
just change the window. Cache savings is always window-exact; per-model
dollar spend is calendar-month granular (the finest the ledger records), so
every view except --month notes that.
Options
| Name | Type | Required | Default | Details | ||
|---|---|---|---|---|---|---|
--user-id | text | no | Optional user id to scope the report (defaults to the authenticated user). | |||
--window | `choice[24h | 7d | 30d]` | no | "30d" | Rolling window for the report (mutually exclusive with —month and —start/—end). |
--month | text | no | Per-model spend + savings for a specific calendar month (YYYY-MM), aligned with how serverless transactions are aggregated. | |||
--start | text | no | Arbitrary window start (ISO 8601). With —end, reports per-model spend + cache savings for an exact range (savings is window-exact; per-model dollar spend comes from the overlapping monthly transactions). | |||
--end | text | no | Arbitrary window end (ISO 8601); defaults to now when —start is given. | |||
--timeout | float | no | HTTP timeout in seconds. |
Inherited Global Options
| Name | Type | Required | Default | Details | ||||
|---|---|---|---|---|---|---|---|---|
--version, -V | boolean | no | false | Show the version and exit. Boolean flag. | ||||
--config | path | no | "~/.config/tensormesh/config.toml" | Path to config TOML file | ||||
--output | `choice[text | json | yaml | raw | table]` | no | "text" | Output format (text is human-readable; json is machine-friendly). |
--quiet | boolean | no | false | Suppress non-essential output. Boolean flag. | ||||
--debug | boolean | no | false | Print debug logs to stderr (secrets redacted). Boolean flag. | ||||
--ca-bundle | path | no | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH_CA_BUNDLE). | |||||
--max-retries | integer | no | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH_MAX_RETRIES; subcommands may override). | |||||
--controlplane-base | text | no | Override the Control Plane base URL. |

