Expand description
Token/cost accounting shapes for the usage subject.
Distinct from crate::usage (Anthropic plan/subscription
utilization): these describe per-model and per-project token counts
plus a notional API-equivalent cost, rolled up from the session
JSONL pool. The scanner lives in forge-agent::env::token_usage,
the redb cache in forge-workspace::store::token_usage.
Re-exports§
use serde::Deserialize;🔒use serde::Deserialize;🔒use serde::Serialize;🔒use serde::Serialize;🔒
Structs§
- Model
Pricing - Per-token USD pricing for one model, sourced from the LiteLLM table.
Cache-write splits by TTL tier to match the JSONL’s
cache_creation.ephemeral_{1h,5m}breakdown. - Usage
Report - The four rolling windows the
/usageoverlay drew.lifetimeis a static sum; the other three are recomputed relative to now. - Usage
Row - One row of the usage table:
labelis a model id, a folded project name, or"TOTAL"for the aggregate row. Token counts are split;cost_usdis notional (at API pricing, not a bill). - Window
Usage - One time window’s usage: the same data grouped two ways plus the
aggregate
totalrow. EachVecis sorted by cost descending.