Skip to content
Tracon

IRunPricingResolver

Namespace Tracon · Assembly Tracon.Abstractions.dll

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

public interface IRunPricingResolver

Tenant behavior — TENANT-INDEPENDENT. IRunPricingResolver.Resolve is a pure function of provider, model and usage; the pricing catalog and configuration it reads from are global, not per-tenant, so the same price applies regardless of which tenant’s run is being costed.

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.