Get Copilot usage data as:
- Md Job Summary
- CSV
- XML
- JSON
Powered by the REST API endpoints for GitHub Copilot usage metrics.
Tip
🚀 Get this running FAST by using the template
Create a workflow (eg: .github/workflows/copilot-usage.yml). See Creating a Workflow file.
You will need to create a PAT(Personal Access Token) that has the copilot, manage_billing:copilot, admin:org, admin:enterprise, or manage_billing:enterprise scope to use this endpoint.
Add this PAT as a secret so we can use it as input github-token, see Creating encrypted secrets for a repository.
The default behavior is to get the usage for the repository owner which is likely the organization.
Important
You need to set the secret TOKEN in your repository settings.
name: Copilot Usage
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
run:
name: Run Action
runs-on: ubuntu-latest
steps:
- uses: austenstone/copilot-usage@v4
with:
github-token: ${{ secrets.TOKEN }} - uses: austenstone/copilot-usage@v4
with:
github-token: ${{ secrets.TOKEN }}
organization: 'org-slug'
team: 'team-slug' - uses: austenstone/copilot-usage@v4
with:
github-token: ${{ secrets.TOKEN }}
enterprise: 'enterprise-slug' - uses: austenstone/copilot-usage@v4
with:
github-token: ${{ secrets.TOKEN }}
csv: trueImportant
You must set secrets for EMAIL and PASSWORD to send the email. You must use an App Password for Gmail.
name: Email Copilot Report
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: austenstone/copilot-usage@v4
with:
github-token: ${{ secrets.TOKEN }}
- uses: austenstone/job-summary@v2.0
id: pdf
with:
name: copilot-usage
- uses: dawidd6/action-send-mail@v4
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.EMAIL }}
password: ${{ secrets.PASSWORD }}
from: ${{ secrets.EMAIL }}
to: ${{ secrets.EMAIL }} # Recipient email
subject: "Copilot Usage Report (${{ steps.usage.outputs.since }} - ${{ steps.usage.outputs.until }})"
html_body: |
<!DOCTYPE html>
<html>
<body>
<h1>Copilot Usage Report</h1>
<p>Attached is the Copilot Usage Report for ${{ steps.usage.outputs.since }} - ${{ steps.usage.outputs.until }}!</p>
<p>
<a href="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#:~:text=Copilot%20Usage%20summary">View the full report on
GitHub.com</a>
</p>
${{ steps.pdf.outputs.job-summary-html }}
</body>
</html>
attachments: ${{ steps.pdf.outputs.pdf-file }}We look first for enterprise input, then team, and finally organization. If none are provided, we default to the repository owner which is likely the organization.
Various inputs are defined in action.yml:
| Name | Description | Default |
|---|---|---|
| github-token | The GitHub token used to create an authenticated client | |
| enterprise | The GitHub enterprise slug | |
| organization | The organization slug | ${{ github.repository_owner }} |
| job-summary | Whether to generate a report | true |
| csv | Whether to generate a CSV as a workflow artifact | false |
| csv-options | The options for the CSV report | |
| xml | Whether to generate an XML as a workflow artifact | false |
| xml-options | The options for the XML report | |
| team | The team slug | |
| days | The number of days to show usage metrics for | |
| since | Show usage metrics since this date. This is a timestamp, in YYYY-MM-DD format. Maximum value is 28 days ago |
|
| until | Show usage metrics until this date. This is a timestamp, in YYYY-MM-DD format. Maximum value is 28 days ago |
|
| time-zone | The time zone to use for the report | UTC |
| Name | Description |
|---|---|
| result | The copilot usage as a JSON string |
| since | The date since which the usage metrics are shown |
| until | The date until which the usage metrics are shown |
The endpoints used by this action...
- GET /enterprises/{enterprise}/copilot/usage
- GET /orgs/{org}/team/{team}/copilot/usage
- GET /orgs/{org}/copilot/usage
- GET /orgs/{org}/copilot/billing
- GET /orgs/{org}/copilot/billing/seats
Click to expand example!
- Acceptances: 6,081
- Turns: 33,888
- Acceptance Rate: 17.94%
- Average Daily Users: 69.56
---
config:
xyChart:
width: 1215
height: 500
xAxis:
labelPadding: 20
themeVariables:
xyChart:
backgroundColor: "transparent"
---
xychart-beta
title "Chat Accepts & Acceptance Rate"
x-axis ["08/02", "08/03", "08/04", "08/05", "08/06", "08/07", "08/08", "08/09", "08/10", "08/11", "08/12", "08/13", "08/14", "08/15", "08/16", "08/17", "08/18", "08/19", "08/20", "08/21", "08/22", "08/23", "08/24", "08/25", "08/26", "08/27", "08/28"]
y-axis "Chat Acceptances" 0 --> 482
bar [199, 65, 146, 257, 273, 274, 327, 215, 67, 130, 327, 352, 266, 275, 249, 51, 39, 244, 341, 282, 238, 243, 71, 114, 251, 472, 313]
line [79.79866888519135, 192.2085889570552, 167.15439429928742, 93.63114134542707, 90.49931224209078, 82.1318407960199, 82.30496083550915, 83.77526273241715, 111.35862068965517, 86.66666666666667, 90.16819221967964, 90.3910495471497, 75.33019976498237, 81.16962645437845, 94.35377358490567, 104.16101694915254, 53.101694915254235, 83.05649717514125, 88.7004856988667, 76.70654627539503, 72.05778894472363, 89.95852534562212, 97.77714285714285, 111.00606060606061, 77.7019910083494, 90.71132376395533, 80.03501326259948]
- Suggestions: 175,352
- Acceptances: 51,946
- Acceptance Rate: 29.62%
- Lines of Code Accepted: 72,397
---
config:
xyChart:
width: 1215
height: 500
xAxis:
labelPadding: 20
themeVariables:
xyChart:
backgroundColor: "transparent"
---
xychart-beta
title "Accepts & Acceptance Rate"
x-axis ["08/02", "08/03", "08/04", "08/05", "08/06", "08/07", "08/08", "08/09", "08/10", "08/11", "08/12", "08/13", "08/14", "08/15", "08/16", "08/17", "08/18", "08/19", "08/20", "08/21", "08/22", "08/23", "08/24", "08/25", "08/26", "08/27", "08/28"]
y-axis "Acceptances" 0 --> 3299
bar [2205, 497, 1156, 1627, 2036, 2627, 2445, 2218, 851, 898, 1963, 3289, 2076, 2234, 2540, 1548, 529, 2341, 2087, 2705, 2408, 1843, 427, 1918, 2497, 2771, 2210]
line [949.1512265135699, 864.3136531365313, 892.2891904539074, 842.7497252315906, 980.4063640344475, 1139.1263144058887, 1067.5033086289043, 1009.5449779249448, 897.5220588235294, 1061.8286738351255, 939.4947047729581, 1119.8690267313448, 972.1396735273242, 934.8003551496703, 995.0670941693386, 1085.640306122449, 755.4852813852814, 930.8134265397131, 899.296368861024, 1000.5376163247, 890.3824254651423, 1003.4753259613797, 702.9306387225549, 1179.6200596569724, 892.5780691299166, 975.9292196007259, 1012.0474736257635]
---
config:
xyChart:
width: 1215
height: 500
xAxis:
labelPadding: 20
themeVariables:
xyChart:
backgroundColor: "transparent"
---
xychart-beta
title "Daily Active Users"
x-axis ["08/02", "08/03", "08/04", "08/05", "08/06", "08/07", "08/08", "08/09", "08/10", "08/11", "08/12", "08/13", "08/14", "08/15", "08/16", "08/17", "08/18", "08/19", "08/20", "08/21", "08/22", "08/23", "08/24", "08/25", "08/26", "08/27", "08/28"]
y-axis "Active Users" 0 --> 111
line [72, 19, 22, 77, 93, 87, 99, 79, 32, 28, 80, 91, 90, 85, 86, 28, 21, 92, 97, 101, 94, 88, 31, 30, 82, 101, 98]
pie showData
title Language Usage
"typescript" : 25544
"markdown" : 24925
"python" : 20772
"typescriptreact" : 16303
"javascript" : 10758
"rust" : 9526
"yaml" : 8918
"ruby" : 8702
"go" : 7731
"java" : 6086
"unknown" : 4726
"c#" : 3396
"vue" : 2726
"css" : 2711
"groovy" : 2559
"c++" : 2554
"shell" : 2089
"ql" : 1977
"json" : 1921
"html" : 1519
| Language | Suggestions | Acceptances | Acceptance Rate | Lines Suggested | Lines Accepted | Active Users |
|---|---|---|---|---|---|---|
| python | 20,772 | 9,126 | 43.93% | 33,773 | 12,014 | 22 |
| typescript | 25,544 | 7,957 | 31.15% | 44,954 | 9,710 | 19 |
| typescriptreact | 16,303 | 5,370 | 32.94% | 27,046 | 6,323 | 19 |
| markdown | 24,925 | 4,248 | 17.04% | 37,295 | 5,209 | 24 |
| javascript | 10,758 | 4,152 | 38.59% | 22,112 | 7,111 | 20 |
| ruby | 8,702 | 2,912 | 33.46% | 12,936 | 3,383 | 13 |
| go | 7,731 | 2,403 | 31.08% | 11,690 | 2,579 | 7 |
| rust | 9,526 | 2,395 | 25.14% | 49,682 | 4,170 | 4 |
| yaml | 8,918 | 2,324 | 26.06% | 17,046 | 3,722 | 19 |
| java | 6,086 | 2,221 | 36.49% | 21,360 | 4,890 | 11 |
| c# | 3,396 | 1,184 | 34.86% | 9,471 | 1,689 | 6 |
| vue | 2,726 | 847 | 31.07% | 10,161 | 1,384 | 2 |
| unknown | 4,726 | 758 | 16.04% | 8,716 | 871 | 13 |
| sql | 1,152 | 655 | 56.86% | 1,838 | 981 | 4 |
| shell | 2,089 | 617 | 29.54% | 3,428 | 789 | 9 |
| css | 2,711 | 584 | 21.54% | 5,927 | 790 | 7 |
| c++ | 2,554 | 546 | 21.38% | 6,961 | 948 | 5 |
| html | 1,519 | 441 | 29.03% | 3,333 | 693 | 7 |
| groovy | 2,559 | 412 | 16.10% | 5,252 | 797 | 4 |
| json | 1,921 | 327 | 17.02% | 5,307 | 760 | 11 |
| ql | 1,977 | 277 | 14.01% | 12,227 | 284 | 3 |
| scss | 1,116 | 267 | 23.92% | 2,075 | 328 | 5 |
| dockerfile | 554 | 246 | 44.40% | 735 | 278 | 4 |
| fsharp | 750 | 232 | 30.93% | 1,446 | 566 | 2 |
| hcl | 611 | 192 | 31.42% | 1,355 | 407 | 4 |
| lua | 548 | 138 | 25.18% | 1,552 | 142 | 2 |
| json with comments | 941 | 137 | 14.56% | 2,090 | 220 | 6 |
| postgres | 372 | 113 | 30.38% | 571 | 77 | 2 |
| toml | 484 | 103 | 21.28% | 1,415 | 117 | 2 |
| ini | 713 | 93 | 13.04% | 1,006 | 90 | 3 |
| blade | 200 | 91 | 45.50% | 563 | 197 | 2 |
| powershell | 274 | 90 | 32.85% | 634 | 156 | 3 |
| php | 236 | 81 | 34.32% | 492 | 133 | 3 |
| xml | 238 | 79 | 33.19% | 508 | 129 | 3 |
| razor | 152 | 67 | 44.08% | 636 | 194 | 2 |
| dotenv | 386 | 61 | 15.80% | 450 | 56 | 5 |
| makefile | 99 | 50 | 50.51% | 152 | 37 | 2 |
| text | 371 | 24 | 6.47% | 628 | 21 | 4 |
| kotlin | 57 | 19 | 33.33% | 101 | 16 | 2 |
| slang | 48 | 17 | 35.42% | 57 | 12 | 2 |
| abap | 35 | 16 | 45.71% | 125 | 48 | 2 |
| r | 48 | 14 | 29.17% | 55 | 16 | 2 |
| dart | 57 | 13 | 22.81% | 70 | 11 | 2 |
| json5 | 60 | 9 | 15.00% | 71 | 9 | 2 |
| swift | 36 | 5 | 13.89% | 41 | 4 | 2 |
| javascriptreact | 57 | 5 | 8.77% | 65 | 5 | 2 |
| kusto | 6 | 5 | 83.33% | 11 | 3 | 2 |
| elixir | 14 | 4 | 28.57% | 26 | 10 | 2 |
| aspdotnet | 18 | 3 | 16.67% | 70 | 4 | 2 |
| sshconfig | 4 | 3 | 75.00% | 28 | 0 | 2 |
| sky | 7 | 2 | 28.57% | 10 | 5 | 2 |
| coffeescript | 13 | 2 | 15.38% | 15 | 2 | 2 |
| properties | 1 | 1 | 100.00% | 1 | 1 | 2 |
| objective-cpp | 142 | 1 | 0.70% | 150 | 1 | 2 |
| cobol | 12 | 1 | 8.33% | 21 | 1 | 2 |
| bat | 12 | 1 | 8.33% | 13 | 1 | 2 |
| julia | 8 | 1 | 12.50% | 11 | 1 | 2 |
| env | 4 | 1 | 25.00% | 7 | 1 | 2 |
| svelte | 13 | 1 | 7.69% | 14 | 0 | 2 |
| ejs | 1 | 1 | 100.00% | 1 | 0 | 2 |
| c | 11 | 1 | 9.09% | 11 | 1 | 2 |
| csv | 2 | 0 | 0.00% | 2 | 0 | 1 |
| ignore list | 1 | 0 | 0.00% | 2 | 0 | 1 |
| html+erb | 4 | 0 | 0.00% | 4 | 0 | 1 |
| mermaid | 5 | 0 | 0.00% | 5 | 0 | 1 |
| perl | 16 | 0 | 0.00% | 22 | 0 | 1 |
| tex | 11 | 0 | 0.00% | 12 | 0 | 1 |
| zsh | 9 | 0 | 0.00% | 31 | 0 | 1 |
pie showData
title Editor Usage
"vscode" : 152382
"neovim" : 13163
"jetbrains" : 7943
"visual_studio" : 1150
"vim" : 714
| Editor | Suggestions | Acceptances | Acceptance Rate | Lines Suggested | Lines Accepted | Active Users |
|---|---|---|---|---|---|---|
| vscode | 152,382 | 45,238 | 29.69% | 260,404 | 61,046 | 24 |
| neovim | 13,163 | 3,590 | 27.27% | 68,025 | 5,888 | 2 |
| jetbrains | 7,943 | 2,637 | 33.20% | 27,494 | 4,479 | 4 |
| visual_studio | 1,150 | 400 | 34.78% | 2,257 | 881 | 2 |
| vim | 714 | 81 | 11.34% | 9,695 | 103 | 2 |
- Most Active Day: 8/27/2024 (101 active users)
- Highest Acceptance Rate: 8/25/2024 (35.76%)
| Day | Suggestions | Acceptances | Acceptance Rate | Lines Suggested | Lines Accepted | Active Users | Chat Acceptances | Chat Turns | Active Chat Users |
|---|---|---|---|---|---|---|---|---|---|
| 8/2/2024 | 7,664 | 2,205 | 28.77% | 16,456 | 2,902 | 72 | 199 | 1,202 | 79 |
| 8/3/2024 | 1,897 | 497 | 26.20% | 3,565 | 723 | 19 | 65 | 163 | 16 |
| 8/4/2024 | 4,274 | 1,156 | 27.05% | 12,065 | 1,549 | 22 | 146 | 421 | 18 |
| 8/5/2024 | 6,369 | 1,627 | 25.55% | 12,334 | 2,132 | 77 | 257 | 1,323 | 77 |
| 8/6/2024 | 6,851 | 2,036 | 29.72% | 16,668 | 2,728 | 93 | 273 | 1,454 | 92 |
| 8/7/2024 | 7,608 | 2,627 | 34.53% | 16,663 | 3,633 | 87 | 274 | 1,608 | 93 |
| 8/8/2024 | 7,556 | 2,445 | 32.36% | 13,927 | 3,538 | 99 | 327 | 1,915 | 98 |
| 8/9/2024 | 7,248 | 2,218 | 30.60% | 20,802 | 2,985 | 79 | 215 | 1,237 | 82 |
| 8/10/2024 | 3,128 | 851 | 27.21% | 10,670 | 1,312 | 32 | 67 | 290 | 24 |
| 8/11/2024 | 2,790 | 898 | 32.19% | 6,460 | 1,307 | 28 | 130 | 723 | 19 |
| 8/12/2024 | 6,893 | 1,963 | 28.48% | 14,693 | 2,703 | 80 | 327 | 1,748 | 86 |
| 8/13/2024 | 9,689 | 3,289 | 33.95% | 20,814 | 4,774 | 91 | 352 | 1,877 | 99 |
| 8/14/2024 | 7,045 | 2,076 | 29.47% | 13,420 | 3,107 | 90 | 266 | 1,702 | 95 |
| 8/15/2024 | 7,884 | 2,234 | 28.34% | 14,400 | 3,028 | 85 | 275 | 1,633 | 91 |
| 8/16/2024 | 8,421 | 2,540 | 30.16% | 15,873 | 3,782 | 86 | 249 | 1,272 | 85 |
| 8/17/2024 | 4,704 | 1,548 | 32.91% | 7,651 | 1,905 | 28 | 51 | 236 | 19 |
| 8/18/2024 | 2,310 | 529 | 22.90% | 4,313 | 714 | 21 | 39 | 354 | 19 |
| 8/19/2024 | 8,297 | 2,341 | 28.22% | 14,865 | 2,955 | 92 | 244 | 1,416 | 89 |
| 8/20/2024 | 7,656 | 2,087 | 27.26% | 13,660 | 2,835 | 97 | 341 | 1,853 | 92 |
| 8/21/2024 | 8,919 | 2,705 | 30.33% | 19,327 | 4,039 | 101 | 282 | 1,772 | 100 |
| 8/22/2024 | 8,922 | 2,408 | 26.99% | 16,067 | 3,474 | 94 | 238 | 1,592 | 98 |
| 8/23/2024 | 6,059 | 1,843 | 30.42% | 11,042 | 2,168 | 88 | 243 | 1,302 | 77 |
| 8/24/2024 | 2,004 | 427 | 21.31% | 3,773 | 626 | 31 | 71 | 350 | 18 |
| 8/25/2024 | 5,364 | 1,918 | 35.76% | 15,951 | 2,771 | 30 | 114 | 495 | 24 |
| 8/26/2024 | 9,229 | 2,497 | 27.06% | 19,269 | 3,237 | 82 | 251 | 1,557 | 82 |
| 8/27/2024 | 9,367 | 2,771 | 29.58% | 17,907 | 4,194 | 101 | 472 | 2,508 | 107 |
| 8/28/2024 | 7,204 | 2,210 | 30.68% | 15,240 | 3,276 | 98 | 313 | 1,885 | 99 |
- Seat Management Setting: assign_all
- Public Code Suggestions Enabled: allow
- IDE Chat Enabled: enabled
- Platform IDE Enabled: disabled
- Platform Chat Enabled: enabled
- CLI Enabled: enabled
- Total Seats: 827
- Added this cycle: 22
- Pending invites: 0
- Pending cancellations: 0
- Active this cycle: 568
- Inactive this cycle: 259
