Skip to content

List CPU and memory use of all VPS

GET /api/v2/vps/metrics

Returns the latest CPU and memory use of every VPS on the account, for a table or an overview. Use GET /api/v2/vps/{id}/metrics for one VPS over time, with disk and network figures. The list is built from the VPS list you loaded shortly before. Call GET /api/v2/vps first. Without a recent list, metrics is empty. A stopped VPS has null values. So does a VPS without a sample from the last 5 minutes.

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

Example

GET /api/v2/vps/metrics
curl "https://cloud.hostup.se/api/v2/vps/metrics" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 CPU and memory use per VPS.

Response 200
{
"metrics": [
{
"vpsId": "vps_01hxa3b4c5d6e7f8g9h0j1k2m3",
"metrics": {
"cpuPercent": 12.4,
"memoryPercent": 48.2
},
"recordedAt": "2026-04-27T12:00:00.000Z"
}
]
}
Response fields
metricsarray of object
One entry per VPS.
vpsIdstring
The VPS ID.
metricsobject
The latest sample.
cpuPercentnumber or null
CPU use in percent. Null without a recent sample.
memoryPercentnumber or null
Memory use in percent of the VPS’s memory, 0 to 100. Null without a recent sample.
recordedAtstring or null
When the sample was taken. Null without a recent sample.

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.
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.