Claude Platform Docs

分析

Models
class BetaAnalyticsArtifactActivity: artifact_type; artifacts_created_count; distinct_user_count; ... # 6 more

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.

class BetaAnalyticsChatCoworkUnifiedChatMetrics: connectors_used_count; distinct_artifacts_created_count; distinct_connectors_used_count; ... # 9 more

Chat activity recorded while members had Chat and Cowork unified turned on.

class BetaAnalyticsChatCoworkUnifiedSessionsMetrics: action_count; artifacts_created_count; connectors_used_count; ... # 14 more

Cowork session activity recorded while members had Chat and Cowork unified turned on.

class BetaAnalyticsChatMetrics: connectors_used_count; distinct_artifacts_created_count; distinct_connectors_used_count; ... # 9 more

Claude.ai activity metrics for a single user on a given day.

class BetaAnalyticsClaudeCodeMetrics: core_metrics; tool_actions

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.

artifacts_created_count: int

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.

commit_count: int

Number of commits made via Claude Code

distinct_session_count: Optional[int]

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.

lines_of_code: BetaAnalyticsLinesOfCode

Lines of code added and removed via Claude Code.

added_count: int

Lines of code added

removed_count: int

Lines of code removed

pull_request_count: int

Number of pull requests created via Claude Code

tool_actions: BetaAnalyticsToolActions

Per-tool accepted/rejected counts for Claude Code file modification tools.

type BetaAnalyticsClaudeTagCategory = Literal["dm", "engaged", "monitoring", 2 more]
One of the following:
"dm"
"engaged"
"monitoring"
"proactive"
"scheduled"
class BetaAnalyticsConnectorActivity: chat_metrics; claude_code_metrics; connector_name; ... # 14 more

Per-connector activity data for a given day.

class BetaAnalyticsConnectorChatCoworkUnifiedChatMetrics: distinct_conversation_connector_used_count

A connector's use in chat conversations recorded while members had Chat and Cowork unified turned on.

distinct_conversation_connector_used_count: Optional[int]

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.

class BetaAnalyticsConnectorChatCoworkUnifiedSessionsMetrics: distinct_session_connector_used_count

A connector's use in Cowork sessions recorded while members had Chat and Cowork unified turned on.

distinct_session_connector_used_count: Optional[int]

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.

class BetaAnalyticsConnectorChatMetrics: distinct_conversation_connector_used_count

Claude.ai activity metrics for a single connector on a given day.

distinct_conversation_connector_used_count: Optional[int]

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.

class BetaAnalyticsConnectorClaudeCodeMetrics: distinct_session_connector_used_count

Claude Code activity metrics for a single connector on a given day.

distinct_session_connector_used_count: Optional[int]

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.

class BetaAnalyticsConnectorCoworkMetrics: distinct_session_connector_used_count

Cowork activity metrics for a single connector on a given day.

distinct_session_connector_used_count: Optional[int]

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.

class BetaAnalyticsConnectorOfficeMetrics: excel; outlook; powerpoint; word

Office Agent activity metrics for a single connector on a given day, broken out by Office product.

class BetaAnalyticsConnectorOfficeProductMetrics: distinct_session_connector_used_count

Office Agent activity metrics for a single connector on a given day within one Office product.

distinct_session_connector_used_count: Optional[int]

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 = Literal["0-200k", "200k-1M"]
One of the following:
"0-200k"
"200k-1M"
class BetaAnalyticsCoreCodeMetrics: artifacts_created_count; commit_count; distinct_session_count; ... # 2 more

Core Claude Code activity metrics for a single user on a given day.

artifacts_created_count: int

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.

commit_count: int

Number of commits made via Claude Code

distinct_session_count: Optional[int]

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.

lines_of_code: BetaAnalyticsLinesOfCode

Lines of code added and removed via Claude Code.

added_count: int

Lines of code added

removed_count: int

Lines of code removed

pull_request_count: int

Number of pull requests created via Claude Code

class BetaAnalyticsCostBucketedResult: amount; claude_tag_category; claude_tag_user_id; ... # 12 more
class BetaAnalyticsCostReportTimeBucket: ending_at; results; starting_at
type BetaAnalyticsCostType = Literal["code_execution", "tokens", "web_search"]
One of the following:
"code_execution"
"tokens"
"web_search"
class BetaAnalyticsCostUsersItem: actor; amount; claude_tag_category; ... # 15 more
class BetaAnalyticsCoworkMetrics: action_count; artifacts_created_count; connectors_used_count; ... # 14 more

Cowork activity metrics for a single user on a given day.

class BetaAnalyticsDesignMetrics: distinct_projects_created_count; distinct_projects_used_count; distinct_session_count; message_count

Claude Design activity metrics for a single user on a given day.

distinct_projects_created_count: int

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.

distinct_projects_used_count: Optional[int]

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.

