# IRunPricingResolver

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.irunpricingresolver/
> Summary: IRunPricingResolver: Computes the cost from a model+usage pair. Pricing order: the model catalog, then the Tracon:Pricing configuration.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

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

```csharp
public interface IRunPricingResolver
```

## Remarks

**Tenant behavior — TENANT-INDEPENDENT.** [IRunPricingResolver.Resolve](/api/tracon.irunpricingresolver/#Tracon_IRunPricingResolver_Resolve_System_String_System_String_Tracon_RunUsage_)
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.

## Methods

### <a id="Tracon_IRunPricingResolver_Resolve_System_String_System_String_Tracon_RunUsage_"></a> Resolve\(string?, string?, RunUsage?\)

Resolves the cost.

```csharp
RunCost? Resolve(string? provider, string? model, RunUsage? usage)
```

#### Parameters

`provider` [string](https://learn.microsoft.com/dotnet/api/system.string)?

The provider name. If [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) (example: recomputing a
historical row), the price is resolved by model name alone, using the
first match across providers.

`model` [string](https://learn.microsoft.com/dotnet/api/system.string)?

The model name. Cost does not apply if [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or empty.

`usage` [RunUsage](/api/tracon.runusage/)?

The token usage. Cost does not apply if [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

#### Returns

 [RunCost](/api/tracon.runcost/)?

[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/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](/api/tracon.runcost/) is always returned even if pricing is
undefined; in that case [RunCost.Source](/api/tracon.runcost/#Tracon_RunCost_Source) is
[PricingSource.Unknown](/api/tracon.pricingsource/) and the cost fields are
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) — **not zero**.
