Skip to content

GitHub: Billing schemas

15 GitHub schemas with complete fields and constraints.

← Billing operations · All schemas

Create a budget for an organization — response body

FieldTypePresenceDescription and constraints
$objectRoot
budgetobjectRequired within parent
budget.budget_alertingobjectOptional
budget.budget_alerting.alert_recipientsarrayOptionalArray of user login names who will receive alerts. Rejected for user-scope as alerting is always disabled for them.
budget.budget_alerting.alert_recipients[]stringEach item
budget.budget_alerting.will_alertbooleanOptionalWhether alerts are enabled for this budget. Rejected for user-scope as alerting is always disabled for them.
budget.budget_amountJSONOptional
budget.budget_amount (anyOf 1)integerAlternativeThe budget amount in whole dollars. For license-based products, this represents the number of licenses.
Minimum: 0
budget.budget_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
budget.budget_entity_namestringOptionalThe name of the entity to apply the budget to
budget.budget_product_skustringOptionalA single product or sku to apply the budget to.
budget.budget_scopestringOptionalThe type of scope for the budget
Known values: enterprise, organization, repository, cost_center, multi_user_customer, multi_user_cost_center, user
budget.budget_typeJSONOptionalThe type of pricing for the budget
budget.budget_type (anyOf 1)stringAlternativeKnown values: ProductPricing
budget.budget_type (anyOf 2)stringAlternativeKnown values: SkuPricing
budget.expires_atstringOptionalThe date the budget will expire in `YYYY-MM-DD` format. Only dates in the future are accepted.
If not provided, the budget will not expire.

Only supported for budgets with `budget_scope` of `user`
Format: date
budget.idstringOptionalID of the budget.
budget.prevent_further_usagebooleanOptionalWhether to prevent additional spending once the budget is exceeded
messagestringRequired within parentA message indicating the result of the create operation

Delete a budget for an organization — response body

FieldTypePresenceDescription and constraints
$objectRoot
idstringRequired within parentThe ID of the deleted budget
messagestringRequired within parentA message indicating the result of the deletion operation

Get a budget by ID for an organization — response body

FieldTypePresenceDescription and constraints
$objectRoot
budget_alertingobjectRequired within parent
budget_alerting.alert_recipientsarrayOptionalArray of user login names who will receive alerts. Present but not applicable for user-scope as alerting is always disabled for them.
budget_alerting.alert_recipients[]stringEach item
budget_alerting.will_alertbooleanOptionalWhether alerts are enabled for this budget. Present but not applicable for user-scope as alerting is always disabled for them.
budget_amountJSONRequired within parent
budget_amount (anyOf 1)integerAlternativeThe budget amount in whole dollars. For license-based products, this represents the number of licenses.
budget_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
budget_entity_namestringRequired within parentThe name of the entity to apply the budget to
budget_product_skustringRequired within parentA single product or sku to apply the budget to.
budget_scopestringRequired within parentThe type of scope for the budget
Known values: enterprise, organization, repository, cost_center, multi_user_customer, multi_user_cost_center, user
budget_typeJSONRequired within parentThe type of pricing for the budget
budget_type (anyOf 1)stringAlternativeKnown values: ProductPricing
budget_type (anyOf 2)stringAlternativeKnown values: SkuPricing
consumed_amountJSONOptional
consumed_amount (anyOf 1)numberAlternativeThe current usage amount counted toward the budget. How usage is calculated may vary by budget type.
consumed_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idstringRequired within parentID of the budget.
prevent_further_usagebooleanRequired within parentWhether to prevent additional spending once the budget is exceeded
userstringOptionalThe user login when the budget is scoped to a single user (`user` scope).

Get all budgets for an organization — response body

FieldTypePresenceDescription and constraints
$objectRoot
budgetsarrayRequired within parentArray of budget objects for the enterprise
budgets[]ModelEach itemExpand Get all budgets for an organization — response body — budgets item
effective_budgetobjectOptionalEffective user-level budget details returned when the response is scoped with the `user` query parameter.
effective_budget.budget_amountJSONRequired within parent
effective_budget.budget_amount (anyOf 1)integerAlternativeThe budget amount for the effective budget.
effective_budget.budget_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
effective_budget.consumed_amountJSONRequired within parent
effective_budget.consumed_amount (anyOf 1)numberAlternativeThe consumed amount for the specified user within the effective budget.
effective_budget.consumed_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
effective_budget.idstringRequired within parentThe unique identifier of the effective budget.
has_next_pagebooleanOptionalIndicates if there are more pages of results available
total_countJSONOptional
total_count (anyOf 1)integerAlternativeTotal number of budgets matching the query
total_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
userstringOptionalUser login included when the response is scoped with the `user` query parameter.

Referenced models: Get all budgets for an organization — response body — budgets item

Get all budgets for an organization — response body — budgets item

FieldTypePresenceDescription and constraints
$objectRoot
budget_alertingobjectRequired within parent
budget_alerting.alert_recipientsarrayRequired within parentArray of user login names who will receive alerts. Ignored for user-scope as alerting is disabled for them.
budget_alerting.alert_recipients[]stringEach item
budget_alerting.will_alertbooleanRequired within parentWhether alerts are enabled for this budget. Ignored for user-scope as alerting is disabled for them.
budget_amountJSONRequired within parent
budget_amount (anyOf 1)integerAlternativeThe budget amount limit in whole dollars. For license-based products, this represents the number of licenses.
budget_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
budget_entity_namestringOptionalThe name of the entity for the budget (enterprise does not require a name).
budget_product_skustringRequired within parentA single product or sku to apply the budget to.
budget_scopestringRequired within parentThe scope of the budget
Known values: enterprise, organization, repository, cost_center, multi_user_customer, multi_user_cost_center, user
budget_typeJSONRequired within parentThe type of pricing for the budget
budget_type (anyOf 1)stringAlternativeKnown values: SkuPricing
budget_type (anyOf 2)stringAlternativeKnown values: ProductPricing
consumed_amountJSONOptional
consumed_amount (anyOf 1)numberAlternativeThe amount consumed for a user-scoped budget, or for a multi-user budget when filtering by user.
consumed_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
expires_atstringOptionalThe date the budget will expire in `YYYY-MM-DD` format. Only dates in the future are accepted.
If not provided, the budget will not expire.

Only supported for budgets with `budget_scope` of `user`
Format: date
idstringRequired within parentThe unique identifier for the budget
prevent_further_usagebooleanRequired within parentThe type of limit enforcement for the budget
userstringOptionalThe user login when the budget is scoped to a single user (`user` scope).

Get billing AI credit usage report for a user — response body

FieldTypePresenceDescription and constraints
$objectRoot
modelstringOptionalThe model for the usage report.
productstringOptionalThe product for the usage report.
timePeriodModelRequired within parentExpand Get billing usage summary for a user — response body — time Period
usageItemsarrayRequired within parent
usageItems[]ModelEach itemExpand Get billing AI credit usage report for a user — response body — usage Items item
userstringRequired within parentThe unique identifier of the user.

Referenced models: Get billing usage summary for a user — response body — time Period, Get billing AI credit usage report for a user — response body — usage Items item

Get billing AI credit usage report for a user — response body — usage Items item

