Skip to content

Get a VPS cost breakdown

GET /api/v2/vps/{id}/billing-breakdown

Get what one VPS costs, split into its parts. A VPS with a fixed billing period returns kind: "fixed": the plan price and each paid add-on, such as extra bandwidth, storage or IP addresses. Every amount is for one billingCycle. A Cloud VPS returns kind: "payg_estimate": an estimate for the current calendar month (UTC) as if the server runs every hour. It has one line each for CPU, RAM, disk and additional IPv4 addresses. One public IPv4 address is included. The ipv4 line counts only the extra ones. The estimate is not what has been charged. GET /api/v2/billing/metered-usage has the charges so far for the whole account. When no price is known yet, the response is available: false with a reason.

Authentication: An API key with the scope read:billing. About keys and scopes

Request

Path parameters

idstringrequired
The VPS ID (vps_…).

Example

GET /api/v2/vps/{id}/billing-breakdown
curl "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/billing-breakdown" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 Cost breakdown. kind tells a fixed plan from a Cloud VPS estimate. available: false when no price is known.

{
"available": true,
"kind": "fixed",
"currencyCode": "SEK",
"billingCycle": "monthly",
"base": {
"productName": "VPS XS",
"amount": 39
},
"addons": [
{
"name": "Extra bandwidth",
"category": "bandwidth",
"unit": "TB",
"includedQuantity": 2,
"currentQuantity": 20,
"unitPrice": 5,
"amount": 90
}
],
"addonsAmount": 90,
"totalAmount": 129
}
Response fields
availableboolean
True when a breakdown is returned. One of true.
kindstring
fixed for a VPS with a billing period. One of fixed.
currencyCodestring
Currency of every amount, ISO 4217.
billingCyclestring
Billing period every amount covers, for example monthly or annually.
baseobject
The plan without add-ons.
productNamestring or null
Plan name.
amountnumber
Plan price per billing period, without add-ons.
addonsarray of object
Paid add-ons on the VPS.
namestring
Add-on name. An add-on with a choice also names the chosen option.
categorystring or null
Kind of add-on, for example bandwidth or storage.
unitstring or null
Unit of the quantities, for example TB or GB.
includedQuantitynumber
Quantity included in the plan.
currentQuantitynumber
Quantity the VPS has now.
unitPricenumber
Price per unit and billing period.
amountnumber
Price of this add-on per billing period.
addonsAmountnumber
Sum of the add-on amounts.
totalAmountnumber
Plan price plus add-ons per billing period.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is vps_not_found.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.