Sandbox

Get sandbox metrics

Get a sandbox's CPU, memory and disk usage.

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

GET /sandbox/v1/sandboxes/{sandboxID}/metrics● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path: Sandbox ID.

  • startinteger可选

    query: Unix timestamp for the start of the interval, in seconds, for which the metrics

  • endinteger可选

    query: Unix timestamp in seconds at which the metrics window ends. Omit it to read up to the latest sample.

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully returned the sandbox metrics

application/json

NameTypeDescription
[].timestampstringTimestamp of the metric entry
[].timestampUnixintegerTimestamp of the metric entry in Unix time (seconds since epoch)
[].cpuCountintegerNumber of CPU cores
[].cpuUsedPctnumberCPU usage percentage
[].memUsedintegerMemory used in bytes
[].memTotalintegerTotal memory in bytes
[].memCacheintegerCached memory (page cache) in bytes
[].diskUsedintegerDisk used in bytes
[].diskTotalintegerTotal disk space in bytes