RunUsage
AgentPrism.Abstractions.dllToken usage of a run.
public sealed record RunUsage : IEquatable<RunUsage>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 breakdown fields are counted inside the three
totals, never beside them — the contract is inherited verbatim from
Microsoft.Extensions.AI.UsageDetails, whose documentation states that
cached input tokens are part of the input token count. Adding
RunUsage.CachedInputTokens to InputTokens therefore
counts the same tokens twice.
A field a provider does not report stays null; it is never written as zero. Zero is the claim “this was measured and it was none”, which is a different statement from “this was not measured”.
Constructors
Section titled “Constructors”RunUsage()
Section titled “ RunUsage()”public RunUsage()Properties
Section titled “Properties”AudioInputTokens
Section titled “ AudioInputTokens”Gets the audio input tokens. Counted INSIDE InputTokens.
public long? AudioInputTokens { get; init; }Property Value
Section titled “Property Value”long?
Remarks
Section titled “Remarks”Recorded for reporting; it carries no separate rate yet.
AudioOutputTokens
Section titled “ AudioOutputTokens”Gets the audio output tokens. Counted INSIDE OutputTokens.
public long? AudioOutputTokens { get; init; }Property Value
Section titled “Property Value”long?
Remarks
Section titled “Remarks”Recorded for reporting; it carries no separate rate yet.
CachedInputTokens
Section titled “ CachedInputTokens”Gets the input tokens that were served from the provider’s prompt
cache. Counted INSIDE InputTokens.
public long? CachedInputTokens { get; init; }Property Value
Section titled “Property Value”long?
Remarks
Section titled “Remarks”null when the provider does not report it. While it is null the whole input is priced at the full input rate, which is what AgentPrism did before this field existed.
InputTokens
Section titled “ InputTokens”Gets the number of input tokens.
public long? InputTokens { get; init; }Property Value
Section titled “Property Value”long?
OutputTokens
Section titled “ OutputTokens”Gets the number of output tokens.
public long? OutputTokens { get; init; }Property Value
Section titled “Property Value”long?
ReasoningTokens
Section titled “ ReasoningTokens”Gets the tokens the model spent on reasoning. Counted INSIDE
OutputTokens.
public long? ReasoningTokens { get; init; }Property Value
Section titled “Property Value”long?
Remarks
Section titled “Remarks”Recorded for reporting. It is priced at the output rate, because providers do not currently bill it separately; a separate rate would be an unmeasured distinction baked into the price schema.
TotalTokens
Section titled “ TotalTokens”Gets the total number of tokens.
public long? TotalTokens { get; init; }Property Value
Section titled “Property Value”long?
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(RunUsage?)
Section titled “ Equals(RunUsage?)”public bool Equals(RunUsage? other)Parameters
Section titled “Parameters”other RunUsage?
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 ==(RunUsage?, RunUsage?)
Section titled “ operator ==(RunUsage?, RunUsage?)”public static bool operator ==(RunUsage? left, RunUsage? right)Parameters
Section titled “Parameters”left RunUsage?
right RunUsage?
Returns
Section titled “Returns”operator !=(RunUsage?, RunUsage?)
Section titled “ operator !=(RunUsage?, RunUsage?)”public static bool operator !=(RunUsage? left, RunUsage? right)Parameters
Section titled “Parameters”left RunUsage?
right RunUsage?