Skip to main content

cost_for_entry

Function cost_for_entry 

Source
pub fn cost_for_entry(entry: &UsageEntry) -> f64
Expand description

Single source of truth for per-turn cost (USD), used by both the live status bar (reduce_session) and the Usage page (commands::usage).

Splits cache-write tokens into 5-minute and 1-hour tiers, applies the fast-mode multiplier to the token line when the turn ran in fast mode, and adds the flat web-search fee (which is not a token cost and so is unaffected by the fast multiplier).