Skip to content

Get billing AI credit usage report for an organization

GET
/organizations/{org}/settings/billing/ai_credit/usage

Gets a report of AI credit usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.

Note: Only data from the past 24 months is accessible via this endpoint.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

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. Default value is the current month. 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.

user
string

The user name to query usage for. The name is not case sensitive.

model
string

The model name to query usage for. The name is not case sensitive.

product
string

The product name to query usage for. The name is not case sensitive.

Response when getting a billing AI credit usage report

Media type application/json
object
timePeriod
required
object
year
required

The year for the usage report.

integer
month

The month for the usage report.

integer
day

The day for the usage report.

integer
organization
required

The unique identifier of the organization.

string
user

The name of the user for the usage report.

string
product

The product for the usage report.

string
model

The model for the usage report.

string
usageItems
required
Array<object>
object
product
required

Product name.

string
sku
required

SKU name.

string
model
required

Model name.

string
unitType
required

Unit type of the usage line item.

string
pricePerUnit
required

Price per unit of the usage line item.

number
grossQuantity
required

Gross quantity of the usage line item.

number
grossAmount
required

Gross amount of the usage line item.

number
discountQuantity
required

Discount quantity of the usage line item.

number
discountAmount
required

Discount amount of the usage line item.

number
netQuantity
required

Net quantity of the usage line item.

number
netAmount
required

Net amount of the usage line item.

number
Examples
Example default
{
"timePeriod": {
"year": 2025
},
"organization": "GitHub",
"usageItems": [
{
"product": "Copilot",
"sku": "Copilot AI Credits",
"model": "GPT-5",
"unitType": "credits",
"pricePerUnit": 0.01,
"grossQuantity": 100,
"grossAmount": 1,
"discountQuantity": 0,
"discountAmount": 0,
"netQuantity": 100,
"netAmount": 1
}
]
}

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

Resource not found

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