distinct_session_count: Optional[int]

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.

message_count: int

Number of messages sent in Claude Design sessions

type BetaAnalyticsInferenceGeoFilter = Literal["global", "not_available", "us"]
One of the following:
"global"
"not_available"
"us"
class BetaAnalyticsLinesOfCode: added_count; removed_count

Lines of code added and removed via Claude Code.

added_count: int

Lines of code added

removed_count: int

Lines of code removed

class BetaAnalyticsOfficeMetrics: excel; outlook; powerpoint; word

Office Agent activity metrics for a single user on a given day, broken out by Office product.

class BetaAnalyticsOfficeProductMetrics: connectors_used_count; distinct_connectors_used_count; distinct_session_count; ... # 3 more

Office Agent activity metrics for a single user on a given day within one Office product.

connectors_used_count: int

Number of MCP connector invocations

distinct_connectors_used_count: Optional[int]

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.

distinct_session_count: Optional[int]

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.

distinct_skills_used_count: Optional[int]

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.

message_count: int

Number of messages sent

skills_used_count: int

Number of skill invocations

class BetaAnalyticsPluginActivity: claude_code_metrics; cowork_metrics; distinct_user_count; ... # 9 more

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.

class BetaAnalyticsPluginClaudeCodeMetrics: distinct_session_plugin_used_count

Claude Code activity metrics for a single plugin on a given day.

distinct_session_plugin_used_count: Optional[int]

Number of distinct Claude Code sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

class BetaAnalyticsPluginCoworkMetrics: distinct_session_plugin_used_count

Cowork activity metrics for a single plugin on a given day.

distinct_session_plugin_used_count: Optional[int]

Number of distinct Cowork sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

type BetaAnalyticsProductFilter = Literal["chat", "chat_cowork_unified", "claude-tag", 5 more]

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.

One of the following:
"chat"
"chat_cowork_unified"
"claude-tag"
"claude_code"
"claude_design"
"claude_in_chrome"
"cowork"
"office_agent"
class BetaAnalyticsProjectActivity: distinct_user_count; message_count; project_id; ... # 8 more

Per-project activity data for a given day.

class BetaAnalyticsScienceMetrics: delegation_count; distinct_session_count; message_count; ... # 2 more

Claude Science activity metrics for a single user on a given day.

delegation_count: int

Number of delegations (handoffs to a specialized agent) in Claude Science sessions

distinct_session_count: Optional[int]

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.

message_count: int

Number of messages sent in Claude Science sessions

remote_compute_job_count: int

Number of remote compute jobs launched from Claude Science sessions

skills_used_count: int

Total number of skill invocations in Claude Science sessions

class BetaAnalyticsServerToolUse: web_search_requests
web_search_requests: int

The number of web search requests made.

class BetaAnalyticsSingleDayActivitySummary: assigned_seat_count; cowork_daily_active_user_count; cowork_monthly_active_user_count; ... # 29 more

Per-day entry in the /summaries response.

class BetaAnalyticsSkillActivity: chat_metrics; claude_code_metrics; cowork_metrics; ... # 15 more

Per-skill activity data for a given day.

class BetaAnalyticsSkillChatCoworkUnifiedChatMetrics: distinct_conversation_skill_used_count

A skill's use in chat conversations recorded while members had Chat and Cowork unified turned on.

distinct_conversation_skill_used_count: Optional[int]

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.

class BetaAnalyticsSkillChatCoworkUnifiedSessionsMetrics: distinct_session_skill_used_count

A skill's use in Cowork sessions recorded while members had Chat and Cowork unified turned on.

distinct_session_skill_used_count: Optional[int]

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.

class BetaAnalyticsSkillChatMetrics: distinct_conversation_skill_used_count

Claude.ai activity metrics for a single skill on a given day.

distinct_conversation_skill_used_count: Optional[int]

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.

class BetaAnalyticsSkillClaudeCodeMetrics: distinct_session_skill_used_count

Claude Code activity metrics for a single skill on a given day.

distinct_session_skill_used_count: Optional[int]

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.

class BetaAnalyticsSkillCoworkMetrics: distinct_session_skill_used_count

Cowork activity metrics for a single skill on a given day.

distinct_session_skill_used_count: Optional[int]

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.

class BetaAnalyticsSkillOfficeMetrics: excel; outlook; powerpoint; word

Office Agent activity metrics for a single skill on a given day, broken out by Office product.

class BetaAnalyticsSkillOfficeProductMetrics: distinct_session_skill_used_count

Office Agent activity metrics for a single skill on a given day within one Office product.

