Skip to content

Get billing usage report for a user

GET
/users/{username}/settings/billing/usage

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.

API method documentation

username
required
string

The handle for the GitHub user account.

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.

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.

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.

Response when getting a billing usage report

Media type application/json
object
usageItems
Array<object>
object
date
required

Date of the usage line item.

string
product
required

Product name.

string
sku
required

SKU name.

string
quantity
required

Quantity of the usage line item.

integer
unitType
required

Unit type of the usage line item.

string
pricePerUnit
required

Price per unit of the usage line item.

number
grossAmount
required

Gross amount of the usage line item.

number
discountAmount
required

Discount amount of the usage line item.

number
netAmount
required

Net amount of the usage line item.

number
repositoryName

Name of the repository.

string
Examples
Example default
{
"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,
"repositoryName": "user/example"
}
]
}

Bad Request

Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Forbidden

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Internal Error

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Service unavailable

Media type application/json
object
code
string
message
string
documentation_url
string
Example generated
{
"code": "example",
"message": "example",
"documentation_url": "example"
}