oiyai / docs
Services

Resource monitoring

Read CPU, memory, GPU, and VRAM measurements without changing service activity.

DEPLOYMENT-DEPENDENT CAPABILITYMonitoring is implemented in the current preview source. Live readings require the updated control plane and configured regional collectors. A valid resource profile or running service does not, by itself, prove that every metric source is available.

What is measured

MetricMeaning
CPUWorkload CPU utilization relative to its allocation where the runtime provides that measurement
MemoryWorkload system-memory utilization
GPUMean utilization of the assigned GPU devices
VRAMUsed framebuffer memory divided by assigned framebuffer capacity

CPU and system RAM are distinct from GPU utilization and VRAM. Per-device data is included when available. Physical GPU identifiers, host addresses, and supplier credentials are not returned.

A measured 0 means zero usage. null means a reading is missing or unsupported. Do not plot missing values as zero.

Read the API

curl "$OIY_API_URL/api/services/$SERVICE_ID/metrics?minutes=60" \
  -H "Authorization: Bearer $OIY_API_KEY"

The supported windows are 15, 60, and 360 minutes; the default is 60. Collection runs approximately every 30 seconds, and history is retained for six hours. Responses are not cached.

Reading metrics does not wake a sleeping service, protect a task, or reset its idle timer. Monitoring is diagnostic and does not meter billing.

Interpret the response state

StateInterpretation
liveThe current revision has a fresh sample with its expected metrics present.
partialA fresh sample exists, but one or more expected values are unavailable.
staleThe latest sample for the current revision is older than 90 seconds.
unavailableThere is no usable current sample.
inactiveCompute is not allocated or the service is sleeping, stopping, deleting, or deleted.

Paused services can retain historical samples, but latest is null while inactive. History may contain earlier revisions or allocation generations. Break chart lines across changes in revision or generation, missing readings, and long collection gaps.

Response fields

  • serviceId: the requested service UUID.
  • intervalSeconds: 30.
  • retentionSeconds: 21600.
  • state: one of the states above.
  • latest: a detailed current sample, or null.
  • samples: compact historical points with timestamp, revision, allocation generation, and the four percentage values.

Detailed samples include nullable absolute core/byte counts, assigned-device readings, and unavailable reasons for CPU, memory, GPU, and VRAM. Source limitations can prevent an absolute count even when a percentage is available. observedAt is a Unix timestamp in milliseconds; the opaque generation value identifies a measurement continuity boundary, not a physical device.

CLI, Python, and MCP

The current source-distributed clients expose the same monitoring API:

oiy metrics SERVICE_ID --minutes 15
from oiy_ai import Client

history = Client().metrics("SERVICE_ID", minutes=15)

MCP oiy_metrics returns current status and summary statistics. History is opt-in and capped at 120 recent points. Averages and peaks describe observed samples, not an estimate for missing periods.

See developer installation before using source-distributed clients. The complete response schema is included in the OpenAPI description.

On this page