Skip to content
Tracon

ToolCallUsage

Namespace Tracon · Assembly Tracon.Abstractions.dll

A non-token measurement and its cost: one tool call’s, or one item a workflow function node reported.

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

The token cost model writes to the runs table. A tool or a function node may spend no tokens but still incur a charge: text-to-speech is billed by character, speech-to-text by second, a render by the GPU second. The ToolCallUsage.Quantity is never added across units — two different units cannot be added. The ToolCallUsage.Cost is: the amounts of one currency add up into the run’s RunNonTokenCost, which is a total of its own beside the token cost. An item with no ToolCallUsage.Cost, or one in another currency, is listed and counted but not added.

A tool reports its measurement with TraconToolUsage.Report(...); it stays on the call’s ToolInvocationRecord. A workflow function node reports with IWorkflowContext.ReportUsageAsync(...); every report is an item of its own.

public ToolCallUsage()

The computed amount. Stays null if the configuration has no price for this tool — not zero.

public decimal? Cost { get; init; }

decimal?

The currency of Cost. Comes from Tracon:Pricing:Currency for Tracon’s own tools.

public string? Currency { get; init; }

string?

An empty label means Tracon:Pricing:Currency. An amount adds to the run’s total only when its currency is that one; any other currency is listed and counted as not added (RunNonTokenCost.UnsummedItemCount).

Whether the quantity was measured or estimated.

public bool IsEstimated { get; init; }

bool

If the provider does not report the billed quantity, the tool produces an estimate (for example, the text’s character count). Showing an estimate as a measurement fabricates a price, so a reader of the record must keep the two cases apart.

The model that did the work (for example eleven_multilingual_v2), or null when the reporter does not name one.

public string? Model { get; init; }

string?

The provider that did the work (for example elevenlabs), or null when the reporter does not name one.

public string? Provider { get; init; }

string?

A name for the reader of the record only. It takes no part in a total: the same unit at two providers is still one unit.

The billed quantity.

public required decimal Quantity { get; init; }

decimal

The measurement unit. See ToolUsageUnits for known values.

public required string Unit { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(ToolCallUsage? other)

other ToolCallUsage?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(ToolCallUsage?, ToolCallUsage?)

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

left ToolCallUsage?

right ToolCallUsage?

bool

operator !=(ToolCallUsage?, ToolCallUsage?)

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

left ToolCallUsage?

right ToolCallUsage?

bool