Docs
Metrics and telemetry ›

Get sandbox metrics

GET/v1/sandboxes/{id}/metrics

What one sandbox read between two moments: CPU, memory, disk and network.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. const metrics = await sandbox.metrics();
Answer200 OK · SandboxMetrics
  1. {
  2. "sandboxId": string,
  3. "since": string,
  4. "until": string,
  5. "stepSeconds": integer,
  6. "keptDays": integer,
  7. "points": [{
  8. "at": string,
  9. "cpuUtilization": number | null,
  10. "memoryUsedBytes": number | null,
  11. "memoryTotalBytes": number | null,
  12. "diskUsedBytes": number | null,
  13. "diskTotalBytes": number | null,
  14. … 4 more
  15. }],
  16. "complete": boolean,
  17. }

What one sandbox read between two moments: CPU, memory, disk and network, oldest first.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Query

since
string
Read from this moment. An hour before until when omitted. Readings are kept 15 days. e.g. "2026-10-14T15:00:00Z"
until
string
Read up to this moment. Now when omitted, and never later than now.
stepSeconds
integer
Seconds between two points, 60 at the least, which is how often a sandbox is read. When omitted, a step that gives about 360 points. e.g. 60

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Returns

200 What one sandbox read between two moments: CPU, memory, disk and network, oldest first. There is no point for a moment it was stopped at, and none from before it was made. Nothing is asked of the sandbox itself, and nothing has to be installed in it.

SandboxMetrics7 fields
sandboxId
string
since
string
until
string
stepSeconds
integer
keptDays
integer
How long a reading is kept, in days.
points
MetricsReading[]10 fields
at
string
The moment of the reading.
cpuUtilization
numbernull
The share of the sandbox's CPUs' time that was not idle, 0 to 1.
More Null when the server had no such figure then.
memoryUsedBytes
numbernull
Memory in use, as the sandbox counts it: what it has less what is available.
More Null when the server had no such figure then.
memoryTotalBytes
numbernull
The memory the sandbox has.
More Null when the server had no such figure then.
diskUsedBytes
numbernull
What of the root disk cannot be written to: its size less what is available.
More Null when the server had no such figure then.
diskTotalBytes
numbernull
The size of the root disk.
More Null when the server had no such figure then.
networkReceivedBytesPerSecond
numbernull
Bytes a second received from the network.
More Null when the server had no such figure then.
networkSentBytesPerSecond
numbernull
Bytes a second sent to the network.
More Null when the server had no such figure then.
diskReadBytesPerSecond
numbernull
Bytes a second read from disk.
More Null when the server had no such figure then.
diskWrittenBytesPerSecond
numbernull
Bytes a second written to disk.
More Null when the server had no such figure then.
complete
boolean
False when a server did not answer.
More A sandbox that was moved has readings on each server it was on, and those of the one that did not answer are missing.

Errors and other answers

400 since is not before until, the two are more than 15 days apart, or stepSeconds would give more than 1500 points.
404 Not found.
501metrics_unavailable sandboxes are not read here. GET /v1/policy says so as metrics.
503metrics_unreadable not one of the servers answered for its readings. The sandboxes are as they were. Ask again in a minute.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.