@karmaniverous/jeeves-scripts-core
    Preparing search index...

    Function getTokenMetrics

    • Query token metrics over a time range.

      Reads hourly bucket files from disk and aggregates them into the Costs report with per-channel and per-model breakdowns. Every hour from the one containing from to the one containing to is included.

      Parameters

      Returns Costs

      const june = getTokenMetrics({ from: '2026-06-01', to: '2026-06-30T23:59:59Z' });
      const lastWeek = getTokenMetrics({ from: new Date(Date.now() - 7 * 86_400_000) });

      When from or to is not a valid date.