Retrieve Resource Usage Costs
Access comprehensive usage history and cost analytics for all resources, including detailed billing metrics, resource specifications, and temporal utilization data.
HTTP Request
GET {API_URL}billing/resources/usage
Query Parameters
| Parameter | Requirement | Type | Description |
|---|---|---|---|
limit | Optional | int | Maximum number of records to return |
offset | Optional | int | Number of records to skip for pagination |
sortField | Optional | string | Field identifier for result ordering |
sortOrder | Optional | string | Sort direction: desc (descending) or asc (ascending) |
filters | Optional | string | JSON-encoded filter criteria. Format: [{"key":"name","op":"contains","val":"hub"}] |
Response Structure
status boolean
Operation result indicator. Returns true for successful execution, false when encountering an error.
message string
Descriptive response indicating the outcome of the usage data retrieval.
total int
Aggregate count of available records.
data object
Collection of resource utilization records containing detailed cost metrics.
Resource Attributes
resourceResource specification detailsidUnique resource identifiernameResource designationdisplay_nameUser-friendly resource identifiertypeResource classification (vmfor virtual machine,volumefor storage)
per_minute_feeCurrent billing rate (per minute)total_uptimeCumulative resource utilization (minutes)total_feeAggregate resource costterminated_timeResource deactivation timestampcreated_timeResource initialization timestampstatusCurrent resource state (terminatedoractive)
Implementation Example
Request
bash
curl -X GET '{API_URL}billing/resources/usage' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'refresh-token: {REFRESH_TOKEN}' \
-H 'Content-Type: application/json'Response
json
{
"status": true,
"message": "Resource usage data retrieved successfully",
"data": [
{
"id": "66cfe5c06c4817f2124c3998",
"resource": {
"id": "66cfe67bbee435f7706bcf4d",
"name": "medical-breakable-pipe",
"display_name": "TestxA4000",
"type": "vm"
},
"created_time": 1724945437,
"status": "terminated",
"terminated_time": 1724982385,
"total_uptime": 616,
"total_fee": 3.148992,
"per_minute_fee": 0.005112
}
],
"total": 1
}
