usage
Creates, updates, deletes, gets or lists a usage resource.
Overview
| Name | usage |
| Type | Resource |
| Id | github.billing.usage |
Fields
The following fields are returned by SELECT queries:
- get_github_billing_usage_report_user
Response when getting a billing usage report
| Name | Datatype | Description |
|---|---|---|
date | string | Date of the usage line item. |
discountAmount | number | Discount amount of the usage line item. |
grossAmount | number | Gross amount of the usage line item. |
netAmount | number | Net amount of the usage line item. |
pricePerUnit | number | Price per unit of the usage line item. |
product | string | Product name. |
quantity | integer | Quantity of the usage line item. |
repositoryName | string | Name of the repository. |
sku | string | SKU name. |
unitType | string | Unit type of the usage line item. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_github_billing_usage_report_user | select | username | year, month, day | Gets a report of the total usage for a user. Note: This endpoint is only available to users with access to the enhanced billing platform. |
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.
| Name | Datatype | Description |
|---|---|---|
username | string | The handle for the GitHub user account. |
day | integer | If 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. |
month | integer | If specified, only return results for a single month. The value of month is an integer between 1 and 12. If no year is specified the default year is used. |
year | integer | If 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
- get_github_billing_usage_report_user
Gets a report of the total usage for a user.
Note: This endpoint is only available to users with access to the enhanced billing platform.
SELECT
date,
discountAmount,
grossAmount,
netAmount,
pricePerUnit,
product,
quantity,
repositoryName,
sku,
unitType
FROM github.billing.usage
WHERE username = '{{ username }}' -- required
AND year = '{{ year }}'
AND month = '{{ month }}'
AND day = '{{ day }}'
;