distinct_session_skill_used_count: Optional[int]

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 = Literal["cache_creation.ephemeral_1h_input_tokens", "cache_creation.ephemeral_5m_input_tokens", "cache_read_input_tokens", 2 more]
One of the following:
"cache_creation.ephemeral_1h_input_tokens"
"cache_creation.ephemeral_5m_input_tokens"
"cache_read_input_tokens"
"output_tokens"
"uncached_input_tokens"
class BetaAnalyticsToolActionCounts: accepted_count; rejected_count

Accepted/rejected counts for a single Claude Code tool type.

accepted_count: int

Number of tool proposals accepted

rejected_count: int

Number of tool proposals rejected

class BetaAnalyticsToolActions: edit_tool; multi_edit_tool; notebook_edit_tool; write_tool

Per-tool accepted/rejected counts for Claude Code file modification tools.

class BetaAnalyticsUsageBucketedResult: cache_creation; cache_read_input_tokens; claude_tag_category; ... # 12 more
class BetaAnalyticsUsageReportTimeBucket: ending_at; results; starting_at
class BetaAnalyticsUsageUsersItem: actor; cache_creation; cache_read_input_tokens; ... # 16 more
class BetaAnalyticsUser: type: "user"; id; email_address

A user in the organization, identified by tagged id and email address.

type: Literal["user"]

Object type. Always user.

defaultuser
id: str

Tagged user identifier (e.g. user_...)

email_address: str

Email address of the user

class BetaAnalyticsUserActivity: chat_metrics; claude_code_metrics; cowork_metrics; ... # 10 more

Per-user activity data for a given day.

class BetaAnalyticsUserActor: type: "user_actor"; deleted; email_address; ... # 2 more
type: Literal["user_actor"]

Actor type. Always "user_actor".

deleted: bool

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.

email_address: Optional[str]

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).

name: Optional[str]

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.

user_id: str

Tagged user ID.

分析摘要

取得活動摘要
beta.organization.analytics.summaries.list(**kwargs) -> SyncPageCursor[BetaAnalyticsSingleDayActivitySummary]
GET/v1/organizations/analytics/summaries

取得指定日期範圍內的全組織活動摘要。

分析使用者

列出使用者活動
beta.organization.analytics.users.list(**kwargs) -> SyncPageCursor[BetaAnalyticsUserActivity]
GET/v1/organizations/analytics/users

取得指定日期的每位使用者活動,採用游標式分頁。

分析應用程式聊天專案

取得聊天專案用量
beta.organization.analytics.apps.chat.projects.list(**kwargs) -> SyncPageCursor[BetaAnalyticsProjectActivity]
GET/v1/organizations/analytics/apps/chat/projects

取得指定日期的每個專案活動,並支援以游標為基礎的分頁。

分析連接器

取得連接器使用量
beta.organization.analytics.connectors.list(**kwargs) -> SyncPageCursor[BetaAnalyticsConnectorActivity]
GET/v1/organizations/analytics/connectors

取得指定日期的每個連接器用量,採用游標式分頁。

分析外掛程式

取得外掛程式使用量
beta.organization.analytics.plugins.list(**kwargs) -> SyncPageCursor[BetaAnalyticsPluginActivity]
GET/v1/organizations/analytics/plugins

取得指定日期的每個外掛程式安裝與呼叫用量,採用分頁。

分析技能

取得技能使用量
beta.organization.analytics.skills.list(**kwargs) -> SyncPageCursor[BetaAnalyticsSkillActivity]
GET/v1/organizations/analytics/skills

取得指定日期的每項技能用量,採用游標式分頁。

分析Artifacts

取得 Artifact 活動
beta.organization.analytics.artifacts.list(**kwargs) -> SyncPageCursor[BetaAnalyticsArtifactActivity]
GET/v1/organizations/analytics/artifacts

取得指定日期的 artifact 建立活動,依 MIME 類型細分。

取得隨時間變化的 Token 用量
beta.organization.analytics.usage_report.list(**kwargs) -> SyncPageCursor[BetaAnalyticsUsageReportTimeBucket]
GET/v1/organizations/analytics/usage_report

取得某個日期範圍內隨時間變化的 token 用量。

取得每位使用者的 Token 用量
beta.organization.analytics.user_usage_report.list(**kwargs) -> SyncPageCursor[BetaAnalyticsUsageUsersItem]
GET/v1/organizations/analytics/user_usage_report

取得某個日期範圍內每位使用者的 token 用量。

分析成本報告

取得隨時間變化的成本
beta.organization.analytics.cost_report.list(**kwargs) -> SyncPageCursor[BetaAnalyticsCostReportTimeBucket]
GET/v1/organizations/analytics/cost_report

取得某個日期範圍內隨時間變化的成本(以美元計)。

取得每位使用者的成本
beta.organization.analytics.user_cost_report.list(**kwargs) -> SyncPageCursor[BetaAnalyticsCostUsersItem]
GET/v1/organizations/analytics/user_cost_report

取得某個日期範圍內每位使用者的成本(以美元計)。