Skip to content

Platform usage and revenue over a period (admin only).

GET
/api/admin/usage
curl --request GET \
--url https://api.tradr.cloud/api/admin/usage

Admin-gated (403 ADMIN_REQUIRED). from/to are optional ISO 8601 datetimes; the default window is the trailing 30 days ending now. from > to and ranges over 366 days are a 400 VALIDATION_ERROR. Returns period, totals (token/credit integer strings; providerCost is null when zero covered rows — pre-0013 rows have no recorded raw cost, see providerCostCoverage), the UTC-day series, topUsers (max 50 by billed credits), and the reversal-attributed revenue { credited, reversed, net }. Empty/future ranges return well-formed zeros (REQ-4.6).

from
string format: date-time
to
string format: date-time

AdminUsage — period

VALIDATION_ERROR — malformed datetimes

Not authenticated.

ADMIN_REQUIRED — authenticated but not an admin.

Admin rate limit reached (60 / 60 s per user).