Class Usage
-
- All Implemented Interfaces:
public final class Usage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classUsage.BuilderA builder for Usage.
public final classUsage.ServiceTierIf the request used the priority, standard, or batch tier.
-
Method Summary
Modifier and Type Method Description final Optional<CacheCreation>cacheCreation()Breakdown of cached tokens by TTL final Optional<Long>cacheCreationInputTokens()The number of input tokens used to create the cache entry. final Optional<Long>cacheReadInputTokens()The number of input tokens read from the cache. final Optional<String>inferenceGeo()The geographic region where inference was performed for this request. final LonginputTokens()The number of input tokens which were used. final LongoutputTokens()The number of output tokens which were used. final Optional<OutputTokensDetails>outputTokensDetails()Breakdown of output tokens by category. final Optional<ServerToolUsage>serverToolUse()The number of server tool requests. final Optional<Usage.ServiceTier>serviceTier()If the request used the priority, standard, or batch tier. final JsonField<CacheCreation>_cacheCreation()Returns the raw JSON value of cacheCreation. final JsonField<Long>_cacheCreationInputTokens()Returns the raw JSON value of cacheCreationInputTokens. final JsonField<Long>_cacheReadInputTokens()Returns the raw JSON value of cacheReadInputTokens. final JsonField<String>_inferenceGeo()Returns the raw JSON value of inferenceGeo. final JsonField<Long>_inputTokens()Returns the raw JSON value of inputTokens. final JsonField<Long>_outputTokens()Returns the raw JSON value of outputTokens. final JsonField<OutputTokensDetails>_outputTokensDetails()Returns the raw JSON value of outputTokensDetails. final JsonField<ServerToolUsage>_serverToolUse()Returns the raw JSON value of serverToolUse. final JsonField<Usage.ServiceTier>_serviceTier()Returns the raw JSON value of serviceTier. final Map<String, JsonValue>_additionalProperties()final Usage.BuildertoBuilder()final Usagevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Usage.Builderbuilder()Returns a mutable builder for constructing an instance of Usage. -
-
Method Detail
-
cacheCreation
final Optional<CacheCreation> cacheCreation()
Breakdown of cached tokens by TTL
-
cacheCreationInputTokens
final Optional<Long> cacheCreationInputTokens()
The number of input tokens used to create the cache entry.
-
cacheReadInputTokens
final Optional<Long> cacheReadInputTokens()
The number of input tokens read from the cache.
-
inferenceGeo
final Optional<String> inferenceGeo()
The geographic region where inference was performed for this request.
-
inputTokens
final Long inputTokens()
The number of input tokens which were used.
-
outputTokens
final Long outputTokens()
The number of output tokens which were used.
-
outputTokensDetails
final Optional<OutputTokensDetails> outputTokensDetails()
Breakdown of output tokens by category.
output_tokensremains the inclusive, authoritative total used for billing. This object provides a read-only decomposition for observability — for example, how many of the billed output tokens were spent on internal reasoning that may have been summarized before being returned to you.
-
serverToolUse
final Optional<ServerToolUsage> serverToolUse()
The number of server tool requests.
-
serviceTier
final Optional<Usage.ServiceTier> serviceTier()
If the request used the priority, standard, or batch tier.
-
_cacheCreation
final JsonField<CacheCreation> _cacheCreation()
Returns the raw JSON value of cacheCreation.
Unlike cacheCreation, this method doesn't throw if the JSON field has an unexpected type.
-
_cacheCreationInputTokens
final JsonField<Long> _cacheCreationInputTokens()
Returns the raw JSON value of cacheCreationInputTokens.
Unlike cacheCreationInputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_cacheReadInputTokens
final JsonField<Long> _cacheReadInputTokens()
Returns the raw JSON value of cacheReadInputTokens.
Unlike cacheReadInputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_inferenceGeo
final JsonField<String> _inferenceGeo()
Returns the raw JSON value of inferenceGeo.
Unlike inferenceGeo, this method doesn't throw if the JSON field has an unexpected type.
-
_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.
-
_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<OutputTokensDetails> _outputTokensDetails()
Returns the raw JSON value of outputTokensDetails.
Unlike outputTokensDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_serverToolUse
final JsonField<ServerToolUsage> _serverToolUse()
Returns the raw JSON value of serverToolUse.
Unlike serverToolUse, this method doesn't throw if the JSON field has an unexpected type.
-
_serviceTier
final JsonField<Usage.ServiceTier> _serviceTier()
Returns the raw JSON value of serviceTier.
Unlike serviceTier, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Usage.Builder toBuilder()
-
validate
final Usage 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 Usage.Builder builder()
Returns a mutable builder for constructing an instance of Usage.
The following fields are required:
.cacheCreation() .cacheCreationInputTokens() .cacheReadInputTokens() .inferenceGeo() .inputTokens() .outputTokens() .outputTokensDetails() .serverToolUse() .serviceTier()
-
-
-
-