Everstack
API ReferenceSandboxGet Stats

Get Sandbox Stats

GET/v1/sandbox/{sessionId}/stats
GET/v1/sandbox/{'{sessionId}'}/stats

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Parameters

NameInTypeRequiredDescription
sessionIdpathstringYes
tenantIdquerystringNo

Responses

200 Get live stats for a sandbox

PropertyTypeDescription
statsobjectSandboxStats holds a point-in-time resource usage snapshot.

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X GET "https://{instance}.{region}.everstack.ai/v1/sandbox/{sessionId}/stats" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
const response = await fetch("https://{instance}.{region}.everstack.ai/v1/sandbox/{sessionId}/stats", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
});
const data = await response.json();
import requests

response = requests.get(
    "https://{instance}.{region}.everstack.ai/v1/sandbox/{sessionId}/stats",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
)
data = response.json()

Response

{
  "stats": {
    "cpuPercent": 0,
    "memoryUsage": "string",
    "memoryLimit": "string",
    "memoryPercent": 0,
    "networkRxBytes": "string",
    "networkTxBytes": "string",
    "blockRead": "string",
    "blockWrite": "string",
    "pids": 0,
    "timestamp": "2024-01-01T00:00:00Z"
  }
}
{
  "code": 0,
  "message": "string",
  "details": [
    {
      "@type": "string"
    }
  ]
}