Skip to main content

org_usage

Creates, updates, deletes, gets or lists an org_usage resource.

Overview

Nameorg_usage
TypeResource
Idgithub.billing.org_usage

Fields

The following fields are returned by SELECT queries:

Billing usage report response for an organization

NameDatatypeDescription
datestringDate of the usage line item.
discountAmountnumberDiscount amount of the usage line item.
grossAmountnumberGross amount of the usage line item.
netAmountnumberNet amount of the usage line item.
organizationNamestringName of the organization.
pricePerUnitnumberPrice per unit of the usage line item.
productstringProduct name.
quantityintegerQuantity of the usage line item.
repositoryNamestringName of the repository.
skustringSKU name.
unitTypestringUnit type of the usage line item.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_github_billing_usage_report_orgselectorgyear, month, dayGets 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.

NameDatatypeDescription
orgstringThe organization name. The name is not case sensitive.
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.
monthintegerIf 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.
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 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 }}'
;