ToolCallUsage
AgentPrism.Abstractions.dllA single tool call’s non-token measurement and cost.
public sealed record ToolCallUsage : IEquatable<ToolCallUsage>Inheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”The cost model assumes tokens and writes to the runs table. A tool may spend
no tokens but still incur a charge: text-to-speech is billed by character,
speech-to-text by second. These measurements are not
summed with token cost — two different units cannot be added. They are
shown as a separate line item in reports.
The measurement is reported by the tool itself:
AgentPrismToolUsage.Report(...).
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. Comes from AgentPrism:Pricing:Currency.
public string? Currency { get; init; }Property Value
Section titled “Property Value”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; the UI distinguishes the two cases.
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?