Skip to main content
O controle de versão da API REST já foi feito. Para obter mais informações, confira "Sobre o controle de versão da API".

Enhanced billing platform

Use the REST API to get billing usage information from the enhanced billing platform.

Get billing usage report for an organization

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."

Tokens de acesso refinados para "Get billing usage report for an organization"

Esse ponto de extremidade funciona com os seguintes tipos de token refinados:

O token refinado deve ter os seguintes conjuntos de permissões:

  • "Administration" organization permissions (read)

Parâmetros para "Get billing usage report for an organization"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Parâmetros de consulta
Nome, Tipo, Descrição
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, 2024. Default value is the current year.

month integer

If specified, only return results for a single month. The value of month is an integer between 1 and 12.

day integer

If specified, only return results for a single day. The value of day is an integer between 1 and 31.

hour integer

If specified, only return results for a single hour. The value of hour is an integer between 0 and 23.

Códigos de status de resposta HTTP para "Get billing usage report for an organization"

Código de statusDescrição
200

Billing usage report response for an organization

400

Bad Request

403

Forbidden

500

Internal Error

503

Service unavailable

Exemplos de código para "Get billing usage report for an organization"

Exemplo de solicitação

get/organizations/{org}/settings/billing/usage
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/organizations/ORG/settings/billing/usage

Billing usage report response for an organization

Status: 200
{ "usageItems": [ { "date": "2023-08-01", "product": "Actions", "sku": "Actions Linux", "quantity": 100, "unitType": "minutes", "pricePerUnit": 0.008, "grossAmount": 0.8, "discountAmount": 0, "netAmount": 0.8, "organizationName": "GitHub", "repositoryName": "github/example" } ] }