Skip to navigation

Credits report

Paid credits over time: how many were sold, consumed and expired, and how many are outstanding at the end of each bucket, with the outstanding credits valued at the cost basis of their grants (outstanding_value). It covers paid credits, the ones with a cost basis. Promotional and included credits that expire are in the breakage report. Rows are per credit type, and credits of different types are never added together.

sold is the paid credits that became usable in the bucket, from checkout, auto top-up and paid grants. consumed is the paid credits drawn, less what reversals gave back. expired is the paid credits that expired unused. outstanding is what is left at the end of the bucket: unspent, unexpired and not voided.

outstanding_value is in one currency. Send currency, or leave it out when every paid grant in the range is in one. If they are in more than one, the call returns 400 with parameter_invalid on currency.

Authentication

AuthorizationBearer

A secret key (rl_sk_test_..., rl_sk_live_...) or a restricted key with limited scopes (rl_rk_test_..., rl_rk_live_...). A restricted key can carry agent: true and an expires_at, and is what a coding agent should hold. Keys end in a checksum so secret scanners can recognize them. People create, roll and revoke keys in the dashboard; GET /v1/api_keys lists them, masked.

Query parameters

fromdatetimeRequired
Start of the range, inclusive.
todatetimeRequired
End of the range, exclusive.
group_byenumOptionalDefaults to month

The bucket size, in UTC (a week starts on Monday). Default month.

Allowed values:
credit_typestringOptional

The credit type (ID or key). Without it, every credit type is reported.

currencystringOptional

Value the outstanding credits in this currency (lowercase ISO 4217). Needed when the paid grants are in more than one.

Response

The report.
object"credits_report"
currencystring
fromdatetime
todatetime
group_byenum
Allowed values:
datalist of objects
generated_atdatetime
livemodeboolean

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error