Puntos de conexión de la API REST para métricas de Copilot
Usa la API de REST para ver las métricas de Copilot.
Puedes usar estos puntos de conexión para obtener un desglose de las métricas agregadas de varias características de GitHub Copilot. La API incluye:
- Datos de los últimos 100 días
- Números de usuarios activos y usuarios comprometidos
- Desgloses por idioma e IDE
- La opción para ver las métricas de una empresa, organización o equipo
Para obtener ayuda a fin de empezar, consulta Tracking license activation and initial usage with Copilot usage metrics.
Nota:
Los puntos de conexión de métricas de Copilot no están disponibles para Nube de GitHub Enterprise con residencia de datos en GHE.com.
Get Copilot metrics for an enterprise
Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.
The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, they must have telemetry enabled in their IDE.
To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. Only enterprise owners and billing managers can view Copilot metrics for the enterprise.
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.
Tokens de acceso específicos para "Get Copilot metrics for an enterprise"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Get Copilot metrics for an enterprise"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string RequeridoThe slug version of the enterprise name. |
| Nombre, Tipo, Descripción |
|---|
since string Show usage metrics since this date. This is a timestamp in ISO 8601 format ( |
until string Show usage metrics until this date. This is a timestamp in ISO 8601 format ( |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Valor predeterminado: |
per_page integer The number of days of metrics to display per page (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Get Copilot metrics for an enterprise"
| status code | Descripción |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
422 | Copilot Usage Merics API setting is disabled at the organization or enterprise level. |
500 | Internal Error |
Ejemplos de código para "Get Copilot metrics for an enterprise"
Si accedes a GitHub en GHE.com, reemplaza api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/copilot/metricsResponse
Status: 200[
{
"date": "2024-06-24",
"total_active_users": 24,
"total_engaged_users": 20,
"copilot_ide_code_completions": {
"total_engaged_users": 20,
"languages": [
{
"name": "python",
"total_engaged_users": 10
},
{
"name": "ruby",
"total_engaged_users": 10
}
],
"editors": [
{
"name": "vscode",
"total_engaged_users": 13,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 13,
"languages": [
{
"name": "python",
"total_engaged_users": 6,
"total_code_suggestions": 249,
"total_code_acceptances": 123,
"total_code_lines_suggested": 225,
"total_code_lines_accepted": 135
},
{
"name": "ruby",
"total_engaged_users": 7,
"total_code_suggestions": 496,
"total_code_acceptances": 253,
"total_code_lines_suggested": 520,
"total_code_lines_accepted": 270
}
]
}
]
},
{
"name": "neovim",
"total_engaged_users": 7,
"models": [
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"languages": [
{
"name": "typescript",
"total_engaged_users": 3,
"total_code_suggestions": 112,
"total_code_acceptances": 56,
"total_code_lines_suggested": 143,
"total_code_lines_accepted": 61
},
{
"name": "go",
"total_engaged_users": 4,
"total_code_suggestions": 132,
"total_code_acceptances": 67,
"total_code_lines_suggested": 154,
"total_code_lines_accepted": 72
}
]
}
]
}
]
},
"copilot_ide_chat": {
"total_engaged_users": 13,
"editors": [
{
"name": "vscode",
"total_engaged_users": 13,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 12,
"total_chats": 45,
"total_chat_insertion_events": 12,
"total_chat_copy_events": 16
},
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"total_engaged_users": 1,
"total_chats": 10,
"total_chat_insertion_events": 11,
"total_chat_copy_events": 3
}
]
}
]
},
"copilot_dotcom_chat": {
"total_engaged_users": 14,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 14,
"total_chats": 38
}
]
},
"copilot_dotcom_pull_requests": {
"total_engaged_users": 12,
"repositories": [
{
"name": "demo/repo1",
"total_engaged_users": 8,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_pr_summaries_created": 6,
"total_engaged_users": 8
}
]
},
{
"name": "demo/repo2",
"total_engaged_users": 4,
"models": [
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"total_pr_summaries_created": 10,
"total_engaged_users": 4
}
]
}
]
}
}
]Get Copilot enterprise usage metrics for a specific day
Use this endpoint to retrieve download links for the Copilot enterprise usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the enterprise.
The report contains aggregated metrics for the specified day, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. Reports are generated daily and made available for download through signed URLs with a limited expiration time.
The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date.
Only enterprise owners and billing managers can retrieve Copilot metrics reports for the enterprise. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.
Tokens de acceso específicos para "Get Copilot enterprise usage metrics for a specific day"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Get Copilot enterprise usage metrics for a specific day"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string RequeridoThe slug version of the enterprise name. |
| Nombre, Tipo, Descripción |
|---|
day string RequeridoThe day to request data for, in |
Códigos de estado de respuesta HTTP para "Get Copilot enterprise usage metrics for a specific day"
| status code | Descripción |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Ejemplos de código para "Get Copilot enterprise usage metrics for a specific day"
Si accedes a GitHub en GHE.com, reemplaza api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/enterprises/ENTERPRISE/copilot/metrics/reports/enterprise-1-day?day=DAY"Response
Status: 200{
"download_links": [
"https://example.com/copilot-usage-report-1.json",
"https://example.com/copilot-usage-report-2.json"
],
"report_day": "2025-07-01"
}Get Copilot enterprise usage metrics
Use this endpoint to retrieve download links for the latest 28-day enterprise Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the enterprise.
The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. Reports are generated daily and made available for download through signed URLs with a limited expiration time.
The response includes download links to the report files, along with the specific date range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed.
Only enterprise owners and billing managers can retrieve Copilot metrics reports for the enterprise. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.
Tokens de acceso específicos para "Get Copilot enterprise usage metrics"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Get Copilot enterprise usage metrics"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string RequeridoThe slug version of the enterprise name. |
Códigos de estado de respuesta HTTP para "Get Copilot enterprise usage metrics"
| status code | Descripción |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Ejemplos de código para "Get Copilot enterprise usage metrics"
Si accedes a GitHub en GHE.com, reemplaza api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/copilot/metrics/reports/enterprise-28-day/latestResponse
Status: 200{
"download_links": [
"https://example.com/copilot-usage-report-1.json",
"https://example.com/copilot-usage-report-2.json"
],
"report_start_day": "2025-07-01",
"report_end_day": "2025-07-28"
}Get Copilot users usage metrics for a specific day
Use this endpoint to retrieve download links for the Copilot user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise.
The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows enterprise administrators to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement.
Reports are generated daily and made available for download through signed URLs with a limited expiration time. The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date.
Only enterprise owners and billing managers can retrieve Copilot user metrics reports for the enterprise. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.
Tokens de acceso específicos para "Get Copilot users usage metrics for a specific day"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Get Copilot users usage metrics for a specific day"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string RequeridoThe slug version of the enterprise name. |
| Nombre, Tipo, Descripción |
|---|
day string RequeridoThe day to request data for, in |
Códigos de estado de respuesta HTTP para "Get Copilot users usage metrics for a specific day"
| status code | Descripción |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Ejemplos de código para "Get Copilot users usage metrics for a specific day"
Si accedes a GitHub en GHE.com, reemplaza api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/enterprises/ENTERPRISE/copilot/metrics/reports/users-1-day?day=DAY"Response
Status: 200{
"download_links": [
"https://example.com/copilot-usage-report-1.json",
"https://example.com/copilot-usage-report-2.json"
],
"report_day": "2025-07-01"
}Get Copilot users usage metrics
Use this endpoint to retrieve download links for the latest 28-day enterprise users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise.
The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows enterprise administrators to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement.
Reports are generated daily and made available for download through signed URLs with a limited expiration time. The response includes download links to the report files, along with the specific date range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed.
Only enterprise owners and billing managers can retrieve Copilot users metrics reports for the enterprise. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.
Tokens de acceso específicos para "Get Copilot users usage metrics"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Get Copilot users usage metrics"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string RequeridoThe slug version of the enterprise name. |
Códigos de estado de respuesta HTTP para "Get Copilot users usage metrics"
| status code | Descripción |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Ejemplos de código para "Get Copilot users usage metrics"
Si accedes a GitHub en GHE.com, reemplaza api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/copilot/metrics/reports/users-28-day/latestResponse
Status: 200{
"download_links": [
"https://example.com/copilot-usage-report-1.json",
"https://example.com/copilot-usage-report-2.json"
],
"report_start_day": "2025-07-01",
"report_end_day": "2025-07-28"
}Get Copilot metrics for an enterprise team
Note
This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "About enterprise accounts for Copilot Business."
Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.
The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, they must have telemetry enabled in their IDE.
Note
This endpoint will only return results for a given day if the enterprise team had five or more members with active Copilot licenses on that day, as evaluated at the end of that day.
To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team.
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.
Tokens de acceso específicos para "Get Copilot metrics for an enterprise team"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Get Copilot metrics for an enterprise team"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string RequeridoThe slug version of the enterprise name. |
team_slug string RequeridoThe slug of the enterprise team name. |
| Nombre, Tipo, Descripción |
|---|
since string Show usage metrics since this date. This is a timestamp in ISO 8601 format ( |
until string Show usage metrics until this date. This is a timestamp in ISO 8601 format ( |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Valor predeterminado: |
per_page integer The number of days of metrics to display per page (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Get Copilot metrics for an enterprise team"
| status code | Descripción |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
422 | Copilot Usage Merics API setting is disabled at the organization or enterprise level. |
500 | Internal Error |
Ejemplos de código para "Get Copilot metrics for an enterprise team"
Si accedes a GitHub en GHE.com, reemplaza api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/team/TEAM_SLUG/copilot/metricsResponse
Status: 200[
{
"date": "2024-06-24",
"total_active_users": 24,
"total_engaged_users": 20,
"copilot_ide_code_completions": {
"total_engaged_users": 20,
"languages": [
{
"name": "python",
"total_engaged_users": 10
},
{
"name": "ruby",
"total_engaged_users": 10
}
],
"editors": [
{
"name": "vscode",
"total_engaged_users": 13,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 13,
"languages": [
{
"name": "python",
"total_engaged_users": 6,
"total_code_suggestions": 249,
"total_code_acceptances": 123,
"total_code_lines_suggested": 225,
"total_code_lines_accepted": 135
},
{
"name": "ruby",
"total_engaged_users": 7,
"total_code_suggestions": 496,
"total_code_acceptances": 253,
"total_code_lines_suggested": 520,
"total_code_lines_accepted": 270
}
]
}
]
},
{
"name": "neovim",
"total_engaged_users": 7,
"models": [
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"languages": [
{
"name": "typescript",
"total_engaged_users": 3,
"total_code_suggestions": 112,
"total_code_acceptances": 56,
"total_code_lines_suggested": 143,
"total_code_lines_accepted": 61
},
{
"name": "go",
"total_engaged_users": 4,
"total_code_suggestions": 132,
"total_code_acceptances": 67,
"total_code_lines_suggested": 154,
"total_code_lines_accepted": 72
}
]
}
]
}
]
},
"copilot_ide_chat": {
"total_engaged_users": 13,
"editors": [
{
"name": "vscode",
"total_engaged_users": 13,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 12,
"total_chats": 45,
"total_chat_insertion_events": 12,
"total_chat_copy_events": 16
},
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"total_engaged_users": 1,
"total_chats": 10,
"total_chat_insertion_events": 11,
"total_chat_copy_events": 3
}
]
}
]
},
"copilot_dotcom_chat": {
"total_engaged_users": 14,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 14,
"total_chats": 38
}
]
},
"copilot_dotcom_pull_requests": {
"total_engaged_users": 12,
"repositories": [
{
"name": "demo/repo1",
"total_engaged_users": 8,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_pr_summaries_created": 6,
"total_engaged_users": 8
}
]
},
{
"name": "demo/repo2",
"total_engaged_users": 4,
"models": [
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"total_pr_summaries_created": 10,
"total_engaged_users": 4
}
]
}
]
}
}
]Get Copilot metrics for an organization
Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.
Note
This endpoint will only return results for a given day if the organization contained five or more members with active Copilot licenses on that day, as evaluated at the end of that day.
The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, they must have telemetry enabled in their IDE.
To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics.
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot, read:org, or read:enterprise scopes to use this endpoint.
Tokens de acceso específicos para "Get Copilot metrics for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener al menos uno de los siguientes conjuntos de permisos:
- "GitHub Copilot Business" organization permissions (read)
- "Administration" organization permissions (read)
Parámetros para "Get Copilot metrics for an organization"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
org string RequeridoThe organization name. The name is not case sensitive. |
| Nombre, Tipo, Descripción |
|---|
since string Show usage metrics since this date. This is a timestamp in ISO 8601 format ( |
until string Show usage metrics until this date. This is a timestamp in ISO 8601 format ( |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Valor predeterminado: |
per_page integer The number of days of metrics to display per page (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Get Copilot metrics for an organization"
| status code | Descripción |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
422 | Copilot Usage Merics API setting is disabled at the organization or enterprise level. |
500 | Internal Error |
Ejemplos de código para "Get Copilot metrics for an organization"
Si accedes a GitHub en GHE.com, reemplaza api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/copilot/metricsResponse
Status: 200[
{
"date": "2024-06-24",
"total_active_users": 24,
"total_engaged_users": 20,
"copilot_ide_code_completions": {
"total_engaged_users": 20,
"languages": [
{
"name": "python",
"total_engaged_users": 10
},
{
"name": "ruby",
"total_engaged_users": 10
}
],
"editors": [
{
"name": "vscode",
"total_engaged_users": 13,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 13,
"languages": [
{
"name": "python",
"total_engaged_users": 6,
"total_code_suggestions": 249,
"total_code_acceptances": 123,
"total_code_lines_suggested": 225,
"total_code_lines_accepted": 135
},
{
"name": "ruby",
"total_engaged_users": 7,
"total_code_suggestions": 496,
"total_code_acceptances": 253,
"total_code_lines_suggested": 520,
"total_code_lines_accepted": 270
}
]
}
]
},
{
"name": "neovim",
"total_engaged_users": 7,
"models": [
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"languages": [
{
"name": "typescript",
"total_engaged_users": 3,
"total_code_suggestions": 112,
"total_code_acceptances": 56,
"total_code_lines_suggested": 143,
"total_code_lines_accepted": 61
},
{
"name": "go",
"total_engaged_users": 4,
"total_code_suggestions": 132,
"total_code_acceptances": 67,
"total_code_lines_suggested": 154,
"total_code_lines_accepted": 72
}
]
}
]
}
]
},
"copilot_ide_chat": {
"total_engaged_users": 13,
"editors": [
{
"name": "vscode",
"total_engaged_users": 13,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 12,
"total_chats": 45,
"total_chat_insertion_events": 12,
"total_chat_copy_events": 16
},
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"total_engaged_users": 1,
"total_chats": 10,
"total_chat_insertion_events": 11,
"total_chat_copy_events": 3
}
]
}
]
},
"copilot_dotcom_chat": {
"total_engaged_users": 14,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 14,
"total_chats": 38
}
]
},
"copilot_dotcom_pull_requests": {
"total_engaged_users": 12,
"repositories": [
{
"name": "demo/repo1",
"total_engaged_users": 8,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_pr_summaries_created": 6,
"total_engaged_users": 8
}
]
},
{
"name": "demo/repo2",
"total_engaged_users": 4,
"models": [
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"total_pr_summaries_created": 10,
"total_engaged_users": 4
}
]
}
]
}
}
]Get Copilot metrics for a team
Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.
Note
This endpoint will only return results for a given day if the team had five or more members with active Copilot licenses on that day, as evaluated at the end of that day.
The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, they must have telemetry enabled in their IDE.
To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings. Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team.
OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot, read:org, or read:enterprise scopes to use this endpoint.
Tokens de acceso específicos para "Get Copilot metrics for a team"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener al menos uno de los siguientes conjuntos de permisos:
- "GitHub Copilot Business" organization permissions (read)
- "Administration" organization permissions (read)
Parámetros para "Get Copilot metrics for a team"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
org string RequeridoThe organization name. The name is not case sensitive. |
team_slug string RequeridoThe slug of the team name. |
| Nombre, Tipo, Descripción |
|---|
since string Show usage metrics since this date. This is a timestamp in ISO 8601 format ( |
until string Show usage metrics until this date. This is a timestamp in ISO 8601 format ( |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Valor predeterminado: |
per_page integer The number of days of metrics to display per page (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Get Copilot metrics for a team"
| status code | Descripción |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
422 | Copilot Usage Merics API setting is disabled at the organization or enterprise level. |
500 | Internal Error |
Ejemplos de código para "Get Copilot metrics for a team"
Si accedes a GitHub en GHE.com, reemplaza api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/team/TEAM_SLUG/copilot/metricsResponse
Status: 200[
{
"date": "2024-06-24",
"total_active_users": 24,
"total_engaged_users": 20,
"copilot_ide_code_completions": {
"total_engaged_users": 20,
"languages": [
{
"name": "python",
"total_engaged_users": 10
},
{
"name": "ruby",
"total_engaged_users": 10
}
],
"editors": [
{
"name": "vscode",
"total_engaged_users": 13,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 13,
"languages": [
{
"name": "python",
"total_engaged_users": 6,
"total_code_suggestions": 249,
"total_code_acceptances": 123,
"total_code_lines_suggested": 225,
"total_code_lines_accepted": 135
},
{
"name": "ruby",
"total_engaged_users": 7,
"total_code_suggestions": 496,
"total_code_acceptances": 253,
"total_code_lines_suggested": 520,
"total_code_lines_accepted": 270
}
]
}
]
},
{
"name": "neovim",
"total_engaged_users": 7,
"models": [
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"languages": [
{
"name": "typescript",
"total_engaged_users": 3,
"total_code_suggestions": 112,
"total_code_acceptances": 56,
"total_code_lines_suggested": 143,
"total_code_lines_accepted": 61
},
{
"name": "go",
"total_engaged_users": 4,
"total_code_suggestions": 132,
"total_code_acceptances": 67,
"total_code_lines_suggested": 154,
"total_code_lines_accepted": 72
}
]
}
]
}
]
},
"copilot_ide_chat": {
"total_engaged_users": 13,
"editors": [
{
"name": "vscode",
"total_engaged_users": 13,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 12,
"total_chats": 45,
"total_chat_insertion_events": 12,
"total_chat_copy_events": 16
},
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"total_engaged_users": 1,
"total_chats": 10,
"total_chat_insertion_events": 11,
"total_chat_copy_events": 3
}
]
}
]
},
"copilot_dotcom_chat": {
"total_engaged_users": 14,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_engaged_users": 14,
"total_chats": 38
}
]
},
"copilot_dotcom_pull_requests": {
"total_engaged_users": 12,
"repositories": [
{
"name": "demo/repo1",
"total_engaged_users": 8,
"models": [
{
"name": "default",
"is_custom_model": false,
"custom_model_training_date": null,
"total_pr_summaries_created": 6,
"total_engaged_users": 8
}
]
},
{
"name": "demo/repo2",
"total_engaged_users": 4,
"models": [
{
"name": "a-custom-model",
"is_custom_model": true,
"custom_model_training_date": "2024-02-01",
"total_pr_summaries_created": 10,
"total_engaged_users": 4
}
]
}
]
}
}
]