Revenue report
Totals for a period by revenue state: recognized (confirmed charges), pending (outcome charges inside their confirmation window), reversible (confirmed but still inside the reversal horizon), reversed, deferred (unused paid credits at cost basis) and breakage (paid credits that expired). Prepaid credits are valued at the cost basis of their grants. These are operating figures for your finance team; confirm accounting treatment with your adviser.
by_line_type splits recognized by the type of invoice line that billed it: usage, outcome, overage (units past a rate’s included_quantity) and minimum_commitment (the shortfall to a commitment, which is a floor and never a ceiling). All four are always listed, with 0 for a type that billed nothing. Send group_by to also get periods: the same figures for each day, week or month of the range, oldest first.
Authentication
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
Also return periods, one per day, week or month, in UTC (a week starts on Monday). Leave it out for the totals alone.
Response
recognized split by invoice line type. Always one entry for each of usage, outcome, overage and minimum_commitment. They add up to recognized.
The version of the rules that produced these figures. The same version means the same rules; a changed rule is a new version, so two reports can be compared when they carry the same one.
Present when the request sent group_by.
Present when the request sent group_by. The same figures for each bucket, oldest first.