Class: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb,
sig/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rbs

Overview

See Also:

  • Anthropic::Resources::Beta::Organization::Analytics::UserUsageReport#list

Defined Under Namespace

Modules: BucketWidth, GroupBy, Order, OrderBy, Speed

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(starting_at:, bucket_width: nil, claude_tag_categories: nil, claude_tag_user_ids: nil, context_windows: nil, ending_at: nil, exclude_deleted_users: nil, group_by: nil, inference_geos: nil, limit: nil, models: nil, order: nil, order_by: nil, page: nil, products: nil, rbac_group_ids: nil, slack_channel_ids: nil, speeds: nil, user_ids: nil, request_options: {}) ⇒ UserUsageReportListParams

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

Parameters:

  • starting_at (Time) —

    Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days a

  • bucket_width (Symbol, Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::BucketWidth, nil) (defaults to: nil) —

    Time-bucket granularity. When set, each row's starting_at and ending_at are

  • claude_tag_categories (Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagCategory>, nil) (defaults to: nil) —

    Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage

  • claude_tag_user_ids (Array<String>, nil) (defaults to: nil) —

    Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users,

  • context_windows (Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsContextWindow>, nil) (defaults to: nil) —

    Filter to specific context-window pricing tiers. Use group_by[]=context_window

  • ending_at (Time, nil) (defaults to: nil) —

    End of range, exclusive. When omitted, defaults to the earlier of now and

  • exclude_deleted_users (Boolean) (defaults to: nil) —

    If true, omit rows for users who are deleted (deleted: true). A page may conta

  • group_by (Array<Symbol, Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::GroupBy>, nil) (defaults to: nil) —

    Break each actor's row out by the given dimensions. Accepts the same values as t

  • inference_geos (Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsInferenceGeoFilter>, nil) (defaults to: nil) —

    Filter to specific inference regions. not_available matches rows where the reg

  • limit (Integer) (defaults to: nil) —

    Number of rows per page (1-1000, default 20). One row per actor unless

  • models (Array<String>, nil) (defaults to: nil) —

    Models to include. Defaults to all models. Use group_by[]=model to break out p

  • order (Symbol, Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::Order) (defaults to: nil) —

    Sort direction. Defaults to desc.

  • order_by (Symbol, Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::OrderBy) (defaults to: nil) —

    Metric to rank actors by. Defaults to total_tokens.

  • page (String, nil) (defaults to: nil) —

    Opaque cursor from a previous response's next_page field.

  • products (Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsProductFilter>, nil) (defaults to: nil) —

    Product surfaces to include. Defaults to all products.

  • rbac_group_ids (Array<String>, nil) (defaults to: nil) —

    Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group ID

  • slack_channel_ids (Array<String>, nil) (defaults to: nil) —

    Filter to usage originating from specific Slack channels. Use

  • speeds (Array<Symbol, Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::Speed>, nil) (defaults to: nil) —

    Filter to fast or standard inference mode. Use group_by[]=speed to break out p

  • user_ids (Array<String>, nil) (defaults to: nil) —

    Filter to specific users by tagged user ID.

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})
  • starting_at: (Time)
  • bucket_width: (Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::bucket_width, nil) (defaults to: nil)
  • claude_tag_categories: (::Array[Anthropic::Models::Beta::Organization::beta_analytics_claude_tag_category], nil) (defaults to: nil)
  • claude_tag_user_ids: (::Array[String], nil) (defaults to: nil)
  • context_windows: (::Array[Anthropic::Models::Beta::Organization::beta_analytics_context_window], nil) (defaults to: nil)
  • ending_at: (Time, nil) (defaults to: nil)
  • exclude_deleted_users: (Boolean) (defaults to: nil)
  • group_by: (::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::group_by], nil) (defaults to: nil)
  • inference_geos: (::Array[Anthropic::Models::Beta::Organization::beta_analytics_inference_geo_filter], nil) (defaults to: nil)
  • limit: (Integer) (defaults to: nil)
  • models: (::Array[String], nil) (defaults to: nil)
  • order: (Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order) (defaults to: nil)
  • order_by: (Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order_by) (defaults to: nil)
  • page: (String, nil) (defaults to: nil)
  • products: (::Array[Anthropic::Models::Beta::Organization::beta_analytics_product_filter], nil) (defaults to: nil)
  • rbac_group_ids: (::Array[String], nil) (defaults to: nil)
  • slack_channel_ids: (::Array[String], nil) (defaults to: nil)
  • speeds: (::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::speed], nil) (defaults to: nil)
  • user_ids: (::Array[String], nil) (defaults to: nil)
  • request_options: (Anthropic::request_opts) (defaults to: {})


# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 184

Instance Attribute Details

#bucket_width ⇒ Symbol, ...

Time-bucket granularity. When set, each row's starting_at and ending_at are populated and one actor may span several rows (one per time bucket with usage). The time bucket counts toward limit, so one page can return multiple rows for the same actor. ending_at is required when bucket_width is set, and with bucket_width="1m" the range may span at most 24 hours. When omitted, each row aggregates the full [starting_at, ending_at) range.

Parameters:

  • value (Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::bucket_width, nil)

Returns:



29
30
31
32
33
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 29

optional :bucket_width,
enum: -> {
  Anthropic::Beta::Organization::Analytics::UserUsageReportListParams::BucketWidth
},
nil?: true

#claude_tag_categories ⇒ Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagCategory>?

Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage with no category never matches. Use group_by[]=claude_tag_category to break out per-category values.

Parameters:

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

Returns:



41
42
43
44
45
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 41

optional :claude_tag_categories,
-> {
  Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsClaudeTagCategory]
},
nil?: true

#claude_tag_user_ids ⇒ Array<String>?

Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, by Slack user ID (for example U0123ABCDEF), not claude.ai user ID. Usage that is not Claude Tag, and Claude Tag usage not attributed to a single user, never matches. Use group_by[]=claude_tag_user_id to break out per-user values.

Parameters:

  • value (::Array[String], nil)

Returns:

  • (Array<String>, nil)


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

optional :claude_tag_user_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true

#context_windows ⇒ Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsContextWindow>?

Filter to specific context-window pricing tiers. Use group_by[]=context_window to break out per-tier values.

Parameters:

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

Returns:



61
62
63
64
65
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 61

optional :context_windows,
-> {
  Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsContextWindow]
},
nil?: true

#ending_at ⇒ Time?

End of range, exclusive. When omitted, defaults to the earlier of now and starting_at + 31 days. The range may span at most 31 days.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


72
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 72

optional :ending_at, Time, nil?: true

#exclude_deleted_users ⇒ Boolean?

If true, omit rows for users who are deleted (deleted: true). A page may contain fewer than limit rows; use has_more and next_page to paginate as usual.

Parameters:

Returns:



80
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 80

optional :exclude_deleted_users, Anthropic::Internal::Type::Boolean

#group_by ⇒ Array<Symbol, Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::GroupBy>?

Break each actor's row out by the given dimensions. Accepts the same values as the bucketed /usage_report endpoint. limit bounds (actor × time bucket × dimension) rows — with dimensions or bucket_width present, one actor may span several rows.

Parameters:

  • value (::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::group_by], nil)

Returns:



89
90
91
92
93
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 89

optional :group_by,
-> {
  Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::Analytics::UserUsageReportListParams::GroupBy]
},
nil?: true

#inference_geos ⇒ Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsInferenceGeoFilter>?

Filter to specific inference regions. not_available matches rows where the region is unset. Use group_by[]=inference_geo to break out per-region values.

Parameters:

  • value (::Array[Anthropic::Models::Beta::Organization::beta_analytics_inference_geo_filter], nil)

Returns:



100
101
102
103
104
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 100

optional :inference_geos,
-> {
  Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsInferenceGeoFilter]
},
nil?: true

#limit ⇒ Integer?

Number of rows per page (1-1000, default 20). One row per actor unless group_by[] or bucket_width splits an actor across rows; cost_type/token_type fan-out rows (cost endpoint only) are the exception — they do not count toward this limit, so data can exceed it.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


113
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 113

optional :limit, Integer

#models ⇒ Array<String>?

Models to include. Defaults to all models. Use group_by[]=model to break out per-model values.

Parameters:

  • value (::Array[String], nil)

Returns:

  • (Array<String>, nil)


120
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 120

optional :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true

#order ⇒ Symbol, ...

Sort direction. Defaults to desc.

Parameters:

  • (Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order)

Returns:



126
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 126

optional :order, enum: -> { Anthropic::Beta::Organization::Analytics::UserUsageReportListParams::Order }

#order_by ⇒ Symbol, ...

Metric to rank actors by. Defaults to total_tokens.

