Table of Contents

Interface ICostEstimator

Namespace
JD.AI.Core.Usage
Assembly
JD.AI.Core.dll

Estimates token spend for a model/provider pair and exposes the resolved rates.

public interface ICostEstimator

Methods

EstimateTurnCostUsd(ProviderModelInfo, long, long)

Estimate USD cost for a turn from prompt/completion token counts.

decimal EstimateTurnCostUsd(ProviderModelInfo model, long promptTokens, long completionTokens)

Parameters

model ProviderModelInfo
promptTokens long
completionTokens long

Returns

decimal

ResolveRates(ProviderModelInfo)

Resolve effective input/output rates for a model. Returns (inputPerToken, outputPerToken, source).

(decimal InputPerToken, decimal OutputPerToken, string Source) ResolveRates(ProviderModelInfo model)

Parameters

model ProviderModelInfo

Returns

(decimal InputPerToken, decimal OutputPerToken, string Source)