Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
Skip to Content
API ReferenceBilling and usageUsage

Get sandbox fleet metrics

View your organization's sandbox concurrency, creation counts, and allocated or consumed CPU hours over a selected time range. Returns sampled active-sandbox and configured-vCPU history, successful sandbox creation and execution counts, and allocated and consumed CPU hours. The selected range includes the current partial UTC hour and preceding full hours. The response names its exact bounds. Usage totals come from reported events and are not billing amounts. Paused sessions count as active sessions. Availability is enabled per organization; unavailable organizations receive 404.

Required permission

Requires the sandboxes.read permission. See Permissions for the roles and API key permissions that include it.

Command line

The orl CLI wraps this endpoint:

orl usage sandbox-monitoring get
GET
/v1/orgs/{orgId}/sandboxes/metrics

Authorization

apiKey
headerAuthorizationBearer <token>

OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).

Path Parameters

orgId*string

Query Parameters

range?string

Number of UTC-hour buckets, including the current partial hour.

Value in"1h""6h""24h""7d"

Response Body

Fleet observations and usage

application/json
  1. response

Fleet observations and reported usage for the organization. History begins when collection is enabled. Resource gauges are sampled; brief concurrency peaks can be missed. Usage is attributed to the UTC hour when its reporting interval ended, rather than reconstructed within the interval. Empty or failed sources remain distinguishable through coverage, warnings, and nullable observations.

range*SandboxMonitoringRange

Number of UTC-hour buckets, including the current partial hour.

Value in"1h""6h""24h""7d"
start*string

Beginning of the first included UTC hour.

Formatdate-time
end*string

End of the current partial hour as observed by this response.

Formatdate-time
stepSeconds*integer

Spacing of sampled fleet observations. Usage entries are separate UTC-hour buckets.

Range1 <= value
monitoringSince?string

Earliest reported event within the selected window, when present. Not an all-time collection-start guarantee.

Formatdate-time
dataThrough?string

Latest reported event included in the usage totals.

Formatdate-time
totals*
series*array<>
Itemsitems <= 1000
usage*array<>
Itemsitems <= 168
peakObservedConcurrency*number
Formatdouble
Range0 <= value
coverage*SandboxMonitoringCoverage
Value in"complete""partial""unavailable"
warnings*array<string>
Example Request
curl -X GET 'https://api.openrelay.inc/v1/orgs/string/sandboxes/metrics'
Example Response
{  "range": "1h",  "start": "2019-08-24T14:15:22Z",  "end": "2019-08-24T14:15:22Z",  "stepSeconds": 1,  "monitoringSince": "2019-08-24T14:15:22Z",  "dataThrough": "2019-08-24T14:15:22Z",  "totals": {    "created": 0,    "executionsStarted": 0,    "executionsCompleted": 0,    "allocatedVcpuHours": 0,    "consumedCpuHours": 0,    "cpuCoverage": "complete"  },  "series": [    {      "at": "2019-08-24T14:15:22Z",      "activeSandboxes": 0,      "configuredVcpus": 0    }  ],  "usage": [    {      "start": "2019-08-24T14:15:22Z",      "end": "2019-08-24T14:15:22Z",      "created": 0,      "executionsStarted": 0,      "executionsCompleted": 0,      "allocatedVcpuHours": 0,      "consumedCpuHours": 0,      "cpuCoverage": "complete"    }  ],  "peakObservedConcurrency": 0,  "coverage": "complete",  "warnings": [    "string"  ]}