Table of Contents

Class InteractionUsage

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

Token usage of an interaction.

public sealed class InteractionUsage
Inheritance
InteractionUsage
Inherited Members
Extension Methods

Properties

CachedTokensByModality

Cached token usage by modality.

[JsonPropertyName("cached_tokens_by_modality")]
public List<InteractionModalityTokens>? CachedTokensByModality { get; set; }

Property Value

List<InteractionModalityTokens>

GroundingToolCount

Grounding tool usage counts.

[JsonPropertyName("grounding_tool_count")]
public List<InteractionGroundingToolCount>? GroundingToolCount { get; set; }

Property Value

List<InteractionGroundingToolCount>

InitialInputTokens

Number of input tokens used in the first turn of this interaction.

[JsonPropertyName("initial_input_tokens")]
public int? InitialInputTokens { get; set; }

Property Value

int?

InputTokensByModality

Input token usage by modality.

[JsonPropertyName("input_tokens_by_modality")]
public List<InteractionModalityTokens>? InputTokensByModality { get; set; }

Property Value

List<InteractionModalityTokens>

OutputTokensByModality

Output token usage by modality.

[JsonPropertyName("output_tokens_by_modality")]
public List<InteractionModalityTokens>? OutputTokensByModality { get; set; }

Property Value

List<InteractionModalityTokens>

ToolUseTokensByModality

Tool-use token usage by modality.

[JsonPropertyName("tool_use_tokens_by_modality")]
public List<InteractionModalityTokens>? ToolUseTokensByModality { get; set; }

Property Value

List<InteractionModalityTokens>

TotalCachedTokens

Number of tokens in the cached part of the prompt.

[JsonPropertyName("total_cached_tokens")]
public int? TotalCachedTokens { get; set; }

Property Value

int?

TotalInputTokens

Number of tokens in the prompt (context).

[JsonPropertyName("total_input_tokens")]
public int? TotalInputTokens { get; set; }

Property Value

int?

TotalOutputTokens

Total number of tokens across all generated responses.

[JsonPropertyName("total_output_tokens")]
public int? TotalOutputTokens { get; set; }

Property Value

int?

TotalThoughtTokens

Number of thought tokens for thinking models.

[JsonPropertyName("total_thought_tokens")]
public int? TotalThoughtTokens { get; set; }

Property Value

int?

TotalTokens

Total token count (prompt + responses + other internal tokens).

[JsonPropertyName("total_tokens")]
public int? TotalTokens { get; set; }

Property Value

int?

TotalToolUseTokens

Number of tokens present in tool-use prompt(s).

[JsonPropertyName("total_tool_use_tokens")]
public int? TotalToolUseTokens { get; set; }

Property Value

int?