org_usage
Creates, updates, deletes, gets or lists an org_usage resource.
Overview
| Name | org_usage |
| Type | Resource |
| Id | github.billing.org_usage |
Fields
The following fields are returned by SELECT queries:
- get_github_billing_usage_report_org
Billing usage report response for an organization
| 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. |
organizationName | string | Name of the organization. |
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_org | select | org | year, month, day | Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. Note: This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "About 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 |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
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_org
Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.
Note: This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "About the enhanced billing platform."
SELECT
date,
discountAmount,
grossAmount,
netAmount,
organizationName,
pricePerUnit,
product,
quantity,
repositoryName,
sku,
unitType
FROM github.billing.org_usage
WHERE org = '{{ org }}' -- required
AND year = '{{ year }}'
AND month = '{{ month }}'
AND day = '{{ day }}'
;