Class BetaResponseUsage
-
- All Implemented Interfaces:
public final class BetaResponseUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBetaResponseUsage.BuilderA builder for BetaResponseUsage.
public final classBetaResponseUsage.InputTokensDetailsA detailed breakdown of the input tokens.
public final classBetaResponseUsage.OutputTokensDetailsA detailed breakdown of the output tokens.
-
Method Summary
Modifier and Type Method Description final LonginputTokens()The number of input tokens. final BetaResponseUsage.InputTokensDetailsinputTokensDetails()A detailed breakdown of the input tokens. final LongoutputTokens()The number of output tokens. final BetaResponseUsage.OutputTokensDetailsoutputTokensDetails()A detailed breakdown of the output tokens. final LongtotalTokens()The total number of tokens used. final JsonField<Long>_inputTokens()Returns the raw JSON value of inputTokens. final JsonField<BetaResponseUsage.InputTokensDetails>_inputTokensDetails()Returns the raw JSON value of inputTokensDetails. final JsonField<Long>_outputTokens()Returns the raw JSON value of outputTokens. final JsonField<BetaResponseUsage.OutputTokensDetails>_outputTokensDetails()Returns the raw JSON value of outputTokensDetails. final JsonField<Long>_totalTokens()Returns the raw JSON value of totalTokens. final Map<String, JsonValue>_additionalProperties()final BetaResponseUsage.BuildertoBuilder()final BetaResponseUsagevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaResponseUsage.Builderbuilder()Returns a mutable builder for constructing an instance of BetaResponseUsage. -
-
Method Detail
-
inputTokens
final Long inputTokens()
The number of input tokens.
-
inputTokensDetails
final BetaResponseUsage.InputTokensDetails inputTokensDetails()
A detailed breakdown of the input tokens.
-
outputTokens
final Long outputTokens()
The number of output tokens.
-
outputTokensDetails
final BetaResponseUsage.OutputTokensDetails outputTokensDetails()
A detailed breakdown of the output tokens.
-
totalTokens
final Long totalTokens()
The total number of tokens used.
-
_inputTokens
final JsonField<Long> _inputTokens()
Returns the raw JSON value of inputTokens.
Unlike inputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_inputTokensDetails
final JsonField<BetaResponseUsage.InputTokensDetails> _inputTokensDetails()
Returns the raw JSON value of inputTokensDetails.
Unlike inputTokensDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_outputTokens
final JsonField<Long> _outputTokens()
Returns the raw JSON value of outputTokens.
Unlike outputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_outputTokensDetails
final JsonField<BetaResponseUsage.OutputTokensDetails> _outputTokensDetails()
Returns the raw JSON value of outputTokensDetails.
Unlike outputTokensDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_totalTokens
final JsonField<Long> _totalTokens()
Returns the raw JSON value of totalTokens.
Unlike totalTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final BetaResponseUsage.Builder toBuilder()
-
validate
final BetaResponseUsage validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static BetaResponseUsage.Builder builder()
Returns a mutable builder for constructing an instance of BetaResponseUsage.
The following fields are required:
.inputTokens() .inputTokensDetails() .outputTokens() .outputTokensDetails() .totalTokens()
-
-
-
-