Skip to main content

premium_request_usage

Creates, updates, deletes, gets or lists a premium_request_usage resource.

Overview

Namepremium_request_usage
TypeResource
Idgithub.billing.premium_request_usage

Fields

The following fields are returned by SELECT queries:

Response when getting a billing premium request usage report

NameDatatypeDescription
modelstringThe model for the usage report.
productstringThe product for the usage report.
timePeriodobject
usageItemsarray
userstringThe unique identifier of the user.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_github_billing_premium_request_usage_report_userselectusernameyear, month, day, model, productGets a report of premium request usage for a user.

Note: Only data from the past 24 months is accessible via this endpoint.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
usernamestringThe handle for the GitHub user account.
dayintegerIf specified, only return results for a single day. The value of day is an integer between 1 and 31. If no year or month is specified, the default year and month are used.
modelstringThe model name to query usage for. The name is not case sensitive.
monthintegerIf specified, only return results for a single month. The value of month is an integer between 1 and 12. Default value is the current month. If no year is specified the default year is used.
productstringThe product name to query usage for. The name is not case sensitive.
yearintegerIf specified, only return results for a single year. The value of year is an integer with four digits representing a year. For example, 2025. Default value is the current year.

SELECT examples

Gets a report of premium request usage for a user.

Note: Only data from the past 24 months is accessible via this endpoint.

SELECT
model,
product,
timePeriod,
usageItems,
user
FROM github.billing.premium_request_usage
WHERE username = '{{ username }}' -- required
AND year = '{{ year }}'
AND month = '{{ month }}'
AND day = '{{ day }}'
AND model = '{{ model }}'
AND product = '{{ product }}'
;