Logs & Usage
Console logs, entrypoint logs, and usage metrics.
Per-sandbox logs are returned as plain text; usage metrics are JSON. Logs for a live sandbox are read from its host in real time; once a sandbox reaches stopped, failed, or lost the final log is served from durable storage. See the Logs guide and Usage Metrics guide.
GET /vms/:id/logs
Fetch the sandbox's console/boot log. Live sandboxes return the current log; terminal sandboxes (stopped, failed, lost) return the persisted final log. Response is text/plain.
Errors
404— unknown sandbox; a terminal sandbox with no persisted log; or a live sandbox not yet placed on a host.502— the sandbox's host did not answer; retry.
GET /vms/:id/entrypoint-logs
Fetch the entrypoint session's output (stdout/stderr of the container entrypoint running inside the sandbox), separate from the console log. Same live/terminal semantics and text/plain response as /logs.
Errors
404— unknown sandbox, no persisted log, or not placed on a host.502— the sandbox's host did not answer; retry.
GET /vms/:id/usage
A live resource-usage sample for a placed sandbox, read from its host in real time. The usage document carries the host's current measurements (CPU, memory, disk, I/O and network counters) for this sandbox.
Errors
404— unknown sandbox, or the sandbox is not currently placed on a host (e.g.stopped).502— the sandbox's host did not answer; retry.
GET /vms/:id/usage/history
Per-sandbox usage time series, for charts and post-hoc analysis. Buckets are integrals over the covered wall-clock span: normalize with duration_ms (e.g. average cores = cpu_core_s / (duration_ms / 1000)).
| Query param | Type | Default | Description |
|---|---|---|---|
from | RFC 3339 | to − 24 h | Lower bound (inclusive). |
to | RFC 3339 | now | Upper bound (exclusive). |
resolution | string | "m" | "m" (minute buckets) or "h" (hourly rollups). |
When the metrics store is not configured for the deployment, the response is { "available": false, "sandbox_id": "...", "periods": [] }.
Errors
404— unknown sandbox or another project's sandbox.
GET /usage/report
Project-scoped usage report aggregated across all of the project's sandboxes, suitable for spend review. See Spending.
| Query param | Type | Default | Description |
|---|---|---|---|
start | RFC 3339 | end − 1 day | Lower bound (inclusive). |
end | RFC 3339 | now | Upper bound (exclusive). |
resolution | string | "h" | "h" (hourly) or "d" (daily). |
When the metrics store is not configured, the response is { "available": false, "items": [] }.