Skip to main content

When To Use This

Use tm 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

tm cost [OPTIONS]

Examples

Last 30-day spend + cache savings, per model.

tm cost

Last 7-day total (per-model defaults to current month).

tm cost --window 7d

Exact calendar-month spend + savings for May 2026.

tm cost --month 2026-05

Exact-window spend + cache savings.

tm cost --start 2026-05-01 --end 2026-05-15

Machine-friendly JSON for piping into other tools.

tm --output json cost

Details

Show per-model serverless spend and KV-cache savings. Spend comes from BillingTransaction.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

NameTypeRequiredDefaultDetails
--user-idtextnoOptional user id to scope the report (defaults to the authenticated user).
--window`choice[24h7d30d]`no"30d"Rolling window for the report (mutually exclusive with —month and —start/—end).
--monthtextnoPer-model spend + savings for a specific calendar month (YYYY-MM), aligned with how serverless transactions are aggregated.
--starttextnoArbitrary 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).
--endtextnoArbitrary window end (ISO 8601); defaults to now when —start is given.
--timeoutfloatnoHTTP timeout in seconds.

Inherited Global Options

NameTypeRequiredDefaultDetails
--version, -VbooleannofalseShow the version and exit. Boolean flag.
--configpathno"~/.config/tensormesh/config.toml"Path to config TOML file
--output`choice[textjsonyamlrawtable]`no"text"Output format (text is human-readable; json is machine-friendly).
--quietbooleannofalseSuppress non-essential output. Boolean flag.
--debugbooleannofalsePrint debug logs to stderr (secrets redacted). Boolean flag.
--ca-bundlepathnoPath to a PEM CA bundle for TLS verification (overrides TENSORMESH_CA_BUNDLE).
--max-retriesintegernoMax retries for idempotent HTTP requests on transient errors (overrides TENSORMESH_MAX_RETRIES; subcommands may override).
--controlplane-basetextnoOverride the Control Plane base URL.

Parent Command