FieldTypePresenceDescription and constraints
$objectRoot
discountAmountJSONRequired within parent
discountAmount (anyOf 1)numberAlternativeDiscount amount of the usage line item.
discountAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
discountQuantityJSONRequired within parent
discountQuantity (anyOf 1)numberAlternativeDiscount quantity of the usage line item.
discountQuantity (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
grossAmountJSONRequired within parent
grossAmount (anyOf 1)numberAlternativeGross amount of the usage line item.
grossAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
grossQuantityJSONRequired within parent
grossQuantity (anyOf 1)numberAlternativeGross quantity of the usage line item.
grossQuantity (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
modelstringRequired within parentModel name.
netAmountJSONRequired within parent
netAmount (anyOf 1)numberAlternativeNet amount of the usage line item.
netAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
netQuantityJSONRequired within parent
netQuantity (anyOf 1)numberAlternativeNet quantity of the usage line item.
netQuantity (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pricePerUnitJSONRequired within parent
pricePerUnit (anyOf 1)numberAlternativePrice per unit of the usage line item.
pricePerUnit (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
productstringRequired within parentProduct name.
skustringRequired within parentSKU name.
unitTypestringRequired within parentUnit type of the usage line item.

Get billing AI credit usage report for an organization — response body

FieldTypePresenceDescription and constraints
$objectRoot
modelstringOptionalThe model for the usage report.
organizationstringRequired within parentThe unique identifier of the organization.
productstringOptionalThe product for the usage report.
timePeriodModelRequired within parentExpand Get billing usage summary for a user — response body — time Period
usageItemsarrayRequired within parent
usageItems[]ModelEach itemExpand Get billing AI credit usage report for a user — response body — usage Items item
userstringOptionalThe name of the user for the usage report.

Referenced models: Get billing usage summary for a user — response body — time Period, Get billing AI credit usage report for a user — response body — usage Items item

Get billing usage report for a user — response body

FieldTypePresenceDescription and constraints
$objectRoot
usageItemsarrayOptional
usageItems[]objectEach item
usageItems[].datestringRequired within parentDate of the usage line item.
usageItems[].discountAmountJSONRequired within parent
usageItems[].discountAmount (anyOf 1)numberAlternativeDiscount amount of the usage line item.
usageItems[].discountAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].grossAmountJSONRequired within parent
usageItems[].grossAmount (anyOf 1)numberAlternativeGross amount of the usage line item.
usageItems[].grossAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].netAmountJSONRequired within parent
usageItems[].netAmount (anyOf 1)numberAlternativeNet amount of the usage line item.
usageItems[].netAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].pricePerUnitJSONRequired within parent
usageItems[].pricePerUnit (anyOf 1)numberAlternativePrice per unit of the usage line item.
usageItems[].pricePerUnit (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].productstringRequired within parentProduct name.
usageItems[].quantityJSONRequired within parent
usageItems[].quantity (anyOf 1)integerAlternativeQuantity of the usage line item.
usageItems[].quantity (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].repositoryNamestringOptionalName of the repository.
usageItems[].skustringRequired within parentSKU name.
usageItems[].unitTypestringRequired within parentUnit type of the usage line item.

Get billing usage report for an organization — response body

FieldTypePresenceDescription and constraints
$objectRoot
usageItemsarrayOptional
usageItems[]objectEach item
usageItems[].datestringRequired within parentDate of the usage line item.
usageItems[].discountAmountJSONRequired within parent
usageItems[].discountAmount (anyOf 1)numberAlternativeDiscount amount of the usage line item.
usageItems[].discountAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].grossAmountJSONRequired within parent
usageItems[].grossAmount (anyOf 1)numberAlternativeGross amount of the usage line item.
usageItems[].grossAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].netAmountJSONRequired within parent
usageItems[].netAmount (anyOf 1)numberAlternativeNet amount of the usage line item.
usageItems[].netAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].organizationNamestringRequired within parentName of the organization.
usageItems[].pricePerUnitJSONRequired within parent
usageItems[].pricePerUnit (anyOf 1)numberAlternativePrice per unit of the usage line item.
usageItems[].pricePerUnit (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].productstringRequired within parentProduct name.
usageItems[].quantityJSONRequired within parent
usageItems[].quantity (anyOf 1)integerAlternativeQuantity of the usage line item.
usageItems[].quantity (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
usageItems[].repositoryNamestringOptionalName of the repository.
usageItems[].skustringRequired within parentSKU name.
usageItems[].unitTypestringRequired within parentUnit type of the usage line item.

Get billing usage summary for a user — response body

FieldTypePresenceDescription and constraints
$objectRoot
productstringOptionalThe product for the usage report.
repositorystringOptionalThe name of the repository for the usage report.
skustringOptionalThe SKU for the usage report.
timePeriodModelRequired within parentExpand Get billing usage summary for a user — response body — time Period
usageItemsarrayRequired within parent
usageItems[]ModelEach itemExpand Get billing usage summary for a user — response body — usage Items item
userstringRequired within parentThe unique identifier of the user.

Referenced models: Get billing usage summary for a user — response body — time Period, Get billing usage summary for a user — response body — usage Items item

Get billing usage summary for a user — response body — time Period

FieldTypePresenceDescription and constraints
$objectRoot
dayJSONOptional
day (anyOf 1)integerAlternativeThe day for the usage report.
day (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
monthJSONOptional
month (anyOf 1)integerAlternativeThe month for the usage report.
month (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
yearJSONRequired within parent
year (anyOf 1)integerAlternativeThe year for the usage report.
year (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Get billing usage summary for a user — response body — usage Items item

FieldTypePresenceDescription and constraints
$objectRoot
discountAmountJSONRequired within parent
discountAmount (anyOf 1)numberAlternativeDiscount amount of the usage line item.
discountAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
discountQuantityJSONRequired within parent
discountQuantity (anyOf 1)numberAlternativeDiscount quantity of the usage line item.
discountQuantity (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
grossAmountJSONRequired within parent
grossAmount (anyOf 1)numberAlternativeGross amount of the usage line item.
grossAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
grossQuantityJSONRequired within parent
grossQuantity (anyOf 1)numberAlternativeGross quantity of the usage line item.
grossQuantity (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
netAmountJSONRequired within parent
netAmount (anyOf 1)numberAlternativeNet amount of the usage line item.
netAmount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
netQuantityJSONRequired within parent
netQuantity (anyOf 1)numberAlternativeNet quantity of the usage line item.
netQuantity (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pricePerUnitJSONRequired within parent
pricePerUnit (anyOf 1)numberAlternativePrice per unit of the usage line item.
pricePerUnit (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
productstringRequired within parentProduct name.
skustringRequired within parentSKU name.
unitTypestringRequired within parentUnit type of the usage line item.

Get billing usage summary for an organization — response body

FieldTypePresenceDescription and constraints
$objectRoot
organizationstringRequired within parentThe unique identifier of the organization.
productstringOptionalThe product for the usage report.
repositorystringOptionalThe name of the repository for the usage report.
skustringOptionalThe SKU for the usage report.
timePeriodModelRequired within parentExpand Get billing usage summary for a user — response body — time Period
usageItemsarrayRequired within parent
usageItems[]ModelEach itemExpand Get billing usage summary for a user — response body — usage Items item

Referenced models: Get billing usage summary for a user — response body — time Period, Get billing usage summary for a user — response body — usage Items item

Update a budget for an organization — response body

FieldTypePresenceDescription and constraints
$objectRoot
budgetobjectRequired within parent
budget.budget_alertingobjectOptional
budget.budget_alerting.alert_recipientsarrayOptionalArray of user login names who will receive alerts. Ignored for user-scope as alerting is always disabled for them.
budget.budget_alerting.alert_recipients[]stringEach item
budget.budget_alerting.will_alertbooleanOptionalWhether alerts are enabled for this budget. Ignored for user-scope as alerting is always disabled for them.
budget.budget_amountJSONOptional
budget.budget_amount (anyOf 1)integerAlternativeThe budget amount in whole dollars. For license-based products, this represents the number of licenses.
Minimum: 0
budget.budget_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
budget.budget_entity_namestringOptionalThe name of the entity to apply the budget to
budget.budget_product_skustringOptionalA single product or sku to apply the budget to.
budget.budget_scopestringOptionalThe type of scope for the budget
Known values: enterprise, organization, repository, cost_center, multi_user_customer, multi_user_cost_center, user
budget.budget_typeJSONOptionalThe type of pricing for the budget
budget.budget_type (anyOf 1)stringAlternativeKnown values: ProductPricing
budget.budget_type (anyOf 2)stringAlternativeKnown values: SkuPricing
budget.consumed_amountJSONOptional
budget.consumed_amount (anyOf 1)numberAlternativeThe consumed amount for the specified user within the budget. Only included for `user`-scoped budgets.
budget.consumed_amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
budget.expires_atstringOptionalThe date the budget will expire in `YYYY-MM-DD` format. Only dates in the future are accepted.
If not provided, the budget will not expire.

Only supported for budgets with `budget_scope` of `user`
Format: date
budget.idstringOptionalID of the budget.
budget.prevent_further_usagebooleanOptionalWhether to prevent additional spending once the budget is exceeded
budget.userstringOptionalThe user login when the budget is scoped to a single user (`user` scope).
messagestringRequired within parentA message indicating the result of the update operation

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.