Class BetaAnalyticsCostBucketedResult.Builder
-
- All Implemented Interfaces:
public final class BetaAnalyticsCostBucketedResult.BuilderA builder for BetaAnalyticsCostBucketedResult.
-
-
Method Summary
-
-
Method Detail
-
amount
final BetaAnalyticsCostBucketedResult.Builder amount(String amount)
Amount (post-discount, pre-credit) in fractional cents.
-
amount
final BetaAnalyticsCostBucketedResult.Builder amount(JsonField<String> amount)
Sets Builder.amount to an arbitrary JSON value.
You should usually call Builder.amount with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
claudeTagCategory
final BetaAnalyticsCostBucketedResult.Builder claudeTagCategory(BetaAnalyticsClaudeTagCategory claudeTagCategory)
Claude Tag (Claude in Slack) spend category:
engaged(a person addressed Claude in a channel or thread),proactive(Claude responded without being addressed),scheduled(a scheduled routine ran),monitoring(Claude watching a channel it was asked to monitor), ordm(direct messages with Claude). Populated only whenclaude_tag_categoryis ingroup_by[]; null for usage that is not Claude Tag. New categories may be added over time.
-
claudeTagCategory
final BetaAnalyticsCostBucketedResult.Builder claudeTagCategory(Optional<BetaAnalyticsClaudeTagCategory> claudeTagCategory)
Alias for calling Builder.claudeTagCategory with
claudeTagCategory.orElse(null).
-
claudeTagCategory
final BetaAnalyticsCostBucketedResult.Builder claudeTagCategory(JsonField<BetaAnalyticsClaudeTagCategory> claudeTagCategory)
Sets Builder.claudeTagCategory to an arbitrary JSON value.
You should usually call Builder.claudeTagCategory with a well-typed BetaAnalyticsClaudeTagCategory value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
claudeTagUserId
final BetaAnalyticsCostBucketedResult.Builder claudeTagUserId(String claudeTagUserId)
Slack user ID (for example
U0123ABCDEF) of the member the Claude Tag (Claude in Slack) usage is attributed to, not a claude.ai user ID. Populated only whenclaude_tag_user_idis ingroup_by[]; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for examplemonitoring, andproactiveusage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined withgroup_by[]=rbac_group_idor therbac_group_ids[]filter.
-
claudeTagUserId
final BetaAnalyticsCostBucketedResult.Builder claudeTagUserId(Optional<String> claudeTagUserId)
Alias for calling Builder.claudeTagUserId with
claudeTagUserId.orElse(null).
-
claudeTagUserId
final BetaAnalyticsCostBucketedResult.Builder claudeTagUserId(JsonField<String> claudeTagUserId)
Sets Builder.claudeTagUserId to an arbitrary JSON value.
You should usually call Builder.claudeTagUserId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
contextWindow
final BetaAnalyticsCostBucketedResult.Builder contextWindow(BetaAnalyticsContextWindow contextWindow)
Context-window pricing tier of the usage or cost. Null unless
context_windowis ingroup_by[]; it can also be null on grouped rows with no context-window tier, such as code execution.
-
contextWindow
final BetaAnalyticsCostBucketedResult.Builder contextWindow(Optional<BetaAnalyticsContextWindow> contextWindow)
Alias for calling Builder.contextWindow with
contextWindow.orElse(null).
-
contextWindow
final BetaAnalyticsCostBucketedResult.Builder contextWindow(JsonField<BetaAnalyticsContextWindow> contextWindow)
Sets Builder.contextWindow to an arbitrary JSON value.
You should usually call Builder.contextWindow with a well-typed BetaAnalyticsContextWindow value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
costType
final BetaAnalyticsCostBucketedResult.Builder costType(BetaAnalyticsCostType costType)
Cost component when
group_by[]=cost_type; null otherwise (amount is the combined total).
-
costType
final BetaAnalyticsCostBucketedResult.Builder costType(Optional<BetaAnalyticsCostType> costType)
Alias for calling Builder.costType with
costType.orElse(null).
-
costType
final BetaAnalyticsCostBucketedResult.Builder costType(JsonField<BetaAnalyticsCostType> costType)
Sets Builder.costType to an arbitrary JSON value.
You should usually call Builder.costType with a well-typed BetaAnalyticsCostType value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
currency
final BetaAnalyticsCostBucketedResult.Builder currency(String currency)
Currency code for the cost amount. Currently always
"USD".
-
currency
final BetaAnalyticsCostBucketedResult.Builder currency(JsonField<String> currency)
Sets Builder.currency to an arbitrary JSON value.
You should usually call Builder.currency with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
inferenceGeo
final BetaAnalyticsCostBucketedResult.Builder inferenceGeo(BetaAnalyticsCostBucketedResult.InferenceGeo inferenceGeo)
Inference region of the usage or cost. Null unless
inference_geois ingroup_by[]; it can also be null on grouped rows where the region is not set (the rows thatinference_geos[]=not_availablematches).
-
inferenceGeo
final BetaAnalyticsCostBucketedResult.Builder inferenceGeo(Optional<BetaAnalyticsCostBucketedResult.InferenceGeo> inferenceGeo)
Alias for calling Builder.inferenceGeo with
inferenceGeo.orElse(null).
-
inferenceGeo
final BetaAnalyticsCostBucketedResult.Builder inferenceGeo(JsonField<BetaAnalyticsCostBucketedResult.InferenceGeo> inferenceGeo)
Sets Builder.inferenceGeo to an arbitrary JSON value.
You should usually call Builder.inferenceGeo with a well-typed InferenceGeo value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
listAmount
final BetaAnalyticsCostBucketedResult.Builder listAmount(String listAmount)
List-price amount (pre-discount) in fractional cents.
-
listAmount
final BetaAnalyticsCostBucketedResult.Builder listAmount(JsonField<String> listAmount)
Sets Builder.listAmount to an arbitrary JSON value.
You should usually call Builder.listAmount with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final BetaAnalyticsCostBucketedResult.Builder model(String model)
Model that produced the usage or cost, as a model name in the form the
models[]filter accepts (for example,claude-opus-5-5). Null unlessmodelis ingroup_by[]; it can also be null on grouped rows whose usage or cost is not attributed to a specific model, such as code execution.
-
model
final BetaAnalyticsCostBucketedResult.Builder model(Optional<String> model)
Alias for calling Builder.model with
model.orElse(null).
-
model
final BetaAnalyticsCostBucketedResult.Builder model(JsonField<String> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
product
final BetaAnalyticsCostBucketedResult.Builder product(String product)
Product surface that produced the usage or cost. Null unless product is in
group_by[]; it can also be null on grouped rows whose usage cannot be attributed to a known surface. Values includechat,claude_code,cowork,office_agent,claude_in_chrome,claude_design,claude-tag, andchat_cowork_unified.claude-tagis Claude Tag, the Claude product in Slack.chat_cowork_unifiedis Chat and Cowork unified, Cowork's features inside claude.ai chat: chat and Cowork usage by a member who has it turned on is reported under this value instead ofchatorcowork. It is accepted as a filter only where Chat and Cowork unified is available. Some unattributed usage is reported as "other".
-
product
final BetaAnalyticsCostBucketedResult.Builder product(Optional<String> product)
Alias for calling Builder.product with
product.orElse(null).
-
product
final BetaAnalyticsCostBucketedResult.Builder product(JsonField<String> product)
Sets Builder.product to an arbitrary JSON value.
You should usually call Builder.product with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
rbacGroupId
final BetaAnalyticsCostBucketedResult.Builder rbacGroupId(String rbacGroupId)
RBAC group (team) the usage is attributed to, in the public tagged
rbac_group_...spelling — the same spelling the activity resources use for this key, so the same team has one id across resources and it round-trips as anrbac_group_ids[]filter value. Populated only whenrbac_group_idis ingroup_by[]. Any-membership semantics: a user in several groups contributes their full usage to each of those groups' rows, so the named-group rows overlap and their sum can exceed the org total. A null value is the single unassigned row: users in no group on that (UTC) day. For the true org total, run the same query withoutgroup_by[].
-
rbacGroupId
final BetaAnalyticsCostBucketedResult.Builder rbacGroupId(Optional<String> rbacGroupId)
Alias for calling Builder.rbacGroupId with
rbacGroupId.orElse(null).
-
rbacGroupId
final BetaAnalyticsCostBucketedResult.Builder rbacGroupId(JsonField<String> rbacGroupId)
Sets Builder.rbacGroupId to an arbitrary JSON value.
You should usually call Builder.rbacGroupId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
requests
final BetaAnalyticsCostBucketedResult.Builder requests(Long requests)
Number of API requests in this row's scope. Null when
group_byincludescost_typeortoken_type(the count has no per-component attribution; read it from the ungrouped response). For sandbox / code-execution events, this counts execution spans rather than HTTP requests (these rows surface withproduct: null).
-
requests
final BetaAnalyticsCostBucketedResult.Builder requests(Long requests)
Alias for Builder.requests.
This unboxed primitive overload exists for backwards compatibility.
-
requests
final BetaAnalyticsCostBucketedResult.Builder requests(Optional<Long> requests)
Alias for calling Builder.requests with
requests.orElse(null).
-
requests
final BetaAnalyticsCostBucketedResult.Builder requests(JsonField<Long> requests)
Sets Builder.requests to an arbitrary JSON value.
You should usually call Builder.requests with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
slackChannelId
final BetaAnalyticsCostBucketedResult.Builder slackChannelId(String slackChannelId)
Slack channel the usage originated from. Populated only when
slack_channel_idis ingroup_by[]; null for usage outside Slack, for some Claude Tag usage that has no channel recorded, and for usage recorded before channel attribution was enabled.
-
slackChannelId
final BetaAnalyticsCostBucketedResult.Builder slackChannelId(Optional<String> slackChannelId)
Alias for calling Builder.slackChannelId with
slackChannelId.orElse(null).
-
slackChannelId
final BetaAnalyticsCostBucketedResult.Builder slackChannelId(JsonField<String> slackChannelId)
Sets Builder.slackChannelId to an arbitrary JSON value.
You should usually call Builder.slackChannelId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
speed
final BetaAnalyticsCostBucketedResult.Builder speed(BetaAnalyticsCostBucketedResult.Speed speed)
Inference speed mode of the usage or cost:
fastorstandard. Null unlessspeedis ingroup_by[].
-
speed
final BetaAnalyticsCostBucketedResult.Builder speed(Optional<BetaAnalyticsCostBucketedResult.Speed> speed)
Alias for calling Builder.speed with
speed.orElse(null).
-
speed
final BetaAnalyticsCostBucketedResult.Builder speed(JsonField<BetaAnalyticsCostBucketedResult.Speed> speed)
Sets Builder.speed to an arbitrary JSON value.
You should usually call Builder.speed with a well-typed Speed value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
tokenType
final BetaAnalyticsCostBucketedResult.Builder tokenType(BetaAnalyticsTokenType tokenType)
Token type when
group_by[]=token_typeandcost_type=tokens; null otherwise.
-
tokenType
final BetaAnalyticsCostBucketedResult.Builder tokenType(Optional<BetaAnalyticsTokenType> tokenType)
Alias for calling Builder.tokenType with
tokenType.orElse(null).
-
tokenType
final BetaAnalyticsCostBucketedResult.Builder tokenType(JsonField<BetaAnalyticsTokenType> tokenType)
Sets Builder.tokenType to an arbitrary JSON value.
You should usually call Builder.tokenType with a well-typed BetaAnalyticsTokenType value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final BetaAnalyticsCostBucketedResult.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final BetaAnalyticsCostBucketedResult.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final BetaAnalyticsCostBucketedResult.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final BetaAnalyticsCostBucketedResult.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final BetaAnalyticsCostBucketedResult.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final BetaAnalyticsCostBucketedResult build()
Returns an immutable instance of BetaAnalyticsCostBucketedResult.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.amount() .claudeTagCategory() .claudeTagUserId() .contextWindow() .costType() .currency() .inferenceGeo() .listAmount() .model() .product() .rbacGroupId() .requests() .slackChannelId() .speed() .tokenType()
-
-
-
-