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● SupportedRequest 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
| Name | Type | Description |
|---|---|---|
| [].timestamp | string | Timestamp of the metric entry |
| [].timestampUnix | integer | Timestamp of the metric entry in Unix time (seconds since epoch) |
| [].cpuCount | integer | Number of CPU cores |
| [].cpuUsedPct | number | CPU usage percentage |
| [].memUsed | integer | Memory used in bytes |
| [].memTotal | integer | Total memory in bytes |
| [].memCache | integer | Cached memory (page cache) in bytes |
| [].diskUsed | integer | Disk used in bytes |
| [].diskTotal | integer | Total disk space in bytes |