ccusage / calculate-cost / getTotalTokens
Function: getTotalTokens()
ts
function getTotalTokens(tokenCounts): number;
Calculates the total number of tokens across all token types Supports both raw usage data format and aggregated data format
Parameters
Parameter | Type | Description |
---|---|---|
tokenCounts | AnyTokenCounts | Object containing counts for each token type |
Returns
number
Total number of tokens