Class: Anthropic::Models::Beta::Organization::Analytics::UserCostReportListParams

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_cost_report_list_params.rb,
sig/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rbs

Overview

See Also:

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

Defined Under Namespace

Modules: BucketWidth, GroupBy, Order, OrderBy, Speed

Constant Summary

Constants included from Internal::Type::RequestParameters

Internal::Type::RequestParameters::Anthropic

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: {}) ⇒ void

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

Parameters:



# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 191

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::UserCostReportListParams::bucket_width, nil)

Returns:



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

optional :bucket_width,
enum: -> {
  Anthropic::Beta::Organization::Analytics::UserCostReportListParams::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. dm usage is reported under the user's product rather than claude-tag, so combining this filter with products[]=claude-tag excludes it. 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:



43
44
45
46
47
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 43

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)


56
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 56

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:



63
64
65
66
67
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 63

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)


74
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 74

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:



82
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 82

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

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

Break each actor's row out by the given dimensions. Accepts the same values as the bucketed /cost_report endpoint. The product, model, context_window, inference_geo, and speed dimensions — and the time bucket, when bucket_width is set — count toward limit. cost_type and token_type do not: cost_type returns one row per cost component (tokens, web search, code execution); token_type returns one row per token type, each with cost_type: "tokens"; combining both returns the per-token-type rows plus the web-search and code-execution rows. A page can therefore contain more rows than limit when cost_type or token_type is requested.

Parameters:

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

Returns:



96
97
98
99
100
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 96

optional :group_by,
-> {
  Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::Analytics::UserCostReportListParams::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:



107
108
109
110
111
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 107

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)


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

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)


127
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 127

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

#order ⇒ Symbol, ...

Sort direction. Defaults to desc.



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

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

#order_by ⇒ Symbol, ...

Metric to rank actors by. Defaults to amount.



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

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

#page ⇒ String?

Opaque cursor from a previous response's next_page field.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


146
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 146

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:



152
153
154
155
156
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 152

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)


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

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)


172
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 172

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

#speeds ⇒ Array<Symbol, Anthropic::Models::Beta::Organization::Analytics::UserCostReportListParams::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::UserCostReportListParams::speed], nil)

Returns:



179
180
181
182
183
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 179

optional :speeds,
-> {
  Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::Analytics::UserCostReportListParams::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_cost_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)


189
# File 'lib/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rb', line 189

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_cost_report_list_params.rb', line 249

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


107
# File 'sig/anthropic/models/beta/organization/analytics/user_cost_report_list_params.rbs', line 107

def to_hash: -> {