Created
October 9, 2025 10:05
-
-
Save myinusa/fbb97800e08f771e7349c4a72ccbc9d1 to your computer and use it in GitHub Desktop.
Copilot Premium Request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| limit=1500 | |
| USER=$(gh api user -q .login) | |
| response=$(gh api -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| "/users/$USER/settings/billing/premium_request/usage?year=$(date +%Y)&month=$(date +%-m)") | |
| used=$(jq '[.usageItems[] | select(.sku=="Copilot Premium Request") | .grossQuantity] | add' <<< "$response") | |
| pct=$(awk "BEGIN {printf \"%.2f\", ($used/$limit)*100}") | |
| echo "Copilot Premium Requests: $used / $limit used ($pct%)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment