Skip to main content

Retrieve Previous Day Usage Costs

GET https://infrahub-api.nexgencloud.com/v1/billing/billing/last-day-cost

Retrieves data for usage costs incurred during the previous day for each resource type and provides the total cost accumulated during that period. This API specifically returns usage cost information for virtual machines, volumes, and clusters.


Parameters


No parameters.


Attributes


message string

A message describing the status of the request to retrieve usage cost details from the previous day.


status boolean

Indicates the status of the request to retrieve usage cost details from the previous day.


data object

An object containing information about the usage costs from the previous day for each type of resource (virtual machines, volumes, and clusters), as well as the total cost for all resources combined.

Show child attributes
instances_cost number

The combined usage cost in dollars from the previous day for all of your virtual machine resources.


volumes_cost number

The combined usage cost in dollars from the previous day for all of your volume resources.


clusters_cost number

The combined usage cost in dollars from the previous day for all of your cluster resources.


total_cost number

The combined usage cost in dollars from the previous day for all of your resources.


Example request
curl -X GET "https://infrahub-api.nexgencloud.com/v1/billing/billing/last-day-cost" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
Response
{
"message": "Successful",
"status": true,
"data": {
"instances_cost": 0.0,
"volumes_cost": 0.0,
"clusters_cost": 0.0,
"total_cost": 0.0
}
}

Returns


The response indicates the status of the request to retrieve usage cost data from the previous day for your resources where true indicates success, false indicates error. The data object returned by this API includes the total usage costs from the previous day for each of the resource types: virtual machines, volumes, and clusters, as well as the total usage cost from the previous day for all of your resources combined.



Back to top