rulvar API reference / @rulvar/core / priceUsdOf
Function: priceUsdOf()
ts
function priceUsdOf(pricing, usage): number;Defined in: packages/core/src/model/pricing.ts:39
Dollars from normalized usage against one pricing row (the adapter normalized the usage; inputTokens is the full prompt). Cache writes price at the 5m premium rate; the 1h rate applies where a provider distinguishes it in usage, which the canonical Usage does not yet carry.
Parameters
| Parameter | Type |
|---|---|
pricing | Pricing |
usage | Usage |
Returns
number