---
title: "A sandbox's CPU, memory and measured waiting over time, and its latest reading."
method: GET
path: "/v1/sandboxes/{id}/metrics"
tags: ["observability"]
---

# A sandbox's CPU, memory and measured waiting over time, and its latest reading.

`GET /v1/sandboxes/{id}/metrics`

## Request

- Base URL: `https://api.withruntime.com`
- URL: `https://api.withruntime.com/v1/sandboxes/{id}/metrics`
- Auth: HTTP bearer

CPU is measured, not estimated: the machine's CPU time between two host readings, as a percent of the sandbox's vCPUs and as cores. Memory is the machine's resident memory. The host reads every running sandbox every minute by default. range picks the window and bucket: 15m (10 s buckets), 1h (20 s buckets), 6h (120 s buckets), 24h (480 s buckets), 7d (3600 s buckets), 30d (3600 s buckets). Readings are kept 24 hours; hourly averages and peaks 30 days. A paused or stopped sandbox has no new readings.

## Path parameters

- `id` string, required: Resource identifier (UUID).

## Query parameters

- `range` '15m' | '1h' | '6h' | '24h' | '7d' | '30d'

## Response `200`

Success

- object
  - `sandboxId` string, required
  - `range` '15m' | '1h' | '6h' | '24h' | '7d' | '30d', required
  - `stepSeconds` integer, required
  - `since` string
  - `until` string
  - `vcpu` integer
  - `memoryLimitBytes` integer
  - `diskLimitBytes` integer
  - `state` string
  - `latest` object, nullable, required
    - `at` string, required: Start of the bucket, ISO 8601.
    - `cpuPercent` number, nullable, required: Average CPU, percent of all the sandbox's vCPUs (0-100).
    - `cpuCores` number, nullable: The same average as a number of cores.
    - `cpuPeakPercent` number, nullable: The busiest interval between two readings in the bucket.
    - `cpuWaitPercent` number, nullable: Percent of measured wall time ready to run while waiting for CPU; null without complete same-run readings.
    - `memoryStallPercent` number, nullable: Percent of measured wall time with a thread waiting for memory; null where unmeasured.
    - `memoryBytes` integer, required: Average resident memory, bytes.
    - `memoryPeakBytes` integer
    - `samples` integer, required: Host readings in the bucket.
  - `points` object[], required
    - `at` string, required: Start of the bucket, ISO 8601.
    - `cpuPercent` number, nullable, required: Average CPU, percent of all the sandbox's vCPUs (0-100).
    - `cpuCores` number, nullable: The same average as a number of cores.
    - `cpuPeakPercent` number, nullable: The busiest interval between two readings in the bucket.
    - `cpuWaitPercent` number, nullable: Percent of measured wall time ready to run while waiting for CPU; null without complete same-run readings.
    - `memoryStallPercent` number, nullable: Percent of measured wall time with a thread waiting for memory; null where unmeasured.
    - `memoryBytes` integer, required: Average resident memory, bytes.
    - `memoryPeakBytes` integer
    - `samples` integer, required: Host readings in the bucket.

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/withruntime/apis/runtime-cloud-api.md) · [All operations](https://skmtc.dev/withruntime/apis/runtime-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/withruntime/apis/runtime-cloud-api/revisions/6f4012286988?raw)