Parameters:

  • (Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order_by)

Returns:



132
133
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 132

optional :order_by,
enum: -> { Anthropic::Beta::Organization::Analytics::UserUsageReportListParams::OrderBy }

#page ⇒ String?

Opaque cursor from a previous response's next_page field.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


139
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 139

optional :page, String, nil?: true

#products ⇒ Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsProductFilter>?

Product surfaces to include. Defaults to all products.

Parameters:

  • value (::Array[Anthropic::Models::Beta::Organization::beta_analytics_product_filter], nil)

Returns:



145
146
147
148
149
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 145

optional :products,
-> {
  Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsProductFilter]
},
nil?: true

#rbac_group_ids ⇒ Array<String>?

Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (rbac_group_...) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.

Parameters:

  • value (::Array[String], nil)

Returns:

  • (Array<String>, nil)


158
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 158

optional :rbac_group_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true

#slack_channel_ids ⇒ Array<String>?

Filter to usage originating from specific Slack channels. Use group_by[]=slack_channel_id to break out per-channel values.

Parameters:

  • value (::Array[String], nil)

Returns:

  • (Array<String>, nil)


165
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 165

optional :slack_channel_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true

#speeds ⇒ Array<Symbol, Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::Speed>?

Filter to fast or standard inference mode. Use group_by[]=speed to break out per-mode values.

Parameters:

  • value (::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::speed], nil)

Returns:



172
173
174
175
176
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 172

optional :speeds,
-> {
  Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::Analytics::UserUsageReportListParams::Speed]
},
nil?: true

#starting_at ⇒ Time

Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.

Parameters:

  • value (Time)

Returns:

  • (Time)


18
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 18

required :starting_at, Time

#user_ids ⇒ Array<String>?

Filter to specific users by tagged user ID.

Parameters:

  • value (::Array[String], nil)

Returns:

  • (Array<String>, nil)


182
# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 182

optional :user_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rb', line 242

Instance Method Details

#to_hash ⇒ { starting_at: Time, bucket_width: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::bucket_width?, claude_tag_categories: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_claude_tag_category]?, claude_tag_user_ids: ::Array[String]?, context_windows: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_context_window]?, ending_at: Time?, exclude_deleted_users: bool, group_by: ::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::group_by]?, inference_geos: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_inference_geo_filter]?, limit: Integer, models: ::Array[String]?, order: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order, order_by: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order_by, page: String?, products: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_product_filter]?, rbac_group_ids: ::Array[String]?, slack_channel_ids: ::Array[String]?, speeds: ::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::speed]?, user_ids: ::Array[String]?, request_options: Anthropic::RequestOptions }

Returns:

  • ({ starting_at: Time, bucket_width: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::bucket_width?, claude_tag_categories: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_claude_tag_category]?, claude_tag_user_ids: ::Array[String]?, context_windows: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_context_window]?, ending_at: Time?, exclude_deleted_users: bool, group_by: ::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::group_by]?, inference_geos: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_inference_geo_filter]?, limit: Integer, models: ::Array[String]?, order: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order, order_by: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order_by, page: String?, products: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_product_filter]?, rbac_group_ids: ::Array[String]?, slack_channel_ids: ::Array[String]?, speeds: ::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::speed]?, user_ids: ::Array[String]?, request_options: Anthropic::RequestOptions })


107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'sig/anthropic/models/beta/organization/analytics/user_usage_report_list_params.rbs', line 107

def to_hash: -> {
  starting_at: Time,
  bucket_width: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::bucket_width?,
  claude_tag_categories: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_claude_tag_category]?,
  claude_tag_user_ids: ::Array[String]?,
  context_windows: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_context_window]?,
  ending_at: Time?,
  exclude_deleted_users: bool,
  group_by: ::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::group_by]?,
  inference_geos: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_inference_geo_filter]?,
  limit: Integer,
  models: ::Array[String]?,
  order: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order,
  order_by: Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::order_by,
  page: String?,
  products: ::Array[Anthropic::Models::Beta::Organization::beta_analytics_product_filter]?,
  rbac_group_ids: ::Array[String]?,
  slack_channel_ids: ::Array[String]?,
  speeds: ::Array[Anthropic::Models::Beta::Organization::Analytics::UserUsageReportListParams::speed]?,
  user_ids: ::Array[String]?,
  request_options: Anthropic::RequestOptions
}