Skip to main content

Module cost

Module cost 

Source
Expand description

Token usage accounting and cost estimation for the Recursive TUI.

Contains UsageStats for per-session token accumulation, TurnState for in-flight turn tracking, and helpers to detect the active model and estimate dollar cost from token counts.

Structs§

TurnState
State of the currently in-flight turn (if any).
UsageStats
Token usage and timing accumulated across the session.

Functions§

detect_model_name
Return the model name to display in the status bar.
estimate_cost
Compute estimated cost in USD given accumulated tokens. Delegates to pricing_for() from the bundled provider catalog. Returns None when the model has no pricing entry in providers.toml.