Skip to content
中文

Get sandbox metrics

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

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

Official E2B docs ↗

Request parameters

  • sandboxIDstringrequired

    path: Sandbox ID.

  • startintegeroptional

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

  • endintegeroptional

    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

Request

curl
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
curl https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/metrics \
  -H "X-API-Key: $PRAXIS_API_KEY"
Python
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
import requests

api_key = "$PRAXIS_API_KEY"

# Call /sandbox/v1 directly over HTTP.
resp = requests.get(
    "https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/metrics",
    headers={"X-API-Key": api_key},
)
print(resp.status_code, resp.text)
TypeScript
// Call Create sandbox first and replace sbx_123 with its returned sandboxID.
const apiKey = "$PRAXIS_API_KEY";

// Call /sandbox/v1 directly over HTTP.
const resp = await fetch(`https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/metrics`, {
  headers: { "X-API-Key": apiKey },
});
console.log(resp.status, await resp.text());

Response 200

[]

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