Get Account usage and gross ledger cost
Returns usage-ledger consumption and gross cost from the same provider used by Replit's Usage settings page. Omit workspaceId, groupId, userId, and projectId for Account-wide totals. Filters are intersected when combined.
groupId requires workspaceId and filters usage to users who are active group members when the request is processed. Deleted or disabled memberships, deleted users, and support seats are excluded. An explicit userId is intersected with current group membership. Users can belong to multiple groups, so totals from separate group requests are not additive. Ungrouped and unattributed usage is excluded from group-filtered requests. groupId supports totals, groupBy=member, groupBy=project, and groupBy=timeseries; it cannot be combined with groupBy=workspace. The response does not repeat the group ID or expose group names or internal Account identifiers.
Example: GET /v1/usage?workspaceId=workspace123&groupId=groupEngineering&groupBy=member
Omit all range parameters for the current billing period. billingPeriod cannot be combined with startTime or endTime. Custom ranges require both startTime and endTime, use inclusive start and exclusive end boundaries, and cannot exceed 366 days. groupBy adds one paginated breakdown; granularity is valid only with groupBy=timeseries. groupBy=member includes every selected metric type and is not limited to Agent usage.
Recent usage can arrive after a response. Costs are gross usage-ledger values, not settled invoice totals. Account credits, discounts, and net charges are intentionally excluded.
Query parameters
Restrict results to a workspace owned by the authenticated Account.
Restrict usage to the current active members of one group in workspaceId. Group membership is evaluated when each request is processed.
Restrict results to usage attributed to a Replit user ID. Omit to include all users in the selected Account or workspace scope.
Restrict results to usage attributed to a Replit project ID.
Select the current or previous billing period. Defaults to current when no custom range is supplied. Cannot be combined with startTime or endTime.
Inclusive custom UTC interval boundary. Requires endTime.
Exclusive custom UTC interval boundary. Requires startTime.
Restrict totals, metrics, and groups to one or more cataloged public metric identifiers. Repeat the parameter to select multiple values.
Add one paginated breakdown dimension. Omit for totals only. Member grouping includes every selected metric type and is not limited to Agent usage.
Time bucket width for groupBy=timeseries. Day is the only Alpha value.
Maximum groups to return. Ignored when groupBy is omitted.
Opaque groups cursor from the previous response. Reusing it with different filters returns invalid_request.
Response
Usage summary.