Get Account usage and gross ledger cost
Changed onReturns 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, groupBy=conversations, 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 breakdown; granularity is valid only with groupBy=timeseries. groupBy=member includes every selected metric type and is not limited to Agent usage. With groupBy=project, breakdownBy=member adds a complete member breakdown and explicit unattributed-member metrics to every selected project. Pagination counts projects, and members are ordered by descending cost with userId as the tie-breaker. Requests without breakdownBy retain the existing response shape. Example: GET /v1/usage?groupBy=project&breakdownBy=member&limit=100 Breakdown responses are limited to 10,000 project/member/metric detail rows and 8 MiB of JSON. A result exceeding these bounds returns 422 usage_breakdown_too_large without partial data. Reduce limit, narrow the interval, or apply filters to retry. A cursor can be retried with a smaller limit; adding or removing breakdownBy invalidates the cursor. groupBy=conversations returns one environmentType=conversation group. attributableTotalCostUsd is conversation spend, and unattributableTotalCostUsd is all remaining spend for the selected filters.
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.
Request
- Base URLhttps://api.replit.com/v1
- AuthHTTP bearer
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 breakdown dimension. Omit for totals only. Member grouping includes every selected metric type and is not limited to Agent usage. Conversation grouping returns one group for usage attributed to conversations.
Adds a complete member breakdown to each project. Only valid with groupBy=project. Pagination still counts projects. Supply at most once.
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.
Changes
- warning
added the new
sandbox_computeenum value to the////////response property for the response status - warning
added the new
sandbox_computeenum value to the//////response property for the response status - warning
added the new
sandbox_computeenum value to the/////response property for the response status - warning
added the new
sandbox_computeenum value to the///response property for the response status - info
added the enum value
sandbox_computeto the propertyitems/of thequeryrequest parametertype
- warning
- warning
added the new
usage_breakdown_too_largeenum value to the/response property for the response status - warning
added the new
usage_breakdown_too_largeenum value to the/response property for the response status - warning
added the new
usage_breakdown_too_largeenum value to the/response property for the response status - warning
added the new
usage_breakdown_too_largeenum value to the/response property for the response status - warning
added the new
usage_breakdown_too_largeenum value to the/response property for the response status - warning
added the new
usage_breakdown_too_largeenum value to the/response property for the response status - warning
added the new
usage_breakdown_too_largeenum value to the/response property for the response status - info
added the new optional
queryrequest parameterbreakdownBy - info
added the non-success response with the status
- info
added the optional property
/to the response with the status - info
added the optional property
///to the response with the status
- warning