Skip to content

addUsage

function addUsage(a, b): TokenUsage;

Defined in: core/src/usage.ts:39

Add two usage records. The sum carries no reportedCostUsd: a call priced by its provider plus one priced by a rate is not one bill, and costUsd would price the whole sum at the one figure. Accumulate cost in a UsageTracker, which prices each call as it arrives.

Parameter Type
a TokenUsage
b TokenUsage

TokenUsage