Get Agency Client Usage
GET /agency/clients/{org_id}/usage
Credits one client used between from and to (UTC days, inclusive, at most 92 days), per day and per product.
Read from the credit ledger the app’s usage page reads (the client’s OWN ledger). rows gives each (day, product)
with paid_by: client for the client’s own ledger and agency for usage the agency’s balance paid (agency-pays
billing), taken from a structured table that only the credit server writes, never from message text.
has_credit_account is false when the client has none yet. 400 for a reversed or over-long range; 504 when the read is slow (retry).
Authorizations
Parameters
Path Parameters
Client org id (org_xxx) from GET /agency/clients.
Client org id (org_xxx) from GET /agency/clients.
Query Parameters
Header Parameters
Responses
200
Successful Response
object
object
object
UTC day, YYYY-MM-DD.
object
Customer-facing product label (the same labels the app’s usage page shows).
False when the client has no credit account yet (not the same as no usage).
object
First UTC day, inclusive.
Last UTC day, inclusive.
Detail per (day, product, payer). Days and products with no usage are absent.
object
UTC day, YYYY-MM-DD.
Whose ledger the charge landed on: the client’s own, or the agency’s (agency-pays), tagged for this client.
object
Whether there are more pages
Items per page
Current page number (1-indexed)
Total number of items
422
Validation Error