Skip to content

IRunPricingResolver

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

Computes the cost from a model+usage pair. Pricing order: the model catalog, then the AgentPrism:Pricing configuration.

public interface IRunPricingResolver

Resolves the cost.

RunCost? Resolve(string? provider, string? model, RunUsage? usage)

provider string?

The provider name. If null (example: recomputing a historical row), the price is resolved by model name alone, using the first match across providers.

model string?

The model name. Cost does not apply if null or empty.

usage RunUsage?

The token usage. Cost does not apply if null.

RunCost?

null only if model or usage is missing (a case where cost can never apply — for example, a code agent with no bound model). When the model is known, a RunCost is always returned even if pricing is undefined; in that case RunCost.Source is PricingSource.Unknown and the cost fields are nullnot zero.