.NET API
ToolCallUsage
Tracon.Abstractions.dllA 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()
Remarks
Section titled “Remarks”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.
Constructors
Section titled “Constructors”ToolCallUsage()
Section titled “ ToolCallUsage()”public ToolCallUsage()Properties
Section titled “Properties”The computed amount. Stays null if the configuration has no price for this tool — not zero.
public decimal? Cost { get; init; }Property Value
Section titled “Property Value”Currency
Section titled “ Currency”The currency of Cost. Comes from Tracon:Pricing:Currency
for Tracon’s own tools.
public string? Currency { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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).
IsEstimated
Section titled “ IsEstimated”Whether the quantity was measured or estimated.
public bool IsEstimated { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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; }Property Value
Section titled “Property Value”Provider
Section titled “ Provider”The provider that did the work (for example elevenlabs), or
null when the reporter does not name one.
public string? Provider { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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.
Quantity
Section titled “ Quantity”The billed quantity.
public required decimal Quantity { get; init; }Property Value
Section titled “Property Value”The measurement unit. See ToolUsageUnits for known values.
public required string Unit { get; init; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(ToolCallUsage?)
Section titled “ Equals(ToolCallUsage?)”public bool Equals(ToolCallUsage? other)Parameters
Section titled “Parameters”other ToolCallUsage?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(ToolCallUsage?, ToolCallUsage?)
Section titled “ operator ==(ToolCallUsage?, ToolCallUsage?)”public static bool operator ==(ToolCallUsage? left, ToolCallUsage? right)Parameters
Section titled “Parameters”left ToolCallUsage?
right ToolCallUsage?
Returns
Section titled “Returns”operator !=(ToolCallUsage?, ToolCallUsage?)
Section titled “ operator !=(ToolCallUsage?, ToolCallUsage?)”public static bool operator !=(ToolCallUsage? left, ToolCallUsage? right)Parameters
Section titled “Parameters”left ToolCallUsage?
right ToolCallUsage?