Usage

public final class Usage

Statistics on the interaction request's token usage.

Types

Link copied to clipboard
public final class Builder

A builder for Usage.

Link copied to clipboard
public final class CachedTokensByModality

The token count for a single response modality.

Link copied to clipboard
public final class GroundingToolCount

The number of grounding tool counts.

Link copied to clipboard
public final class InputTokensByModality

The token count for a single response modality.

Link copied to clipboard
public final class OutputTokensByModality

The token count for a single response modality.

Link copied to clipboard
public final class ToolUseTokensByModality

The token count for a single response modality.

Functions

Link copied to clipboard
public final Map<String, JsonValue> _additionalProperties()
Link copied to clipboard

Returns the raw JSON value of cachedTokensByModality.

Link copied to clipboard

Returns the raw JSON value of groundingToolCount.

Link copied to clipboard

Returns the raw JSON value of inputTokensByModality.

Link copied to clipboard

Returns the raw JSON value of outputTokensByModality.

Link copied to clipboard

Returns the raw JSON value of toolUseTokensByModality.

Link copied to clipboard
public final JsonField<Integer> _totalCachedTokens()

Returns the raw JSON value of totalCachedTokens.

Link copied to clipboard
public final JsonField<Integer> _totalInputTokens()

Returns the raw JSON value of totalInputTokens.

Link copied to clipboard
public final JsonField<Integer> _totalOutputTokens()

Returns the raw JSON value of totalOutputTokens.

Link copied to clipboard
public final JsonField<Integer> _totalThoughtTokens()

Returns the raw JSON value of totalThoughtTokens.

Link copied to clipboard
public final JsonField<Integer> _totalTokens()

Returns the raw JSON value of totalTokens.

Link copied to clipboard
public final JsonField<Integer> _totalToolUseTokens()

Returns the raw JSON value of totalToolUseTokens.

Link copied to clipboard
public final static Usage.Builder builder()

Returns a mutable builder for constructing an instance of Usage.

Link copied to clipboard

A breakdown of cached token usage by modality.

Link copied to clipboard
public Boolean equals(Object other)
Link copied to clipboard

Grounding tool count.

Link copied to clipboard
public Integer hashCode()
Link copied to clipboard

A breakdown of input token usage by modality.

Link copied to clipboard
public final Boolean isValid()
Link copied to clipboard

A breakdown of output token usage by modality.

Link copied to clipboard
public final Usage.Builder toBuilder()
Link copied to clipboard

A breakdown of tool-use token usage by modality.

Link copied to clipboard
public String toString()
Link copied to clipboard

Number of tokens in the cached part of the prompt (the cached content).

Link copied to clipboard

Number of tokens in the prompt (context).

Link copied to clipboard

Total number of tokens across all the generated responses.

Link copied to clipboard

Number of tokens of thoughts for thinking models.

Link copied to clipboard
public final Optional<Integer> totalTokens()

Total token count for the interaction request (prompt + responses + other internal tokens).

Link copied to clipboard

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

Link copied to clipboard
public final Usage validate()