Class Usage
Usage metadata returned by AI service providers after a generation request.
Contains token usage details for billing and monitoring.
Assembly: Glitch9.AIDevKit.dll
Syntax
[Serializable]
[JsonConverter(typeof(UsageJsonConverter))]
public class Usage
Constructors
|
Edit this page
View Source
Usage()
Declaration
|
Edit this page
View Source
Usage(params UsageInfo[])
Declaration
public Usage(params UsageInfo[] usages)
Parameters
Properties
|
Edit this page
View Source
AcceptedPredictionTokens
Number of tokens that matched model predictions and were accepted (prediction mode).
Declaration
public int? AcceptedPredictionTokens { get; set; }
Property Value
|
Edit this page
View Source
Number of tokens derived from audio input (e.g., in transcriptions).
Declaration
public int? AudioInputTokens { get; set; }
Property Value
|
Edit this page
View Source
AudioOutputTokens
Number of tokens used for audio output (e.g., in TTS responses).
Declaration
public int? AudioOutputTokens { get; set; }
Property Value
|
Edit this page
View Source
Number of tokens read from cached input.
Declaration
public int? CachedInputReadTokens { get; set; }
Property Value
|
Edit this page
View Source
Number of tokens written to cached input.
Declaration
public int? CachedInputWriteTokens { get; set; }
Property Value
|
Edit this page
View Source
CitationTokens
Number of tokens used for citations or references in the output.
Declaration
public int? CitationTokens { get; set; }
Property Value
|
Edit this page
View Source
Number of tokens derived from image input (vision)
Declaration
public int? ImageInputTokens { get; set; }
Property Value
|
Edit this page
View Source
ImageOutputTokens
Number of tokens used for Image Generation tool output.
Declaration
public int? ImageOutputTokens { get; set; }
Property Value
|
Edit this page
View Source
Images
Declaration
public int? Images { get; set; }
Property Value
|
Edit this page
View Source
Number of tokens used in the prompt (input sent by the user).
Declaration
public int? InputTokens { get; set; }
Property Value
|
Edit this page
View Source
IsEmpty
Returns true if no usage data is present.
Declaration
public bool IsEmpty { get; }
Property Value
|
Edit this page
View Source
IsFree
Declaration
public bool IsFree { get; }
Property Value
|
Edit this page
View Source
OutputTokens
Number of tokens generated in the response (output by the model).
Declaration
public int? OutputTokens { get; set; }
Property Value
|
Edit this page
View Source
ReasoningTokens
Number of tokens spent on internal reasoning (e.g., CoT steps).
Declaration
public int? ReasoningTokens { get; set; }
Property Value
|
Edit this page
View Source
RejectedPredictionTokens
Number of tokens that were predicted but rejected or unused.
Declaration
public int? RejectedPredictionTokens { get; set; }
Property Value
|
Edit this page
View Source
Number of tokens used for tool call prompts.
Declaration
public int? ToolUseTokens { get; set; }
Property Value
|
Edit this page
View Source
TotalTokens
Total number of tokens used in the request.
This is not calculated internally. It's sent by the API.
Declaration
public int? TotalTokens { get; set; }
Property Value
|
Edit this page
View Source
TrainingTokens
Number of tokens used for fine-tuning or training the model.
Declaration
public int? TrainingTokens { get; set; }
Property Value
|
Edit this page
View Source
WebSearches
Declaration
public int? WebSearches { get; set; }
Property Value
Methods
|
Edit this page
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
Extension Methods