rulvar API reference / @rulvar/anthropic / normalizeAnthropicUsage
Function: normalizeAnthropicUsage()
ts
function normalizeAnthropicUsage(raw): Usage;Defined in: packages/anthropic/src/wire.ts:396
Normalizes Messages API usage under the Usage invariant: Anthropic reports input_tokens EXCLUDING cache reads and writes, so the canonical inputTokens is the sum of all three.
Parameters
| Parameter | Type |
|---|---|
raw | Record<string, unknown> | undefined |