Get Credit Usage
GET /api/v1/admin/credit-usage
GET
/api/v1/admin/credit-usage
Per-tool credit usage breakdown for the trailing window.
Args: window_hours: How many trailing hours to aggregate. tenant_id: Optional tenant filter. user: Caller context. Must be a chairman. session: Async DB session.
Returns:
:class:CreditUsagePayload with one row per tool_name.
Authorizations
Parameters
Query Parameters
Responses
200
Successful Response
Frozen response shape for /admin/credit-usage.
object
generated_at
required
string
grand_total_credits
required
integer
grand_total_invocations
required
integer
rows
required
Array<object>
One row of the per-tool credit breakdown.
object
canonical_cost
required
Documented per-call cost from src.core.agent_tools.credit_costs. Zero when the tool is not in the canonical table (legacy / dynamically-priced).
integer
credits_consumed
required
integer
error_count
required
integer
invocation_count
required
integer
success_count
required
integer
tool_name
required
string
window_hours
required
integer
422
Validation Error
object
detail
Array<object>
object
ctx
object
input
loc
required
Array
msg
required
string
type
required
string