ccusage / calculate-cost
calculate-cost
Fileoverview
Cost calculation utilities for usage data analysis
This module provides functions for calculating costs and aggregating token usage across different time periods and models. It handles both pre-calculated costs and dynamic cost calculations based on model pricing.
Functions
Function | Description |
---|---|
calculateTotals | Calculates total token usage and cost across multiple usage data entries |
getTotalTokens | Calculates the sum of all token types (input, output, cache creation, cache read) |
createTotalsObject | Creates a complete totals object by adding total token count to existing totals |