Skip to main content
GET
/
v1
/
devboxes
/
{id}
/
usage
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});

const devboxResourceUsageView = await client.devboxes.retrieveResourceUsage('id');

console.log(devboxResourceUsageView.id);
{
  "id": "<string>",
  "total_active_seconds": 123,
  "total_elapsed_seconds": 123,
  "vcpu_seconds": 123,
  "memory_gb_seconds": 123,
  "disk_gb_seconds": 123,
  "start_time_ms": 123,
  "status": "<string>",
  "end_time_ms": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The Devbox ID.

Response

OK

id
string
required

The devbox ID.

total_active_seconds
integer<int64>
required

Total time in seconds the devbox was actively running (excludes time spent suspended).

total_elapsed_seconds
integer<int64>
required

Total elapsed time in seconds from devbox creation to now (or end time if terminated). Includes all time regardless of devbox state.

vcpu_seconds
integer<int64>
required

vCPU usage in vCPU-seconds (total_active_seconds multiplied by the number of vCPUs).

memory_gb_seconds
integer<int64>
required

Memory usage in GB-seconds (total_active_seconds multiplied by memory in GB).

disk_gb_seconds
integer<int64>
required

Disk usage in GB-seconds (total_elapsed_seconds multiplied by disk size in GB). Disk is billed for elapsed time since storage is consumed even when suspended.

start_time_ms
integer<int64>
required

The devbox creation time in milliseconds since epoch.

status
string
required

The current status of the devbox.

end_time_ms
integer<int64> | null

The devbox end time in milliseconds since epoch, or null if still running.