分析
Models
type BetaAnalyticsArtifactActivity struct { ArtifactType; ArtifactsCreatedCount; DistinctUserCount; /* 6 more */ }Artifact-creation activity for one (artifact_type, is_shared) bucket
on a given day.
Artifact-creation activity for one (artifact_type, is_shared) bucket
on a given day.
Artifacts form a small finite cube — the canonical MIME type (8 values incl.
other) crossed with shared-vs-private — so the response is the full set of
non-empty buckets, not a ranked/paginated list. Claude Code and Cowork
artifacts report under text/html and are counted from 2026-08-17
onward; earlier days contain claude.ai chat artifacts only. With
group_by[]=product / user_id / rbac_group_id each row is further
split by the flat group keys and counts are scoped to that cut.
type BetaAnalyticsChatCoworkUnifiedChatMetrics struct { ConnectorsUsedCount; DistinctArtifactsCreatedCount; DistinctConnectorsUsedCount; /* 9 more */ }Chat activity recorded while members had Chat and Cowork unified turned
on.
Chat activity recorded while members had Chat and Cowork unified turned on.
type BetaAnalyticsChatCoworkUnifiedSessionsMetrics struct { ActionCount; ArtifactsCreatedCount; ConnectorsUsedCount; /* 14 more */ }Cowork session activity recorded while members had Chat and Cowork
unified turned on.
Cowork session activity recorded while members had Chat and Cowork unified turned on.
type BetaAnalyticsChatMetrics struct { ConnectorsUsedCount; DistinctArtifactsCreatedCount; DistinctConnectorsUsedCount; /* 9 more */ }Claude.ai activity metrics for a single user on a given day.
Claude.ai activity metrics for a single user on a given day.
type BetaAnalyticsClaudeCodeMetrics struct { CoreMetrics; ToolActions }Claude Code activity metrics for a single user on a given day.
Claude Code activity metrics for a single user on a given day.
type BetaAnalyticsClaudeTagCategory string
type BetaAnalyticsConnectorActivity struct { ChatMetrics; ClaudeCodeMetrics; ConnectorName; /* 14 more */ }Per-connector activity data for a given day.
Per-connector activity data for a given day.
type BetaAnalyticsConnectorChatCoworkUnifiedChatMetrics struct { DistinctConversationConnectorUsedCount }A connector's use in chat conversations recorded while members had
Chat and Cowork unified turned on.
A connector's use in chat conversations recorded while members had Chat and Cowork unified turned on.
Same measure as chat_metrics.distinct_conversation_connector_used_count, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsConnectorChatCoworkUnifiedSessionsMetrics struct { DistinctSessionConnectorUsedCount }A connector's use in Cowork sessions recorded while members had
Chat and Cowork unified turned on.
A connector's use in Cowork sessions recorded while members had Chat and Cowork unified turned on.
Same measure as cowork_metrics.distinct_session_connector_used_count, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsConnectorChatMetrics struct { DistinctConversationConnectorUsedCount }Claude.ai activity metrics for a single connector on a given day.
Claude.ai activity metrics for a single connector on a given day.
Number of distinct conversations in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsConnectorClaudeCodeMetrics struct { DistinctSessionConnectorUsedCount }Claude Code activity metrics for a single connector on a given day.
Claude Code activity metrics for a single connector on a given day.
Number of distinct Claude Code sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsConnectorCoworkMetrics struct { DistinctSessionConnectorUsedCount }Cowork activity metrics for a single connector on a given day.
Cowork activity metrics for a single connector on a given day.
Number of distinct Cowork sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsConnectorOfficeMetrics struct { Excel; Outlook; Powerpoint; Word }Office Agent activity metrics for a single connector on a given day, broken out by Office product.
Office Agent activity metrics for a single connector on a given day, broken out by Office product.
Office Agent activity metrics for a single connector on a given day within one Office product.
Office Agent activity metrics for a single connector on a given day within one Office product.
Number of distinct Office Agent sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
Office Agent activity metrics for a single connector on a given day within one Office product.
Office Agent activity metrics for a single connector on a given day within one Office product.
Number of distinct Office Agent sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
Powerpoint BetaAnalyticsConnectorOfficeProductMetricsOffice Agent activity metrics for a single connector on a given day within one Office product.
Office Agent activity metrics for a single connector on a given day within one Office product.
Number of distinct Office Agent sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
Office Agent activity metrics for a single connector on a given day within one Office product.
Office Agent activity metrics for a single connector on a given day within one Office product.
Number of distinct Office Agent sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsConnectorOfficeProductMetrics struct { DistinctSessionConnectorUsedCount }Office Agent activity metrics for a single connector on a given day within one Office product.
Office Agent activity metrics for a single connector on a given day within one Office product.
Number of distinct Office Agent sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsContextWindow string
type BetaAnalyticsCoreCodeMetrics struct { ArtifactsCreatedCount; CommitCount; DistinctSessionCount; /* 2 more */ }Core Claude Code activity metrics for a single user on a given day.
Core Claude Code activity metrics for a single user on a given day.
Number of artifacts created in Claude Code sessions: an artifact counts once, on the day a session first saves it. Counted from 2026-08-17; 0 on earlier days. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.
Number of commits made via Claude Code
Number of distinct Claude Code sessions. On aggregated rows and in date-range mode: summed per-day distinct counts. A session essentially never spans a UTC day, so the sum is in practice the true distinct count.
LinesOfCode BetaAnalyticsLinesOfCodeLines of code added and removed via Claude Code.
Lines of code added and removed via Claude Code.
Lines of code added
Lines of code removed
Number of pull requests created via Claude Code
type BetaAnalyticsCostBucketedResult struct { Amount; ClaudeTagCategory; ClaudeTagUserID; /* 12 more */ }
type BetaAnalyticsCostReportTimeBucket struct { EndingAt; Results; StartingAt }
type BetaAnalyticsCostType string
type BetaAnalyticsCostUsersItem struct { Actor; Amount; ClaudeTagCategory; /* 15 more */ }
type BetaAnalyticsCoworkMetrics struct { ActionCount; ArtifactsCreatedCount; ConnectorsUsedCount; /* 14 more */ }Cowork activity metrics for a single user on a given day.
Cowork activity metrics for a single user on a given day.
type BetaAnalyticsDesignMetrics struct { DistinctProjectsCreatedCount; DistinctProjectsUsedCount; DistinctSessionCount; MessageCount }Claude Design activity metrics for a single user on a given day.
Claude Design activity metrics for a single user on a given day.
Number of distinct Claude Design projects created. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.
Number of distinct Claude Design projects the user worked in. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
Number of distinct Claude Design sessions. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
Number of messages sent in Claude Design sessions
type BetaAnalyticsInferenceGeoFilter string
type BetaAnalyticsLinesOfCode struct { AddedCount; RemovedCount }Lines of code added and removed via Claude Code.
Lines of code added and removed via Claude Code.
Lines of code added
Lines of code removed
type BetaAnalyticsOfficeMetrics struct { Excel; Outlook; Powerpoint; Word }Office Agent activity metrics for a single user on a given day, broken out by Office product.
Office Agent activity metrics for a single user on a given day, broken out by Office product.
type BetaAnalyticsOfficeProductMetrics struct { ConnectorsUsedCount; DistinctConnectorsUsedCount; DistinctSessionCount; /* 3 more */ }Office Agent activity metrics for a single user on a given day within one Office product.
Office Agent activity metrics for a single user on a given day within one Office product.
Number of MCP connector invocations
Number of distinct MCP connectors used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
Number of distinct Office Agent sessions. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
Number of distinct skills used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
Number of messages sent
Number of skill invocations
type BetaAnalyticsPluginActivity struct { ClaudeCodeMetrics; CoworkMetrics; DistinctUserCount; /* 9 more */ }Per-plugin install + invocation activity for a given day.
Per-plugin install + invocation activity for a given day.
With group_by[]=user_id / rbac_group_id / product (cowork,
claude_code and chat_cowork_unified only on this endpoint) each row is
one (plugin, user), (plugin, group), or (plugin, product) cut: the flat
user_id / rbac_group_id / product keys carry the cut and the counts
are scoped to it.
type BetaAnalyticsPluginClaudeCodeMetrics struct { DistinctSessionPluginUsedCount }Claude Code activity metrics for a single plugin on a given day.
Claude Code activity metrics for a single plugin on a given day.
Number of distinct Claude Code sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsPluginCoworkMetrics struct { DistinctSessionPluginUsedCount }Cowork activity metrics for a single plugin on a given day.
Cowork activity metrics for a single plugin on a given day.
Number of distinct Cowork sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsProductFilter stringPublicly documented product surfaces. 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 on deployments that offer Chat and Cowork unified.
Publicly documented product surfaces. 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 on deployments that offer Chat and Cowork unified.
type BetaAnalyticsProjectActivity struct { DistinctUserCount; MessageCount; ProjectID; /* 8 more */ }Per-project activity data for a given day.
Per-project activity data for a given day.
type BetaAnalyticsScienceMetrics struct { DelegationCount; DistinctSessionCount; MessageCount; /* 2 more */ }Claude Science activity metrics for a single user on a given day.
Claude Science activity metrics for a single user on a given day.
Number of delegations (handoffs to a specialized agent) in Claude Science sessions
Number of distinct Claude Science sessions. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
Number of messages sent in Claude Science sessions
Number of remote compute jobs launched from Claude Science sessions
Total number of skill invocations in Claude Science sessions
type BetaAnalyticsServerToolUse struct { WebSearchRequests }
The number of web search requests made.
type BetaAnalyticsSingleDayActivitySummary struct { AssignedSeatCount; CoworkDailyActiveUserCount; CoworkMonthlyActiveUserCount; /* 29 more */ }Per-day entry in the /summaries response.
Per-day entry in the /summaries response.
type BetaAnalyticsSkillActivity struct { ChatMetrics; ClaudeCodeMetrics; CoworkMetrics; /* 15 more */ }Per-skill activity data for a given day.
Per-skill activity data for a given day.
type BetaAnalyticsSkillChatCoworkUnifiedChatMetrics struct { DistinctConversationSkillUsedCount }A skill's use in chat conversations recorded while members had
Chat and Cowork unified turned on.
A skill's use in chat conversations recorded while members had Chat and Cowork unified turned on.
Same measure as chat_metrics.distinct_conversation_skill_used_count, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsSkillChatCoworkUnifiedSessionsMetrics struct { DistinctSessionSkillUsedCount }A skill's use in Cowork sessions recorded while members had Chat
and Cowork unified turned on.
A skill's use in Cowork sessions recorded while members had Chat and Cowork unified turned on.
Same measure as cowork_metrics.distinct_session_skill_used_count, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsSkillChatMetrics struct { DistinctConversationSkillUsedCount }Claude.ai activity metrics for a single skill on a given day.
Claude.ai activity metrics for a single skill on a given day.
Number of distinct conversations in which the skill was used. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsSkillClaudeCodeMetrics struct { DistinctSessionSkillUsedCount }Claude Code activity metrics for a single skill on a given day.
Claude Code activity metrics for a single skill on a given day.
Number of distinct Claude Code sessions in which the skill was used. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsSkillCoworkMetrics struct { DistinctSessionSkillUsedCount }Cowork activity metrics for a single skill on a given day.
Cowork activity metrics for a single skill on a given day.
Number of distinct Cowork sessions in which the skill was used. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsSkillOfficeMetrics struct { Excel; Outlook; Powerpoint; Word }Office Agent activity metrics for a single skill on a given day, broken out by Office product.
Office Agent activity metrics for a single skill on a given day, broken out by Office product.
type BetaAnalyticsSkillOfficeProductMetrics struct { DistinctSessionSkillUsedCount }Office Agent activity metrics for a single skill on a given day within one Office product.
Office Agent activity metrics for a single skill on a given day within one Office product.
Number of distinct Office Agent sessions in which the skill was used. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
type BetaAnalyticsTokenType string
type BetaAnalyticsToolActionCounts struct { AcceptedCount; RejectedCount }Accepted/rejected counts for a single Claude Code tool type.
Accepted/rejected counts for a single Claude Code tool type.
Number of tool proposals accepted
Number of tool proposals rejected
type BetaAnalyticsToolActions struct { EditTool; MultiEditTool; NotebookEditTool; WriteTool }Per-tool accepted/rejected counts for Claude Code file modification tools.
Per-tool accepted/rejected counts for Claude Code file modification tools.
type BetaAnalyticsUsageBucketedResult struct { CacheCreation; CacheReadInputTokens; ClaudeTagCategory; /* 12 more */ }
type BetaAnalyticsUsageReportTimeBucket struct { EndingAt; Results; StartingAt }
type BetaAnalyticsUsageUsersItem struct { Actor; CacheCreation; CacheReadInputTokens; /* 16 more */ }
type BetaAnalyticsUser struct { Type: "user"; ID; EmailAddress }A user in the organization, identified by tagged id and email address.
A user in the organization, identified by tagged id and email address.
Type UserObject type. Always user.
Object type. Always user.
Tagged user identifier (e.g. user_...)
Email address of the user
type BetaAnalyticsUserActivity struct { ChatMetrics; ClaudeCodeMetrics; CoworkMetrics; /* 10 more */ }Per-user activity data for a given day.
Per-user activity data for a given day.
type BetaAnalyticsUserActor struct { Type: "user_actor"; Deleted; EmailAddress; /* 2 more */ }
Actor type. Always "user_actor".
True when the account has been deleted, or when the user is no longer a member of the organization or its associated organizations (for example, their membership was removed or they were deprovisioned via your identity provider). email_address stays populated for removed users and is null when the account has been deleted. name follows the rules described on that field. The user_id is still populated for reconciliation.
The user's email address, including for users who are no longer members of the organization or its associated organizations. Null when the account has been deleted (check deleted) and for system-minted service accounts, which have no person's mailbox behind them (check name).
The user's full name. Null when the user has not set a name. Returns "Deleted User" when the account itself has been deleted, or when the user is no longer a member of the organization or its associated organizations and the organization has chosen to hide the names of removed users. Otherwise, the name stays populated for removed users. Rows for system-minted service accounts render the service name (for example, "Claude Security" for usage by Anthropic's security-patching service) or null.
Tagged user ID.
分析摘要
获取活动摘要
client.Beta.Organization.Analytics.Summaries.List(ctx, query) (*PageCursor[BetaAnalyticsSingleDayActivitySummary], error)获取某个日期范围内的组织级活动摘要。
分析用户
列出用户活动
client.Beta.Organization.Analytics.Users.List(ctx, query) (*PageCursor[BetaAnalyticsUserActivity], error)获取给定日期的每用户活动,支持基于游标的分页。
分析应用聊天项目
获取聊天项目用量
client.Beta.Organization.Analytics.Apps.Chat.Projects.List(ctx, query) (*PageCursor[BetaAnalyticsProjectActivity], error)获取指定日期的每项目活动,支持基于游标的分页。
分析连接器
获取连接器使用情况
client.Beta.Organization.Analytics.Connectors.List(ctx, query) (*PageCursor[BetaAnalyticsConnectorActivity], error)获取给定日期的每连接器使用情况,支持基于游标的分页。
分析插件
获取插件使用情况
client.Beta.Organization.Analytics.Plugins.List(ctx, query) (*PageCursor[BetaAnalyticsPluginActivity], error)获取给定日期的每插件安装 + 调用使用情况,支持分页。
分析技能
获取技能使用情况
client.Beta.Organization.Analytics.Skills.List(ctx, query) (*PageCursor[BetaAnalyticsSkillActivity], error)获取给定日期的每技能使用情况,支持基于游标的分页。
分析Artifacts
获取 Artifact 活动
client.Beta.Organization.Analytics.Artifacts.List(ctx, query) (*PageCursor[BetaAnalyticsArtifactActivity], error)获取给定日期的 Artifact 创建活动,按 MIME 类型细分。
分析使用情况报告
获取随时间变化的令牌用量
client.Beta.Organization.Analytics.UsageReport.List(ctx, query) (*PageCursor[BetaAnalyticsUsageReportTimeBucket], error)获取某个日期范围内随时间变化的令牌用量。
分析用户用量报告
获取每用户令牌用量
client.Beta.Organization.Analytics.UserUsageReport.List(ctx, query) (*PageCursor[BetaAnalyticsUsageUsersItem], error)获取某个日期范围内的每用户令牌用量。
分析成本报告
获取随时间变化的成本
client.Beta.Organization.Analytics.CostReport.List(ctx, query) (*PageCursor[BetaAnalyticsCostReportTimeBucket], error)获取某个日期范围内随时间变化的成本(以美元计)。
分析用户成本报告
获取每用户成本
client.Beta.Organization.Analytics.UserCostReport.List(ctx, query) (*PageCursor[BetaAnalyticsCostUsersItem], error)获取某个日期范围内的每用户成本(以美元计)。