Skip to main content
GET
Get sandbox metrics
Related guide: Inspect sandbox metrics.

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.

Headers

X-Team-Id
string

Optional team ID. Must match the team_id query parameter when both are supplied. If neither selector is supplied, defaults to the caller's only accessible team. Callers with multiple accessible teams must select a team. Requests without access to any team are forbidden.

Minimum string length: 1

Path Parameters

sandbox_name
string
required

Immutable sandbox name returned by creation.

Minimum string length: 1
Example:

"baseten-api-review-0916"

Query Parameters

team_id
string

Optional team ID. Must match X-Team-Id when both are supplied. If neither selector is supplied, defaults to the caller's only accessible team. Callers with multiple accessible teams must select a team. Requests without access to any team are forbidden.

Minimum string length: 1
mode
enum<string>

Defaults to CURRENT, which rejects start_epoch_millis and end_epoch_millis. SERIES uses a server-selected step of 30 seconds up to 2 hours, 60 seconds up to 1 day, 600 seconds up to 3 days, and 3600 seconds beyond 3 days.

Available options:
CURRENT,
SUMMARY,
SERIES
start_epoch_millis
integer<int64>

Unix milliseconds. Defaults to one hour before end; SERIES snaps outward.

Required range: x >= 0
end_epoch_millis
integer<int64>

Exclusive end in Unix milliseconds, default now. Maximum aligned window is 7 days.

Required range: x >= 0
metrics
enum<string>[]

Metric names in response order. Omit to request all three signals.

Required array length: 1 - 3 elements
Available options:
baseten_sandbox_requests_total,
baseten_sandbox_cpu_usage_cores,
baseten_sandbox_memory_bytes

Response

Index-aligned sandbox metrics.

start_epoch_millis
integer<int64>
required

Returned window start, snapped outward in SERIES. Equal to end for CURRENT.

end_epoch_millis
integer<int64>
required

Returned exclusive window end, snapped outward in SERIES. Snapshot timestamp for CURRENT.

mode
enum<string>
required
Available options:
CURRENT,
SUMMARY,
SERIES
step_seconds
integer | null
required

Seconds per SERIES interval; null in CURRENT and SUMMARY.

metric_descriptors
object[]
required
Required array length: 1 - 3 elements
metric_values
object[]
required
Maximum array length: 10000