Class BatchUsage
-
- All Implemented Interfaces:
public final class BatchUsageRepresents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. Only populated on batches created after September 7, 2025.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBatchUsage.BuilderA builder for BatchUsage.
public final classBatchUsage.InputTokensDetailsA detailed breakdown of the input tokens.
public final classBatchUsage.OutputTokensDetailsA detailed breakdown of the output tokens.
-
Method Summary
Modifier and Type Method Description final LonginputTokens()The number of input tokens. final BatchUsage.InputTokensDetailsinputTokensDetails()A detailed breakdown of the input tokens. final LongoutputTokens()The number of output tokens. final BatchUsage.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<BatchUsage.InputTokensDetails>_inputTokensDetails()Returns the raw JSON value of inputTokensDetails. final JsonField<Long>_outputTokens()Returns the raw JSON value of outputTokens. final JsonField<BatchUsage.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 BatchUsage.BuildertoBuilder()final BatchUsagevalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BatchUsage.Builderbuilder()Returns a mutable builder for constructing an instance of BatchUsage. -
-
Method Detail
-
inputTokens
final Long inputTokens()
The number of input tokens.
-
inputTokensDetails
final BatchUsage.InputTokensDetails inputTokensDetails()
A detailed breakdown of the input tokens.
-
outputTokens
final Long outputTokens()
The number of output tokens.
-
outputTokensDetails
final BatchUsage.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<BatchUsage.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<BatchUsage.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 BatchUsage.Builder toBuilder()
-
validate
final BatchUsage validate()
-
builder
final static BatchUsage.Builder builder()
Returns a mutable builder for constructing an instance of BatchUsage.
The following fields are required:
.inputTokens() .inputTokensDetails() .outputTokens() .outputTokensDetails() .totalTokens()
-
-
-
-