# RunNonTokenCost

> 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.runnontokencost/
> Summary: RunNonTokenCost: What a run spent that is not tokens: the amounts its workflow function nodes and its tools reported, added up in one currency.

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

What a run spent that is not tokens: the amounts its workflow function nodes and
its tools reported, added up in one currency.

```csharp
public sealed record RunNonTokenCost : IEquatable<RunNonTokenCost>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.runnontokencost/">RunNonTokenCost</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;RunNonTokenCost&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

A run's token cost ([RunCost](/api/tracon.runcost/)) is priced by Tracon from the model's
usage. A text-to-speech character, a render second or a GPU hour is not a
token: the code that did the work reports its own amount
([ToolCallUsage.Cost](/api/tracon.toolcallusage/#Tracon_ToolCallUsage_Cost)). The reported amounts of one currency add up
here, in a total of their own. **It is not a term of
[RunCost.Total](/api/tracon.runcost/#Tracon_RunCost_Total)** (a token total and a reported amount are
different measurements, and [RunCost](/api/tracon.runcost/) stays a price snapshot of one
model's tokens). A caller that needs "what did this run spend" adds the two with
[RunSpend](/api/tracon.runspend/) and nothing else.

The value is a snapshot written once when the run closes. Items reported after
that are kept in the run's detail
([IRunStore.ListNonTokenUsageAsync](/api/tracon.irunstore/#Tracon_IRunStore_ListNonTokenUsageAsync_System_Guid_System_Threading_CancellationToken_)) and do not change it. A run
that reported nothing holds [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), not zero.

## Constructors

### <a id="Tracon_RunNonTokenCost__ctor"></a> RunNonTokenCost\(\)

```csharp
public RunNonTokenCost()
```

## Properties

### <a id="Tracon_RunNonTokenCost_Amount"></a> Amount

Gets the sum of the reported amounts that were added, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null)
when no reported item carried an amount in `Currency`.

```csharp
public decimal? Amount { get; init; }
```

#### Property Value

 [decimal](https://learn.microsoft.com/dotnet/api/system.decimal)?

#### Remarks

[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) says "nothing here could be priced", not "it was free":
zero would claim a measurement nobody made. The same rule as the token cost's total.

### <a id="Tracon_RunNonTokenCost_Currency"></a> Currency

Gets the currency of `Amount`, taken from
`Tracon:Pricing:Currency` (an item that names no currency is in it).

```csharp
public string? Currency { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_RunNonTokenCost_CurrencyCount"></a> CurrencyCount

Gets how many currencies the added amounts are in: 0 or 1 for one run, which
adds in one currency.

```csharp
public int CurrencyCount { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

#### Remarks

A tree total ([RunRecord.TreeNonTokenCost](/api/tracon.runrecord/#Tracon_RunRecord_TreeNonTokenCost)) adds the runs' totals, and
the runs can be in different currencies. Amounts in two currencies are never
added: above one, `Amount` and `Currency` are [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), and
each run keeps its own total. Currencies are compared without regard to letter case.

### <a id="Tracon_RunNonTokenCost_IsEstimated"></a> IsEstimated

Gets whether any added amount rests on an estimated quantity
(`ToolCallUsage.IsEstimated`).

```csharp
public bool IsEstimated { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Remarks

An estimated amount is added, and this flag says so: leaving it out would let
a tenant's quota run past its ceiling on a quantity nobody measured.

### <a id="Tracon_RunNonTokenCost_UnsummedItemCount"></a> UnsummedItemCount

Gets how many reported items are not part of `Amount`: items with no
amount, and items in another currency than `Currency`.

```csharp
public int UnsummedItemCount { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

#### Remarks

A quota or budget cannot count such an item. The count is what keeps that gap
visible instead of reading as a smaller bill.

## Methods

### <a id="Tracon_RunNonTokenCost_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_RunNonTokenCost_Equals_Tracon_RunNonTokenCost_"></a> Equals\(RunNonTokenCost?\)

```csharp
public bool Equals(RunNonTokenCost? other)
```

#### Parameters

`other` [RunNonTokenCost](/api/tracon.runnontokencost/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_RunNonTokenCost_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_RunNonTokenCost_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_RunNonTokenCost_op_Equality_Tracon_RunNonTokenCost_Tracon_RunNonTokenCost_"></a> operator ==\(RunNonTokenCost?, RunNonTokenCost?\)

```csharp
public static bool operator ==(RunNonTokenCost? left, RunNonTokenCost? right)
```

#### Parameters

`left` [RunNonTokenCost](/api/tracon.runnontokencost/)?

`right` [RunNonTokenCost](/api/tracon.runnontokencost/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_RunNonTokenCost_op_Inequality_Tracon_RunNonTokenCost_Tracon_RunNonTokenCost_"></a> operator \!=\(RunNonTokenCost?, RunNonTokenCost?\)

```csharp
public static bool operator !=(RunNonTokenCost? left, RunNonTokenCost? right)
```

#### Parameters

`left` [RunNonTokenCost](/api/tracon.runnontokencost/)?

`right` [RunNonTokenCost](/api/tracon.runnontokencost/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
