Billing

Get group usage breakdown by member

GET
/billing/usage/{group_name}

Returns credit usage for a group with per-member breakdown. Only accessible to group owners and admins.

Authorization

token_auth
headerAuthorizationBearer <token>

Token-based authentication using access tokens.

Path Parameters

group_name*string

Query Parameters

start_date?|

Start of period (ISO 8601 UTC). Defaults to first day of current month.

Defaultnull
end_date?|

End of period (ISO 8601 UTC, exclusive). Defaults to now.

Defaultnull
resolution?Resolution

Time resolution for credit aggregation.

Default"day"
Value in"day""week""month"
breakdown?Breakdown

Controls the summary breakdown axis. 'job_type' (default) buckets by job type, 'user' buckets by group member.

Default"job_type"
Value in"job_type""user"

Response Body

Successful Response

application/json
  1. response
group_name*Group Name

Name of the group.

member_count*Member Count

Number of members in the group.

period_start*Period Start

Start of the queried period (ISO 8601 UTC).

period_end*Period End

End of the queried period (ISO 8601 UTC).

total_credits*Total Credits

Total credits used by all group members in the period.

summary*array<>

Time-bucketed breakdown of credits used by job type.

summary_by_user?array<>|

Time-bucketed breakdown of credits used by member. Only present when breakdown=user.

Defaultnull
members*array<>

Per-member credit usage totals, sorted by highest usage.

curl -X GET "https://example.com/billing/usage/string"
{  "group_name": "string",  "member_count": 0,  "period_start": "string",  "period_end": "string",  "total_credits": 0,  "summary": [    {      "period_start": "string",      "period_end": "string",      "job_type": "string",      "total_credits": 0,      "job_count": 0,      "image_count": 0    }  ],  "summary_by_user": null,  "members": [    {      "user_id": 0,      "email": "string",      "username": "string",      "total_credits": 0,      "job_count": 0,      "image_count": 0    }  ]}