Skip to content
providerkit
GitHub

addUsage

function addUsage(a, b): TokenUsage;

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

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. Nor contextTokens: two calls’ contexts do not add up to a window.

Parameter Type
a TokenUsage
b TokenUsage

TokenUsage