Function: costOfUsageUSD()
costOfUsageUSD(
providerId,modelId,usage,isEmbedding?):number|undefined
Defined in: packages/agentos/src/api/runtime/spendBudget.ts:331
A finished call's cost: the provider's own costUSD when it reported one, else its tokens at the table's rates
(an embedding prices its prompt tokens alone); undefined when neither is known. A reported cost that is not a finite
number, zero or more, is not used: a budget would record nothing for a cost of NaN.
Parameters
providerId
string
modelId
string
usage
{ completionTokens?: number; costUSD?: number; promptTokens?: number; } | undefined
isEmbedding?
boolean = false
Returns
number | undefined