GitHub Copilot 사용 메트릭에 대한 REST API 엔드포인트
REST API를 사용하여 엔터프라이즈, 조직 또는 팀의 Copilot 사용 현황 메트릭에 액세스합니다.
Get a summary of Copilot usage for enterprise members
Note
This endpoint is in public preview and is subject to change.
You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.
The response contains metrics for up to 28 days prior. Usage 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.
The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time.
Only owners and billing managers can view Copilot usage 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.
"Get a summary of Copilot usage for enterprise members"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Get a summary of Copilot usage for enterprise members"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
enterprise string RequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
속성, 형식, 설명 |
---|
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." 기본값: |
per_page integer The number of days of metrics to display per page (max 28). For more information, see "Using pagination in the REST API." 기본값: |
"Get a summary of Copilot usage for enterprise members"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
"Get a summary of Copilot usage for enterprise members"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
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/usage
Response
Status: 200
[
{
"day": "2023-10-15",
"total_suggestions_count": 5000,
"total_acceptances_count": 3000,
"total_lines_suggested": 7000,
"total_lines_accepted": 3500,
"total_active_users": 15,
"total_chat_acceptances": 45,
"total_chat_turns": 350,
"total_active_chat_users": 8,
"breakdown": [
{
"language": "python",
"editor": "vscode",
"suggestions_count": 3000,
"acceptances_count": 2000,
"lines_suggested": 3000,
"lines_accepted": 1500,
"active_users": 5
},
{
"language": "python",
"editor": "jetbrains",
"suggestions_count": 1000,
"acceptances_count": 500,
"lines_suggested": 2000,
"lines_accepted": 1000,
"active_users": 5
},
{
"language": "javascript",
"editor": "vscode",
"suggestions_count": 1000,
"acceptances_count": 500,
"lines_suggested": 2000,
"lines_accepted": 1000,
"active_users": 5
}
]
},
{
"day": "2023-10-16",
"total_suggestions_count": 5200,
"total_acceptances_count": 5100,
"total_lines_suggested": 5300,
"total_lines_accepted": 5000,
"total_active_users": 15,
"total_chat_acceptances": 57,
"total_chat_turns": 455,
"total_active_chat_users": 12,
"breakdown": [
{
"language": "python",
"editor": "vscode",
"suggestions_count": 3100,
"acceptances_count": 3000,
"lines_suggested": 3200,
"lines_accepted": 3100,
"active_users": 5
},
{
"language": "python",
"editor": "jetbrains",
"suggestions_count": 1100,
"acceptances_count": 1000,
"lines_suggested": 1200,
"lines_accepted": 1100,
"active_users": 5
},
{
"language": "javascript",
"editor": "vscode",
"suggestions_count": 1000,
"acceptances_count": 900,
"lines_suggested": 1100,
"lines_accepted": 1000,
"active_users": 5
}
]
}
]
Get a summary of Copilot usage for an enterprise team
Note
This endpoint is in public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "About enterprise accounts for Copilot Business."
You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.
The response contains metrics for up to 28 days prior. Usage 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, as evaluated at the end of that day.
Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage 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.
"Get a summary of Copilot usage for an enterprise team"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Get a summary of Copilot usage for an enterprise team"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
enterprise string RequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
team_slug string RequiredThe slug of the team name. |
속성, 형식, 설명 |
---|
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." 기본값: |
per_page integer The number of days of metrics to display per page (max 28). For more information, see "Using pagination in the REST API." 기본값: |
"Get a summary of Copilot usage for an enterprise team"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
"Get a summary of Copilot usage for an enterprise team"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
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/usage
Response
Status: 200
[
{
"day": "2023-10-15",
"total_suggestions_count": 1000,
"total_acceptances_count": 800,
"total_lines_suggested": 1800,
"total_lines_accepted": 1200,
"total_active_users": 10,
"total_chat_acceptances": 32,
"total_chat_turns": 200,
"total_active_chat_users": 4,
"breakdown": [
{
"language": "python",
"editor": "vscode",
"suggestions_count": 300,
"acceptances_count": 250,
"lines_suggested": 900,
"lines_accepted": 700,
"active_users": 5
},
{
"language": "python",
"editor": "jetbrains",
"suggestions_count": 300,
"acceptances_count": 200,
"lines_suggested": 400,
"lines_accepted": 300,
"active_users": 2
},
{
"language": "ruby",
"editor": "vscode",
"suggestions_count": 400,
"acceptances_count": 350,
"lines_suggested": 500,
"lines_accepted": 200,
"active_users": 3
}
]
},
{
"day": "2023-10-16",
"total_suggestions_count": 800,
"total_acceptances_count": 600,
"total_lines_suggested": 1100,
"total_lines_accepted": 700,
"total_active_users": 12,
"total_chat_acceptances": 57,
"total_chat_turns": 426,
"total_active_chat_users": 8,
"breakdown": [
{
"language": "python",
"editor": "vscode",
"suggestions_count": 300,
"acceptances_count": 200,
"lines_suggested": 600,
"lines_accepted": 300,
"active_users": 2
},
{
"language": "python",
"editor": "jetbrains",
"suggestions_count": 300,
"acceptances_count": 150,
"lines_suggested": 300,
"lines_accepted": 250,
"active_users": 6
},
{
"language": "ruby",
"editor": "vscode",
"suggestions_count": 200,
"acceptances_count": 150,
"lines_suggested": 200,
"lines_accepted": 150,
"active_users": 3
}
]
}
]
Get a summary of Copilot usage for organization members
Note
This endpoint is in public preview and is subject to change.
You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.
The response contains metrics for up to 28 days prior. Usage 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.
Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage 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.
"Get a summary of Copilot usage for organization members"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합 중 하나 이상이 있어야 합니다.:
- "GitHub Copilot Business" organization permissions (read)
- "Administration" organization permissions (read)
"Get a summary of Copilot usage for organization members"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
org string RequiredThe organization name. The name is not case sensitive. |
속성, 형식, 설명 |
---|
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." 기본값: |
per_page integer The number of days of metrics to display per page (max 28). For more information, see "Using pagination in the REST API." 기본값: |
"Get a summary of Copilot usage for organization members"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
"Get a summary of Copilot usage for organization members"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
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/usage
Response
Status: 200
[
{
"day": "2023-10-15",
"total_suggestions_count": 1000,
"total_acceptances_count": 800,
"total_lines_suggested": 1800,
"total_lines_accepted": 1200,
"total_active_users": 10,
"total_chat_acceptances": 32,
"total_chat_turns": 200,
"total_active_chat_users": 4,
"breakdown": [
{
"language": "python",
"editor": "vscode",
"suggestions_count": 300,
"acceptances_count": 250,
"lines_suggested": 900,
"lines_accepted": 700,
"active_users": 5
},
{
"language": "python",
"editor": "jetbrains",
"suggestions_count": 300,
"acceptances_count": 200,
"lines_suggested": 400,
"lines_accepted": 300,
"active_users": 2
},
{
"language": "ruby",
"editor": "vscode",
"suggestions_count": 400,
"acceptances_count": 350,
"lines_suggested": 500,
"lines_accepted": 200,
"active_users": 3
}
]
},
{
"day": "2023-10-16",
"total_suggestions_count": 800,
"total_acceptances_count": 600,
"total_lines_suggested": 1100,
"total_lines_accepted": 700,
"total_active_users": 12,
"total_chat_acceptances": 57,
"total_chat_turns": 426,
"total_active_chat_users": 8,
"breakdown": [
{
"language": "python",
"editor": "vscode",
"suggestions_count": 300,
"acceptances_count": 200,
"lines_suggested": 600,
"lines_accepted": 300,
"active_users": 2
},
{
"language": "python",
"editor": "jetbrains",
"suggestions_count": 300,
"acceptances_count": 150,
"lines_suggested": 300,
"lines_accepted": 250,
"active_users": 6
},
{
"language": "ruby",
"editor": "vscode",
"suggestions_count": 200,
"acceptances_count": 150,
"lines_suggested": 200,
"lines_accepted": 150,
"active_users": 3
}
]
}
]
Get a summary of Copilot usage for a team
Note
This endpoint is in public preview and is subject to change.
You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.
The response contains metrics for up to 28 days prior. Usage 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 team had five or more members with active Copilot licenses, as evaluated at the end of that day.
Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage 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.
"Get a summary of Copilot usage for a team"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합 중 하나 이상이 있어야 합니다.:
- "GitHub Copilot Business" organization permissions (read)
- "Administration" organization permissions (read)
"Get a summary of Copilot usage for a team"에 대한 매개 변수
속성, 형식, 설명 |
---|
accept string Setting to |
속성, 형식, 설명 |
---|
org string RequiredThe organization name. The name is not case sensitive. |
team_slug string RequiredThe slug of the team name. |
속성, 형식, 설명 |
---|
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." 기본값: |
per_page integer The number of days of metrics to display per page (max 28). For more information, see "Using pagination in the REST API." 기본값: |
"Get a summary of Copilot usage for a team"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
"Get a summary of Copilot usage for a team"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com
을 api.SUBDOMAIN.ghe.com
의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
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/usage
Response
Status: 200
[
{
"day": "2023-10-15",
"total_suggestions_count": 1000,
"total_acceptances_count": 800,
"total_lines_suggested": 1800,
"total_lines_accepted": 1200,
"total_active_users": 10,
"total_chat_acceptances": 32,
"total_chat_turns": 200,
"total_active_chat_users": 4,
"breakdown": [
{
"language": "python",
"editor": "vscode",
"suggestions_count": 300,
"acceptances_count": 250,
"lines_suggested": 900,
"lines_accepted": 700,
"active_users": 5
},
{
"language": "python",
"editor": "jetbrains",
"suggestions_count": 300,
"acceptances_count": 200,
"lines_suggested": 400,
"lines_accepted": 300,
"active_users": 2
},
{
"language": "ruby",
"editor": "vscode",
"suggestions_count": 400,
"acceptances_count": 350,
"lines_suggested": 500,
"lines_accepted": 200,
"active_users": 3
}
]
},
{
"day": "2023-10-16",
"total_suggestions_count": 800,
"total_acceptances_count": 600,
"total_lines_suggested": 1100,
"total_lines_accepted": 700,
"total_active_users": 12,
"total_chat_acceptances": 57,
"total_chat_turns": 426,
"total_active_chat_users": 8,
"breakdown": [
{
"language": "python",
"editor": "vscode",
"suggestions_count": 300,
"acceptances_count": 200,
"lines_suggested": 600,
"lines_accepted": 300,
"active_users": 2
},
{
"language": "python",
"editor": "jetbrains",
"suggestions_count": 300,
"acceptances_count": 150,
"lines_suggested": 300,
"lines_accepted": 250,
"active_users": 6
},
{
"language": "ruby",
"editor": "vscode",
"suggestions_count": 200,
"acceptances_count": 150,
"lines_suggested": 200,
"lines_accepted": 150,
"active_users": 3
}
]
}
]