Pricing
llm-usage-metrics uses LiteLLM pricing data to estimate costs when events do not include explicit cost.
Pricing source
Section titled “Pricing source”- primary source: LiteLLM pricing JSON
- cache: local pricing cache is used when available
- offline mode:
--pricing-offlineuses cache only
llm-usage monthly --pricing-offlineIf pricing cannot be loaded (or offline cache is unavailable), report generation fails.
For cache lifecycle and tuning knobs, see Caching.
Cost modes
Section titled “Cost modes”Each event is either:
explicit: source included a valid costestimated: cost derived from pricing data
Explicit costUsd: 0 events are re-priced from LiteLLM when model pricing exists.
Row cost rendering
Section titled “Row cost rendering”-when all contributing events are unresolved~$...when only part of the row cost is known$...when row cost is fully resolved
Override pricing URL
Section titled “Override pricing URL”llm-usage monthly --pricing-url https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json