UsageMetadata

public final class UsageMetadata


Usage metadata about response(s).

Summary

Public fields

final @NonNull List<@NonNull ModalityTokenCount>
final int
final Integer

Number of tokens in the response(s).

final @NonNull List<@NonNull ModalityTokenCount>

The breakdown, by modality, of how many tokens are consumed by the candidates.

final int

Number of tokens in the request.

final @NonNull List<@NonNull ModalityTokenCount>

The breakdown, by modality, of how many tokens are consumed by the prompt.

final int

The number of tokens used by the model's internal "thinking" process.

final int

The number of tokens used by tools.

final @NonNull List<@NonNull ModalityTokenCount>

The breakdown, by modality, of how many tokens are consumed by tools.

final int

Total number of tokens.

Public fields

cacheTokensDetails

public final @NonNull List<@NonNull ModalityTokenCount> cacheTokensDetails

cachedContentTokenCount

public final int cachedContentTokenCount

candidatesTokenCount

public final Integer candidatesTokenCount

Number of tokens in the response(s).

candidatesTokensDetails

public final @NonNull List<@NonNull ModalityTokenCount> candidatesTokensDetails

The breakdown, by modality, of how many tokens are consumed by the candidates.

promptTokenCount

public final int promptTokenCount

Number of tokens in the request.

promptTokensDetails

public final @NonNull List<@NonNull ModalityTokenCount> promptTokensDetails

The breakdown, by modality, of how many tokens are consumed by the prompt.

thoughtsTokenCount

public final int thoughtsTokenCount

The number of tokens used by the model's internal "thinking" process.

toolUsePromptTokenCount

public final int toolUsePromptTokenCount

The number of tokens used by tools.

toolUsePromptTokensDetails

public final @NonNull List<@NonNull ModalityTokenCount> toolUsePromptTokensDetails

The breakdown, by modality, of how many tokens are consumed by tools.

totalTokenCount

public final int totalTokenCount

Total number of tokens.