Skip to main content
Returns agent credit usage records for the requested interval, newest first. Records cover the whole workspace. Nominal costs are not invoice amounts; use List billing meter summaries for priced usage. Requires workspace Read. API keys can read only their bound workspace. Excluded/deleted repositories and unattributed usage remain included. Unmetered records can also appear; do not sum these nominal costs to reproduce an invoice.

Authorization

string
required
Bearer <key>. See Authentication.

Path parameters

string
required
GITHUB_ORGANIZATION or GITHUB_USER.
string
required
Numeric GitHub ID of the organization or user.

Query parameters

string
required
Inclusive start of the interval (RFC 3339). The interval is half-open, [startTime, endTime), and at most 366 days.
string
required
Exclusive end of the interval (RFC 3339). Must be after startTime.
string
Filter to one source. Omit for all sources. One of BILLING_USAGE_SOURCE_QUERY_AGENT, BILLING_USAGE_SOURCE_WEBHOOK, BILLING_USAGE_SOURCE_SCHEDULED_MACRO, BILLING_USAGE_SOURCE_MACRO, BILLING_USAGE_SOURCE_CLI_REVIEW, BILLING_USAGE_SOURCE_CHECK_RUN, BILLING_USAGE_SOURCE_PR_ASSISTANT, BILLING_USAGE_SOURCE_APPROVABILITY, BILLING_USAGE_SOURCE_GITHUB_ACTIONS.
integer
default:"50"
Records per page, 1 to 200.
string
nextPageToken from the previous response. Keep all other parameters unchanged except pageSize. Tokens expire after 24 hours; on a 400, restart without a token.

Response

object[]
Usage records on this page. Attribution fields are omitted when unknown.
string
Token for the next page. Omitted on the last page.
string
When the response was generated (RFC 3339). Not a data freshness timestamp.

Money

Summing rounded nominalCost values can differ from the rounded total.
string
Decimal amount in major units, e.g. "0.13".
string
ISO 4217 code, e.g. "USD".