Class: Anthropic::Resources::Beta::Organization::Analytics::UserUsageReport
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Organization::Analytics::UserUsageReport
- Defined in:
- lib/anthropic/resources/beta/organization/analytics/user_usage_report.rb,
sig/anthropic/resources/beta/organization/analytics/user_usage_report.rbs
Instance Method Summary collapse
-
#initialize(client:) ⇒ UserUsageReport
constructor
private
A new instance of UserUsageReport.
-
#list(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: {}) ⇒ Anthropic::Internal::ReportPageCursor<Anthropic::Models::Beta::Organization::BetaAnalyticsUsageUsersItem>
[Legacy] Get per-user token usage across a date range.
Constructor Details
#initialize(client:) ⇒ UserUsageReport
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of UserUsageReport.
118 119 120 |
# File 'lib/anthropic/resources/beta/organization/analytics/user_usage_report.rb', line 118 def initialize(client:) @client = client end |
Instance Method Details
#list(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: {}) ⇒ Anthropic::Internal::ReportPageCursor<Anthropic::Models::Beta::Organization::BetaAnalyticsUsageUsersItem>
[Legacy] Get per-user token usage across a date range.
Returns usage per user, ranked by the chosen token metric; group_by[] or
bucket_width splits a user across several rows. Use this to see which users
consume the most tokens. Only usage attributed to a user account is included, so
usage with no user account, such as Code Review usage and Claude Tag usage in
Slack channels, is left out. Claude Tag one-to-one direct messages are included,
with product claude-tag, only for members who have connected a Claude account.
To see all usage by product, call GET /v1/organizations/analytics/usage_report
with group_by[]=product. Available to organizations on a Claude Enterprise
plan. Requires an API key with the read:analytics scope.
This endpoint is one of the legacy Claude Enterprise usage and cost reports. For
new integrations, use
GET /v1/organizations/analytics/usage
in the Usage and Cost Analytics API instead. To move an existing integration,
see
Migrate from the Claude Enterprise usage and cost reports.
Some parameter documentations has been truncated, see Models::Beta::Organization::Analytics::UserUsageReportListParams for more details.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/anthropic/resources/beta/organization/analytics/user_usage_report.rb', line 77 def list(params) parsed, = Anthropic::Beta::Organization::Analytics::UserUsageReportListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_ANALYTICS_USER_USAGE_REPORT_LIST, span_route: "/v1/organizations/analytics/user_usage_report", span_query: %w[ bucket_width claude_tag_categories claude_tag_user_ids context_windows ending_at exclude_deleted_users group_by inference_geos limit models order order_by page products rbac_group_ids slack_channel_ids speeds starting_at user_ids ], method: :get, path: "v1/organizations/analytics/user_usage_report", query: query, page: Anthropic::Internal::ReportPageCursor, model: Anthropic::Beta::Organization::BetaAnalyticsUsageUsersItem, options: ) end |