Metrics
Live CPU and memory figures for an environment's containers, or CPU, memory, disk and network figures for one of your servers, read on demand from the server's monitoring agent. An environment's disk sizes come from the last measurement, not live. The same figures appear on the Monitoring pages of the dashboard.
Base URL: https://api.oec.sh/api/public/v1
Works with read-only and full-access keys.
Every call reads from the server. On top of your key's rate limit, each environment and each server accepts at most 6 metrics calls a minute, whichever keys make them, and your organization can make at most 20 environment metrics and runtime-log calls a minute to the environments on one server. A 429 with error: "target_rate_limit" carries retry_after (seconds to wait, also sent as the Retry-After header).
Get Environment Metrics
GET /environments/{env_id}/metricsFigures for the environment's own containers only, also on a shared server.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
env_id | UUID | The environment ID. |
Response: 200 OK
{
"environment_id": "5a296461-9222-40da-91f5-9e912890dc1b",
"status": "running",
"odoo": {
"status": "running",
"cpu_percent": 12.5,
"memory_used_bytes": 536870912,
"memory_limit_bytes": 2147483648,
"memory_percent": 25.0
},
"postgres": {
"status": "running",
"cpu_percent": 1.2,
"memory_used_bytes": 201326592,
"memory_limit_bytes": 1073741824,
"memory_percent": 18.75
},
"disk": {
"allocated_gb": 10,
"database_bytes": 432198144,
"filestore_bytes": 211345920,
"addons_bytes": 18350080,
"measured_at": "2026-10-05T03:00:12Z"
},
"queried_at": "2026-10-05T09:12:03.512Z"
}| Field | Type | Description |
|---|---|---|
status | string | The environment's status (see Environments). |
odoo, postgres | object|null | The Odoo and database containers. null when the server does not report the container: through the monitoring agent only running containers are reported, while over SSH a stopped container is reported with status stopped. |
*.status | string | Container state, for example running, stopped, restarting. |
*.cpu_percent | number|null | CPU use. 100 means one full core. |
*.memory_used_bytes, *.memory_limit_bytes, *.memory_percent | number|null | Memory in use, the container's limit, and the share of the limit in use. |
disk.allocated_gb | integer | Disk allocated to the environment. |
disk.database_bytes, disk.filestore_bytes, disk.addons_bytes | integer|null | Sizes from the last measurement, null if never measured. |
disk.measured_at | string|null | When the sizes were measured. They are not live. |
Some servers are monitored over SSH instead of through the monitoring agent's web endpoint. For those, the container status is known but the CPU and memory figures are null.
Errors
| Status | error | Reason |
|---|---|---|
404 | not_found | Environment not found, or outside your key's organization or project. |
409 | no_server | The environment has no server assigned yet. |
409 | environment_not_ready | The environment is pending, cloning or deploying. Try again when the task has finished. |
429 | target_rate_limit | More than 6 calls in a minute for this environment, or more than 20 calls in a minute from your organization to environments on the same server. |
502 | metrics_unavailable | The server did not return metrics. Try again in a minute. |
Example
curl "https://api.oec.sh/api/public/v1/environments/YOUR_ENV_ID/metrics" \
-H "Authorization: Bearer YOUR_API_KEY"Get Server Metrics
GET /servers/{server_id}/metricsWhole-server figures for a server your organization owns. Shared servers return 404, because their figures cover other customers too; use the environment metrics above for your environments on a shared server.
A project-scoped key can read a server only while it hosts an environment of that project.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
server_id | UUID | The server ID. |
Response: 200 OK
{
"server_id": "0f6b1d2e-5c1a-4a8e-9d55-4f3f1f3a2b10",
"status": "healthy",
"cpu_percent": 31.0,
"memory_percent": 62.4,
"memory_used_bytes": 10716446720,
"memory_total_bytes": 17179869184,
"disk_percent": 55.0,
"disk_used_bytes": 88046829568,
"disk_total_bytes": 160083787776,
"network_rx_bytes_per_second": 15360.0,
"network_tx_bytes_per_second": 40960.0,
"container_count": 9,
"containers_running": 9,
"queried_at": "2026-10-05T09:12:03.512Z"
}Network rates are bytes per second, summed over the server's physical network interfaces.
status is healthy, warning (CPU or memory at 80% or more, or disk at 80% or more) or critical (CPU or memory at 95% or more, or disk at 90% or more).
Errors
| Status | error | Reason |
|---|---|---|
404 | not_found | Server not found, a shared server, owned by another organization, or (project-scoped key) hosting none of the project's environments. |
429 | target_rate_limit | More than 6 calls in a minute for this server. |
502 | metrics_unavailable | The server or its monitoring agent did not respond. Try again in a minute. |
Example
curl "https://api.oec.sh/api/public/v1/servers/YOUR_SERVER_ID/metrics" \
-H "Authorization: Bearer YOUR_API_KEY"