pub struct Report {
pub period_label: String,
pub now_ms: i64,
pub since_ms: i64,
pub period_end_ms: Option<i64>,
pub month_inferred: bool,
pub account: Option<Usage>,
pub account_error: Option<String>,
pub clients: Vec<String>,
pub five_hour: Totals,
pub weekly: Totals,
pub month: Totals,
pub models: Vec<ModelUsage>,
}Fields§
§period_label: StringWhat the caller called this period (“calendar month”, “all”, “30d”) for display.
now_ms: i64§since_ms: i64§period_end_ms: Option<i64>End of the period (epoch ms), resolved by the caller from its own start
— see next_month. None when the period has no boundary (--window all); the rolling 5h/weekly windows never carry one.
month_inferred: bool§account: Option<Usage>The account’s own three meters, when OpenCode Go’s usage endpoint
answered (ocuse::api). The dashboard’s window rows read from here
rather than from Self::five_hour/Self::weekly/Self::month,
because only the server’s numbers agree with the console; the store’s are
the fallback. None also keeps every existing caller working.
account_error: Option<String>Why the account’s meters are absent, when that is worth saying — a refused
key, a missing one, a dead network. None when the endpoint answered, and
also for --no-api (a deliberate choice is not a fault). Without it the
dashboard’s “estimated locally” says nothing about which it was, and only
one of those is something to act on.
clients: Vec<String>Every local client the rows came from, in read order — opencode, dsh,
pi. The dashboard names them, because a total that grew when another
harness spent the same allowance must be visible, not mysterious.
five_hour: Totals§weekly: Totals§month: Totals§models: Vec<ModelUsage>Sorted by month cost, descending.