Class UsageMetadata
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
Metadata on the generation request's token usage.
public class UsageMetadata
- Inheritance
-
UsageMetadata
- Inherited Members
- Extension Methods
Properties
CacheTokensDetails
Output only. List of modalities of the cached content in the request input.
[JsonPropertyName("cacheTokensDetails")]
public List<ModalityTokenCount>? CacheTokensDetails { get; set; }
Property Value
CachedContentTokenCount
Number of tokens in the cached part of the prompt (the cached content).
[JsonPropertyName("cachedContentTokenCount")]
public int CachedContentTokenCount { get; set; }
Property Value
CandidatesTokenCount
Total number of tokens across all the generated response candidates.
[JsonPropertyName("candidatesTokenCount")]
public int CandidatesTokenCount { get; set; }
Property Value
CandidatesTokensDetails
Output only. List of modalities that were returned in the response.
[JsonPropertyName("candidatesTokensDetails")]
public List<ModalityTokenCount>? CandidatesTokensDetails { get; set; }
Property Value
PromptTokenCount
Number of tokens in the prompt. When CachedContent is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.
[JsonPropertyName("promptTokenCount")]
public int PromptTokenCount { get; set; }
Property Value
PromptTokensDetails
Output only. List of modalities that were processed in the request input.
[JsonPropertyName("promptTokensDetails")]
public List<ModalityTokenCount>? PromptTokensDetails { get; set; }
Property Value
ResponseTokenCount
Output only. Total number of tokens across all the generated response candidates. This is an alias for CandidatesTokenCount used in newer API versions.
[JsonPropertyName("responseTokenCount")]
public int? ResponseTokenCount { get; set; }
Property Value
- int?
ResponseTokensDetails
Output only. List of modalities that were returned in the response. This is an alias for CandidatesTokensDetails used in newer API versions.
[JsonPropertyName("responseTokensDetails")]
public List<ModalityTokenCount>? ResponseTokensDetails { get; set; }
Property Value
ThoughtsTokenCount
Output only. Number of tokens of thoughts for thinking models.
[JsonPropertyName("thoughtsTokenCount")]
public int ThoughtsTokenCount { get; set; }
Property Value
ToolUsePromptTokenCount
Output only. Number of tokens present in tool-use prompt(s).
[JsonPropertyName("toolUsePromptTokenCount")]
public int ToolUsePromptTokenCount { get; set; }
Property Value
ToolUsePromptTokensDetails
Output only. List of modalities that were processed for tool-use request inputs.
[JsonPropertyName("toolUsePromptTokensDetails")]
public List<ModalityTokenCount>? ToolUsePromptTokensDetails { get; set; }
Property Value
TotalTokenCount
Total token count for the generation request (prompt + response candidates).
[JsonPropertyName("totalTokenCount")]
public int? TotalTokenCount { get; set; }
Property Value
- int?
TrafficType
Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota.
[JsonPropertyName("trafficType")]
public TrafficType? TrafficType { get; set; }