Class: Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb,
sig/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rbs

Defined Under Namespace

Modules: InferenceGeo, Speed

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(amount:, claude_tag_category:, claude_tag_user_id:, context_window:, cost_type:, currency:, inference_geo:, list_amount:, model:, product:, rbac_group_id:, requests:, slack_channel_id:, speed:, token_type:) ⇒ BetaAnalyticsCostBucketedResult

Some parameter documentations has been truncated, see Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult for more details.

Parameters:

  • amount (String) —

    Amount (post-discount, pre-credit) in fractional cents.

  • claude_tag_category (Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagCategory, nil) —

    Claude Tag (Claude in Slack) spend category: engaged (a person addressed Claud

  • claude_tag_user_id (String, nil) —

    Slack user ID (for example U0123ABCDEF) of the member the Claude Tag (Claude i

  • context_window (Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsContextWindow, nil) —

    Context-window pricing tier of the usage or cost. Null unless context_window i

  • cost_type (Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsCostType, nil) —

    Cost component when group_by[]=cost_type; null otherwise (amount is the combin

  • currency (String) —

    Currency code for the cost amount. Currently always "USD".

  • inference_geo (Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::InferenceGeo, nil) —

    Inference region of the usage or cost. Null unless inference_geo is in

  • list_amount (String) —

    List-price amount (pre-discount) in fractional cents.

  • model (String, nil) —

    Model that produced the usage or cost, as a model name in the form the

  • product (String, nil) —

    Product surface that produced the usage or cost. Null unless product is in

  • rbac_group_id (String, nil) —

    RBAC group (team) the usage is attributed to, in the public tagged

  • requests (Integer, nil) —

    Number of API requests in this row's scope. Null when group_by includes

  • slack_channel_id (String, nil) —

    Slack channel the usage originated from. Populated only when slack_channel_id

  • speed (Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::Speed, nil) —

    Inference speed mode of the usage or cost: fast or standard. Null unless

  • token_type (Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsTokenType, nil) —

    Token type when group_by[]=token_type and cost_type=tokens; null otherwise.

  • amount: (String)
  • claude_tag_category: (Anthropic::Models::Beta::Organization::beta_analytics_claude_tag_category, nil)
  • claude_tag_user_id: (String, nil)
  • context_window: (Anthropic::Models::Beta::Organization::beta_analytics_context_window, nil)
  • cost_type: (Anthropic::Models::Beta::Organization::beta_analytics_cost_type, nil)
  • currency: (String)
  • inference_geo: (Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::inference_geo, nil)
  • list_amount: (String)
  • model: (String, nil)
  • product: (String, nil)
  • rbac_group_id: (String, nil)
  • requests: (Integer, nil)
  • slack_channel_id: (String, nil)
  • speed: (Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::speed, nil)
  • token_type: (Anthropic::Models::Beta::Organization::beta_analytics_token_type, nil)


# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 151


Instance Attribute Details

#amount ⇒ String

Amount (post-discount, pre-credit) in fractional cents.

Parameters:

  • value (String)

Returns:

  • (String)


12
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 12

required :amount, String

#claude_tag_category ⇒ Symbol, ...

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), or dm (direct messages with Claude). Populated only when claude_tag_category is in group_by[]; null for usage that is not Claude Tag. New categories may be added over time.

Parameters:

  • value (Anthropic::Models::Beta::Organization::beta_analytics_claude_tag_category, nil)

Returns:



23
24
25
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 23

required :claude_tag_category,
enum: -> { Anthropic::Beta::Organization::BetaAnalyticsClaudeTagCategory },
nil?: true

#claude_tag_user_id ⇒ String?

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 when claude_tag_user_id is in group_by[]; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for example monitoring, and proactive usage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined with group_by[]=rbac_group_id or the rbac_group_ids[] filter.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


37
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 37

required :claude_tag_user_id, String, nil?: true

#context_window ⇒ Symbol, ...

Context-window pricing tier of the usage or cost. Null unless context_window is in group_by[]; it can also be null on grouped rows with no context-window tier, such as code execution.

Parameters:

  • value (Anthropic::Models::Beta::Organization::beta_analytics_context_window, nil)

Returns:



45
46
47
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 45

required :context_window,
enum: -> { Anthropic::Beta::Organization::BetaAnalyticsContextWindow },
nil?: true

#cost_type ⇒ Symbol, ...

Cost component when group_by[]=cost_type; null otherwise (amount is the combined total).

Parameters:

  • value (Anthropic::Models::Beta::Organization::beta_analytics_cost_type, nil)

Returns:



54
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 54

required :cost_type, enum: -> { Anthropic::Beta::Organization::BetaAnalyticsCostType }, nil?: true

#currency ⇒ String

Currency code for the cost amount. Currently always "USD".

Parameters:

  • value (String)

Returns:

  • (String)


60
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 60

required :currency, String

#inference_geo ⇒ Symbol, ...

Inference region of the usage or cost. Null unless inference_geo is in group_by[]; it can also be null on grouped rows where the region is not set (the rows that inference_geos[]=not_available matches).

Parameters:

  • value (Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::inference_geo, nil)

Returns:



68
69
70
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 68

required :inference_geo,
enum: -> { Anthropic::Beta::Organization::BetaAnalyticsCostBucketedResult::InferenceGeo },
nil?: true

#list_amount ⇒ String

List-price amount (pre-discount) in fractional cents.

Parameters:

  • value (String)

Returns:

  • (String)


76
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 76

required :list_amount, String

#model ⇒ String?

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 unless model is in group_by[]; it can also be null on grouped rows whose usage or cost is not attributed to a specific model, such as code execution.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


85
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 85

required :model, String, nil?: true

#product ⇒ String?

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 include chat, claude_code, cowork, office_agent, claude_in_chrome, claude_design, claude-tag, and chat_cowork_unified. claude-tag is Claude Tag, the Claude product in Slack. chat_cowork_unified is 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 of chat or cowork. It is accepted as a filter only where Chat and Cowork unified is available. cc_security_autopatch is work that Claude Security runs for the organization. Some unattributed usage is reported as "other".

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


101
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 101

required :product, String, nil?: true

#rbac_group_id ⇒ String?

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 an rbac_group_ids[] filter value. Populated only when rbac_group_id is in group_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 without group_by[].

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


115
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 115

required :rbac_group_id, String, nil?: true

#requests ⇒ Integer?

Number of API requests in this row's scope. Null when group_by includes cost_type or token_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 with product: null).

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


125
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 125

required :requests, Integer, nil?: true

#slack_channel_id ⇒ String?

Slack channel the usage originated from. Populated only when slack_channel_id is in group_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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


134
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 134

required :slack_channel_id, String, nil?: true

#speed ⇒ Symbol, ...

Inference speed mode of the usage or cost: fast or standard. Null unless speed is in group_by[].

Parameters:

  • value (Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::speed, nil)

Returns:



141
142
143
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 141

required :speed,
enum: -> { Anthropic::Beta::Organization::BetaAnalyticsCostBucketedResult::Speed },
nil?: true

#token_type ⇒ Symbol, ...

Token type when group_by[]=token_type and cost_type=tokens; null otherwise.

Parameters:

  • value (Anthropic::Models::Beta::Organization::beta_analytics_token_type, nil)

Returns:



149
# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 149

required :token_type, enum: -> { Anthropic::Beta::Organization::BetaAnalyticsTokenType }, nil?: true

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb', line 197


Instance Method Details

#to_hash ⇒ { amount: String, claude_tag_category: Anthropic::Models::Beta::Organization::beta_analytics_claude_tag_category?, claude_tag_user_id: String?, context_window: Anthropic::Models::Beta::Organization::beta_analytics_context_window?, cost_type: Anthropic::Models::Beta::Organization::beta_analytics_cost_type?, currency: String, inference_geo: Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::inference_geo?, list_amount: String, model: String?, product: String?, rbac_group_id: String?, requests: Integer?, slack_channel_id: String?, speed: Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::speed?, token_type: Anthropic::Models::Beta::Organization::beta_analytics_token_type? }

Returns:

  • ({ amount: String, claude_tag_category: Anthropic::Models::Beta::Organization::beta_analytics_claude_tag_category?, claude_tag_user_id: String?, context_window: Anthropic::Models::Beta::Organization::beta_analytics_context_window?, cost_type: Anthropic::Models::Beta::Organization::beta_analytics_cost_type?, currency: String, inference_geo: Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::inference_geo?, list_amount: String, model: String?, product: String?, rbac_group_id: String?, requests: Integer?, slack_channel_id: String?, speed: Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::speed?, token_type: Anthropic::Models::Beta::Organization::beta_analytics_token_type? })


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'sig/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rbs', line 73

def to_hash: -> {
  amount: String,
  claude_tag_category: Anthropic::Models::Beta::Organization::beta_analytics_claude_tag_category?,
  claude_tag_user_id: String?,
  context_window: Anthropic::Models::Beta::Organization::beta_analytics_context_window?,
  cost_type: Anthropic::Models::Beta::Organization::beta_analytics_cost_type?,
  currency: String,
  inference_geo: Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::inference_geo?,
  list_amount: String,
  model: String?,
  product: String?,
  rbac_group_id: String?,
  requests: Integer?,
  slack_channel_id: String?,
  speed: Anthropic::Models::Beta::Organization::BetaAnalyticsCostBucketedResult::speed?,
  token_type: Anthropic::Models::Beta::Organization::beta_analytics_token_type?
}