Documentation
Functions
calculateCost

Function: calculateCost()

calculateCost(args): number | undefined

Calculate the cost (in cents) for the given model and tokens.

Parameters

ParameterType
argsobject
args.modelstring
args.tokens?object
args.tokens.completion_tokens?number
args.tokens.prompt_tokensnumber

Returns

number | undefined

Source

src/model/utils/calculate-cost.ts:68 (opens in a new tab)