Skip to content
Tracon

RunNonTokenCost

Namespace Tracon · Assembly Tracon.Abstractions.dll

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

public sealed record RunNonTokenCost : IEquatable<RunNonTokenCost>
Inheritance
object ← RunNonTokenCost
Implements
IEquatable<RunNonTokenCost>
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

A run’s token cost (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). The reported amounts of one currency add up here, in a total of their own. It is not a term of RunCost.Total (a token total and a reported amount are different measurements, and RunCost stays a price snapshot of one model’s tokens). A caller that needs “what did this run spend” adds the two with 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) and do not change it. A run that reported nothing holds null, not zero.

public RunNonTokenCost()

Gets the sum of the reported amounts that were added, or null when no reported item carried an amount in Currency.

public decimal? Amount { get; init; }

decimal?

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.

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

public string? Currency { get; init; }

string?

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

public int CurrencyCount { get; init; }

int

A tree total (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, and each run keeps its own total. Currencies are compared without regard to letter case.

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

public bool IsEstimated { get; init; }

bool

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.

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

public int UnsummedItemCount { get; init; }

int

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

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(RunNonTokenCost? other)

other RunNonTokenCost?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(RunNonTokenCost?, RunNonTokenCost?)

Section titled “ operator ==(RunNonTokenCost?, RunNonTokenCost?)”
public static bool operator ==(RunNonTokenCost? left, RunNonTokenCost? right)

left RunNonTokenCost?

right RunNonTokenCost?

bool

operator !=(RunNonTokenCost?, RunNonTokenCost?)

Section titled “ operator !=(RunNonTokenCost?, RunNonTokenCost?)”
public static bool operator !=(RunNonTokenCost? left, RunNonTokenCost? right)

left RunNonTokenCost?

right RunNonTokenCost?

bool