Skip to content

Commit bd8ebed

Browse files
hollenberryCopilotsophietheking
authored
Document totals_by_client in Copilot usage metrics reference (#64343)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Sophie <29382425+sophietheking@users.noreply.github.com> Copilot-Session: cb13cece-3881-44f0-9dc6-33bef256bf38 Copilot-Session: fca8f742-dcf5-431b-9aa0-24c67b18f7b0 Copilot-Session: 325c6fa3-1aec-4b97-8f9a-145f91cd2d23
1 parent 16b86ec commit bd8ebed

2 files changed

Lines changed: 169 additions & 0 deletions

File tree

‎content/copilot/reference/copilot-usage-metrics/copilot-usage-metrics.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ Per-user reports contain one record per user for the reporting period. The 28-da
139139
| `totals_by_cli` | `object` | Yes | CLI-specific metrics for the user. Omitted when the user had no {% data variables.copilot.copilot_cli_short %} usage that day. See [{% data variables.copilot.copilot_cli_short %} metrics fields](#copilot-cli-metrics-fields). |
140140
| `totals_by_copilot_app` | `object` | Yes | The {% data variables.copilot.github_copilot_app_short %} metrics for the user. Omitted when the user did not use the {% data variables.copilot.github_copilot_app_short %} that day. See [Metrics fields for the {% data variables.copilot.github_copilot_app_short %}](#copilot-app-metrics-fields). |
141141
| `totals_by_3rd_party_agent` | `array` | Yes | Per-agent usage metrics for recognized {% data variables.copilot.agent_apps %}. Omitted when the user had no recognized {% data variables.copilot.agent_app %} activity during the reporting period. See [{% data variables.copilot.agent_apps_caps %} metrics fields](#agent-apps-metrics-fields). |
142+
| `totals_by_client` | `array` | No | Per-client breakdown of the user's successful model requests and token usage, counted server-side. The array is always present and is empty when there is no usage to report. See [Client metrics fields](#client-metrics-fields). |
142143
| `totals_by_vscode_agent` | `object` | Yes | Dedicated {% data variables.product.prodname_vscode_shortname %} Agents-window metrics for the user. Omitted when both required counts are not available. See [{% data variables.product.prodname_vscode_shortname %} Agents-window metrics fields](#vs-code-agents-window-metrics-fields). |
143144
| `totals_by_ide` | `array` | No | Per-IDE breakdown of the user's activity. See [Activity breakdown objects](#activity-breakdown-objects). |
144145
| `totals_by_feature` | `array` | No | Per-feature breakdown of the user's activity. See [Activity breakdown objects](#activity-breakdown-objects). |
@@ -203,6 +204,7 @@ Activity totals and breakdowns:
203204
| `totals_by_cli` | `object` | Yes | Aggregated {% data variables.copilot.copilot_cli_short %} metrics for the day. Omitted when there is no CLI usage that day. Unlike the per-user form, it does not include `last_known_cli_version`. See [{% data variables.copilot.copilot_cli_short %} metrics fields](#copilot-cli-metrics-fields). |
204205
| `totals_by_copilot_app` | `object` | Yes | Aggregated daily metrics for the {% data variables.copilot.github_copilot_app_short %}. Null when the enterprise or organization has no activity in the {% data variables.copilot.github_copilot_app_short %} that day. See [Metrics fields for the {% data variables.copilot.github_copilot_app_short %}](#copilot-app-metrics-fields). |
205206
| `totals_by_3rd_party_agent` | `array` | Yes | Aggregated per-agent usage metrics for recognized {% data variables.copilot.agent_apps %}. Omitted when the enterprise or organization had no recognized {% data variables.copilot.agent_app %} activity that day. See [{% data variables.copilot.agent_apps_caps %} metrics fields](#agent-apps-metrics-fields). |
207+
| `totals_by_client` | `array` | No | Aggregated per-client breakdown of successful model requests and token usage for the day, counted server-side. The array is always present and is empty when there is no usage to report. In 28-day reports, this field appears within each `day_totals` entry. See [Client metrics fields](#client-metrics-fields). |
206208
| `totals_by_vscode_agent` | `object` | Yes | Aggregated dedicated {% data variables.product.prodname_vscode_shortname %} Agents-window metrics for the day. Omitted when both required counts are not available. See [{% data variables.product.prodname_vscode_shortname %} Agents-window metrics fields](#vs-code-agents-window-metrics-fields). |
207209
| `totals_by_ai_adoption_phase` | `array` | Yes | Per-phase aggregates of users and their average activity. Omitted when no adoption-phase data is available. See [AI adoption phase fields](#ai-adoption-phase-fields). |
208210
| `pull_requests` | `object` | No | Daily pull request activity for the enterprise or organization. See [Pull request activity fields](#pull-request-activity-fields). |
@@ -419,6 +421,34 @@ These metrics come from server-side job activity. The nested `user_initiated_int
419421
| `totals_by_3rd_party_agent[].user_initiated_interaction_count` | `integer` | No | Number of user-initiated jobs started for the {% data variables.copilot.agent_app %} during the reporting period. Each job start increments the count once. |
420422
| `totals_by_3rd_party_agent[].session_count` | `integer` | No | Sum of distinct, non-empty session counts for integrations mapped to the agent during the reporting period. Included only in aggregated enterprise and organization reports; omitted from per-user reports. |
421423

424+
### Client metrics fields
425+
426+
The `totals_by_client` array breaks down successful model requests that went through the {% data variables.product.prodname_copilot_short %} API by the client that sent them. These metrics are counted server-side, so they include tools that use {% data variables.product.prodname_copilot_short %} as a model provider even when those tools send no editor telemetry, such as OpenCode. Activity from these tools doesn't appear in `totals_by_ide`, which relies on editor telemetry.
427+
428+
`totals_by_client` is different from `totals_by_3rd_party_agent`. The `totals_by_3rd_party_agent` array counts job starts for recognized {% data variables.copilot.agent_apps %} and doesn't include token or model data.
429+
430+
Clients are identified from the integration ID that each client sends with its requests. Treat `client` as a best-effort grouping, not a verified identity.
431+
432+
Within `totals_by_client`, the `request_count` fields count successful model calls, not prompts. A single prompt can trigger several model calls. Don't compare these request counts with prompt or interaction counts, such as `user_initiated_interaction_count` or `totals_by_cli.prompt_count`.
433+
434+
The `totals_by_client` array appears at the top level of each record in per-user 1-day and 28-day reports and in aggregated 1-day reports. In aggregated 28-day reports, it appears within each `day_totals` entry. The array is always present and is empty when there is no usage to report.
435+
436+
| Field | Type | Nullable | Description |
437+
|:--|:--|:--|:--|
438+
| `totals_by_client[].client` | `string` | No | Normalized client name. Known values include `vscode`, `visualstudio`, `jetbrains`, `eclipse`, `xcode`, `zed`, `copilot_cli`, `github_app`, `copilot_sdk`, `cloud_agent`, `code_review`, `github_web`, `github_mobile`, `github_desktop`, `agentic_workflows`, `claude_code`, `codex`, `opencode`, `slack`, and `azure_devops`. Requests with an unrecognized or missing integration ID are grouped as `other`. Values may be added over time. |
439+
| `totals_by_client[].request_count` | `integer` | No | Number of successful model requests from the client. Counts model calls, not prompts. |
440+
| `totals_by_client[].session_count` | `integer` | No | Number of distinct sessions for the client. In aggregated enterprise and organization reports, sessions are de-duplicated across all users, so this value isn't the sum of per-user counts. Unlike `totals_by_3rd_party_agent[].session_count`, this field is also included in per-user reports. |
441+
| `totals_by_client[].token_usage.prompt_tokens_sum` | `integer` | No | Total number of prompt tokens sent across the client's requests. |
442+
| `totals_by_client[].token_usage.output_tokens_sum` | `integer` | No | Total number of output tokens generated across the client's requests. |
443+
| `totals_by_client[].token_usage.avg_tokens_per_request` | `number` | No | Average number of **output** and **prompt** tokens per request, computed as `(output_tokens_sum + prompt_tokens_sum) ÷ request_count`. |
444+
| `totals_by_client[].totals_by_model` | `array` | No | Per-model breakdown of the client's requests and token usage. Entries are keyed on `model` and `model_selection_mode`, so the same model can appear more than once with different selection modes. |
445+
| `totals_by_client[].totals_by_model[].model` | `string` | No | Model used for the requests. For `code_review`, the model is always reported as `unknown`. |
446+
| `totals_by_client[].totals_by_model[].model_selection_mode` | `string` | No | How the model was selected. Possible values are `user_selected` (a specific model was requested rather than Auto), `product_selected` (the product chose the model, used for all {% data variables.copilot.copilot_code-review_short %} and {% data variables.copilot.copilot_cloud_agent %} requests), `auto` (Auto chose the model), `other` (selection modes that are grouped together and not yet reported individually), and `unknown` (a selection mode sent by the client that couldn't be normalized). |
447+
| `totals_by_client[].totals_by_model[].request_count` | `integer` | No | Number of successful model requests from the client that used this model and selection mode. |
448+
| `totals_by_client[].totals_by_model[].token_usage.prompt_tokens_sum` | `integer` | No | Total number of prompt tokens sent across these requests. |
449+
| `totals_by_client[].totals_by_model[].token_usage.output_tokens_sum` | `integer` | No | Total number of output tokens generated across these requests. |
450+
| `totals_by_client[].totals_by_model[].token_usage.avg_tokens_per_request` | `number` | No | Average number of **output** and **prompt** tokens per request, computed as `(output_tokens_sum + prompt_tokens_sum) ÷ request_count`. |
451+
422452
### Pull request activity fields
423453

424454
> [!IMPORTANT]

‎content/copilot/reference/copilot-usage-metrics/example-schema.md‎

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,54 @@ The following examples show schemas for user-, enterprise-, and repository-level
5252
"prompt_tokens_sum": 3800
5353
}
5454
},
55+
"totals_by_client": [{
56+
"client": "opencode",
57+
"request_count": 3,
58+
"session_count": 2,
59+
"token_usage": {
60+
"avg_tokens_per_request": 1100.0,
61+
"output_tokens_sum": 900,
62+
"prompt_tokens_sum": 2400
63+
},
64+
"totals_by_model": [{
65+
"model": "claude-opus-5.5",
66+
"model_selection_mode": "user_selected",
67+
"request_count": 2,
68+
"token_usage": {
69+
"avg_tokens_per_request": 1200.0,
70+
"output_tokens_sum": 600,
71+
"prompt_tokens_sum": 1800
72+
}
73+
}, {
74+
"model": "claude-sonnet-5",
75+
"model_selection_mode": "auto",
76+
"request_count": 1,
77+
"token_usage": {
78+
"avg_tokens_per_request": 900.0,
79+
"output_tokens_sum": 300,
80+
"prompt_tokens_sum": 600
81+
}
82+
}]
83+
}, {
84+
"client": "copilot_cli",
85+
"request_count": 1,
86+
"session_count": 1,
87+
"token_usage": {
88+
"avg_tokens_per_request": 600.0,
89+
"output_tokens_sum": 100,
90+
"prompt_tokens_sum": 500
91+
},
92+
"totals_by_model": [{
93+
"model": "gpt-5.6-sol",
94+
"model_selection_mode": "user_selected",
95+
"request_count": 1,
96+
"token_usage": {
97+
"avg_tokens_per_request": 600.0,
98+
"output_tokens_sum": 100,
99+
"prompt_tokens_sum": 500
100+
}
101+
}]
102+
}],
55103
"totals_by_copilot_app": {
56104
"prompt_count": 1,
57105
"request_count": 3,
@@ -194,6 +242,8 @@ Customizations with unavailable names or names that look like file paths remain
194242

195243
For coverage and naming rules, see [AUTOTITLE](/copilot/reference/copilot-usage-metrics/copilot-usage-metrics#customization-fields-api-only).
196244

245+
The `totals_by_client` array appears at the top level of each user record in both 1-day and 28-day per-user reports, for both enterprise and organization scopes. It counts successful model requests server-side, so it can include clients, such as OpenCode, that don't appear in `totals_by_ide`.
246+
197247
In this example, `used_copilot_code_review_active` and `used_copilot_code_review_passive` are `null` because there was no {% data variables.copilot.copilot_code-review_short %} signal for the user that day. `used_copilot_cloud_agent` and `used_copilot_coding_agent` always carry the same value.
198248

199249
## Enterprise-level schema example
@@ -300,6 +350,54 @@ In this example, `used_copilot_code_review_active` and `used_copilot_code_review
300350
"prompt_tokens_sum" : 5300
301351
}
302352
},
353+
"totals_by_client" : [ {
354+
"client" : "opencode",
355+
"request_count" : 3,
356+
"session_count" : 2,
357+
"token_usage" : {
358+
"avg_tokens_per_request" : 1100.0,
359+
"output_tokens_sum" : 900,
360+
"prompt_tokens_sum" : 2400
361+
},
362+
"totals_by_model" : [ {
363+
"model" : "claude-opus-5.5",
364+
"model_selection_mode" : "user_selected",
365+
"request_count" : 2,
366+
"token_usage" : {
367+
"avg_tokens_per_request" : 1200.0,
368+
"output_tokens_sum" : 600,
369+
"prompt_tokens_sum" : 1800
370+
}
371+
}, {
372+
"model" : "claude-sonnet-5",
373+
"model_selection_mode" : "auto",
374+
"request_count" : 1,
375+
"token_usage" : {
376+
"avg_tokens_per_request" : 900.0,
377+
"output_tokens_sum" : 300,
378+
"prompt_tokens_sum" : 600
379+
}
380+
} ]
381+
}, {
382+
"client" : "copilot_cli",
383+
"request_count" : 1,
384+
"session_count" : 1,
385+
"token_usage" : {
386+
"avg_tokens_per_request" : 600.0,
387+
"output_tokens_sum" : 100,
388+
"prompt_tokens_sum" : 500
389+
},
390+
"totals_by_model" : [ {
391+
"model" : "gpt-5.6-sol",
392+
"model_selection_mode" : "user_selected",
393+
"request_count" : 1,
394+
"token_usage" : {
395+
"avg_tokens_per_request" : 600.0,
396+
"output_tokens_sum" : 100,
397+
"prompt_tokens_sum" : 500
398+
}
399+
} ]
400+
} ],
303401
"totals_by_copilot_app" : {
304402
"prompt_count" : 2,
305403
"request_count" : 6,
@@ -501,6 +599,45 @@ In this example, `used_copilot_code_review_active` and `used_copilot_code_review
501599
"users_in_phase_28d" : 1,
502600
"total_pull_requests_merged" : 0
503601
} ],
602+
"totals_by_client" : [ {
603+
"client" : "github_app",
604+
"request_count" : 2,
605+
"session_count" : 1,
606+
"token_usage" : {
607+
"avg_tokens_per_request" : 1000.0,
608+
"output_tokens_sum" : 500,
609+
"prompt_tokens_sum" : 1500
610+
},
611+
"totals_by_model" : [ {
612+
"model" : "gpt-5.6-sol",
613+
"model_selection_mode" : "user_selected",
614+
"request_count" : 2,
615+
"token_usage" : {
616+
"avg_tokens_per_request" : 1000.0,
617+
"output_tokens_sum" : 500,
618+
"prompt_tokens_sum" : 1500
619+
}
620+
} ]
621+
}, {
622+
"client" : "code_review",
623+
"request_count" : 2,
624+
"session_count" : 1,
625+
"token_usage" : {
626+
"avg_tokens_per_request" : 800.0,
627+
"output_tokens_sum" : 400,
628+
"prompt_tokens_sum" : 1200
629+
},
630+
"totals_by_model" : [ {
631+
"model" : "unknown",
632+
"model_selection_mode" : "product_selected",
633+
"request_count" : 2,
634+
"token_usage" : {
635+
"avg_tokens_per_request" : 800.0,
636+
"output_tokens_sum" : 400,
637+
"prompt_tokens_sum" : 1200
638+
}
639+
} ]
640+
} ],
504641
"totals_by_custom_agent" : [ ],
505642
"totals_by_feature" : [ {
506643
"code_acceptance_activity_count" : 1,
@@ -599,6 +736,8 @@ Organization aggregated reports use the same top-level `copilot_feature_engageme
599736

600737
The customization fields shown in `day_totals` apply to enterprise and organization aggregated 28-day reports. They also appear directly in enterprise and organization aggregated 1-day reports. Like per-user reports, these aggregated reports include configured names for customizations created by your organization.
601738

739+
Similarly, `totals_by_client` appears within each `day_totals` entry in enterprise and organization aggregated 28-day reports, and directly on the record in aggregated 1-day reports. In aggregated reports, each `totals_by_client` entry's `session_count` is de-duplicated across all users rather than summed from per-user counts.
740+
602741
The following user-teams report examples are returned by the `user-teams-1-day` endpoints and are intended to be joined with the per-user usage report on `user_id`, `day`, and the relevant entity id (`organization_id` for the organization scope, `enterprise_id` for the enterprise scope) to derive team-level metrics. For more guidance, see [AUTOTITLE](/copilot/reference/copilot-usage-metrics/team-level-metrics).
603742

604743
> [!NOTE]

0 commit comments

Comments
 (0)