Workloads
Retrieve a list of active workloads with details.
Bearer authentication
Return only deleted resources when true.
The offset of the first item returned in the collection.
100The maximum number of entries to return.
50Sort results in descending or ascending order.
ascPossible values: Sort results by a parameter.
Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contain, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.
["name!=some-workload-name","allocatedGPU>=2","createdAt>=2021-01-01T00:00:00Z"]Filter results by a free text search.
test projectExecuted successfully.
1Unauthorized
Forbidden
unexpected error
unexpected error
GET /api/v1/workloads HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"next": 1,
"workloads": [
{
"tenantId": 1001,
"runningPods": 1,
"phaseUpdatedAt": "2022-06-08T11:28:24.131Z",
"k8sPhaseUpdatedAt": "2022-06-08T11:28:24.131Z",
"updatedAt": "2022-06-08T11:28:24.131Z",
"source": "CLI",
"deletedAt": "2022-08-12T19:28:24.131Z",
"type": "runai-job",
"name": "very-important-job",
"id": "123e4567-e89b-12d3-a456-426614174000",
"priority": 50,
"priorityClassName": "high-priority",
"submittedBy": "researcher@run.ai",
"clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
"projectName": "proj-1",
"projectId": "1",
"departmentName": "department-1",
"departmentId": "1",
"namespace": "runai-proj-1",
"createdAt": "2022-01-01T03:49:52.531Z",
"workloadRequestedResources": {
"gpuRequestType": "portion",
"gpu": {
"limit": 1.5,
"request": 1
},
"gpuMemory": {
"limit": "2G",
"request": "200M"
},
"cpu": {
"limit": 1.5,
"request": 1
},
"cpuMemory": {
"limit": "2G",
"request": "200M"
},
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"podsRequestedResources": {
"gpuRequestType": "portion",
"gpu": {
"limit": 1.5,
"request": 1
},
"gpuMemory": {
"limit": "2G",
"request": "200M"
},
"cpu": {
"limit": 1.5,
"request": 1
},
"cpuMemory": {
"limit": "2G",
"request": "200M"
},
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"allocatedResources": {
"gpu": 1.5,
"gpuMemory": "200Mi",
"cpu": 0.5,
"cpuMemory": "0B",
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"actionsSupport": {
"delete": true,
"suspend": true
},
"phase": "Creating",
"conditions": [
{
"type": "Ready",
"status": "False",
"message": "Resource validation failed: ...",
"reason": "ErrorConfig",
"lastTransitionTime": "2022-01-01T03:49:52.531Z"
}
],
"phaseMessage": "Not enough resources in the requested nodepool",
"k8sPhase": "Pending",
"requestedPods": {
"number": 1,
"min": 2,
"max": 5,
"parallelism": 3,
"completions": 5
},
"requestedNodePools": [
"default"
],
"currentNodePools": [
"default"
],
"completedAt": "2022-01-01T03:49:52.531Z",
"images": [
"alpine:latest"
],
"urls": [
"text"
],
"datasources": [
{
"type": "pvc",
"name": "my-pvc-datasource-1",
"id": "123e4567-e89b-12d3-a456-426614174000"
}
],
"environments": [
{
"connections": [
{
"name": "my-pytorch-env",
"toolType": "pytorch",
"connectionType": "ExternalUrl",
"url": "http://wandb.com/yourproject",
"authorizationType": "public",
"authorizedUsers": [
"user@company.ai",
"another@company.ai"
],
"authorizedGroups": [
"group-a",
"group-b"
],
"containerPort": 8080
}
],
"name": "pytorch",
"id": "123e4567-e89b-12d3-a456-426614174000",
"replicaType": "Master"
}
],
"externalConnections": [
{
"name": "my-pytorch-env",
"toolType": "pytorch",
"connectionType": "ExternalUrl",
"url": "http://wandb.com/yourproject",
"authorizationType": "public",
"authorizedUsers": [
"user@company.ai",
"another@company.ai"
],
"authorizedGroups": [
"group-a",
"group-b"
],
"containerPort": 8080
}
],
"distributedFramework": "Pytorch",
"additionalFields": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"preemptible": true,
"environmentVariables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"command": "sleep",
"arguments": "1000",
"phaseReason": "text",
"idleAllocatedGpus": 1,
"totalPendingTimeSeconds": 60,
"totalRunningTimeSeconds": 60,
"category": "Train",
"guaranteedRuntimeEndsAt": "2025-08-01T03:49:52.531Z",
"aiApplicationId": "text",
"aiApplicationName": "text",
"sourceApi": "WorkloadsV2",
"topology": {
"name": "text",
"preferredPlacement": "text",
"requiredPlacement": "text",
"actualPlacement": {
"level": "text",
"value": "text"
}
},
"endpoints": [
{
"host": "text",
"port": 1,
"path": "text",
"tlsEnabled": true,
"protocol": "text",
"url": "text"
}
],
"kubernetesRef": {
"group": "text",
"version": "text"
}
}
]
}Retrieve workload data using a workloadId.
Bearer authentication
The Universally Unique Identifier (UUID) of the workload.
Executed successfully.
The id of the tenant.
100112022-06-08T11:28:24.131Z2022-06-08T11:28:24.131Z2022-06-08T11:28:24.131Z2022-08-12T19:28:24.131Zrunai-jobvery-important-job50high-priorityresearcher@run.aiThe id of the cluster.
71f69d83-ba66-4822-adf5-55ce55efd210proj-11department-11runai-proj-12022-01-01T03:49:52.531ZNot enough resources in the requested nodepoolPendingdefaultdefault2022-01-01T03:49:52.531Zalpine:latestDEPRECATED: This field is deprecated. Use Get workload endpoints to retrieve workload network endpoints instead.Requires cluster version 2.25 or above.
Pytorchsleep1000sum of idle allocated gpus in the workload
1The total cumulative time, in seconds, that the workload has spent in the Pending phase since submission.
60The total cumulative time, in seconds, that the workload has spent in the Running phase since submission.
60Category Description
TrainA timestamp indicating when the workload will reach its minimum guaranteed runtime, as defined by minGuaranteedRuntime. Until this time, the workload is considered non-preemptible and cannot be interrupted by higher-priority workloads.
2025-08-01T03:49:52.531ZUnauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/{workloadId} HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"tenantId": 1001,
"runningPods": 1,
"phaseUpdatedAt": "2022-06-08T11:28:24.131Z",
"k8sPhaseUpdatedAt": "2022-06-08T11:28:24.131Z",
"updatedAt": "2022-06-08T11:28:24.131Z",
"source": "CLI",
"deletedAt": "2022-08-12T19:28:24.131Z",
"type": "runai-job",
"name": "very-important-job",
"id": "123e4567-e89b-12d3-a456-426614174000",
"priority": 50,
"priorityClassName": "high-priority",
"submittedBy": "researcher@run.ai",
"clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
"projectName": "proj-1",
"projectId": "1",
"departmentName": "department-1",
"departmentId": "1",
"namespace": "runai-proj-1",
"createdAt": "2022-01-01T03:49:52.531Z",
"workloadRequestedResources": {
"gpuRequestType": "portion",
"gpu": {
"limit": 1.5,
"request": 1
},
"gpuMemory": {
"limit": "2G",
"request": "200M"
},
"cpu": {
"limit": 1.5,
"request": 1
},
"cpuMemory": {
"limit": "2G",
"request": "200M"
},
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"podsRequestedResources": {
"gpuRequestType": "portion",
"gpu": {
"limit": 1.5,
"request": 1
},
"gpuMemory": {
"limit": "2G",
"request": "200M"
},
"cpu": {
"limit": 1.5,
"request": 1
},
"cpuMemory": {
"limit": "2G",
"request": "200M"
},
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"allocatedResources": {
"gpu": 1.5,
"gpuMemory": "200Mi",
"cpu": 0.5,
"cpuMemory": "0B",
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"actionsSupport": {
"delete": true,
"suspend": true
},
"phase": "Creating",
"conditions": [
{
"type": "Ready",
"status": "False",
"message": "Resource validation failed: ...",
"reason": "ErrorConfig",
"lastTransitionTime": "2022-01-01T03:49:52.531Z"
}
],
"phaseMessage": "Not enough resources in the requested nodepool",
"k8sPhase": "Pending",
"requestedPods": {
"number": 1,
"min": 2,
"max": 5,
"parallelism": 3,
"completions": 5
},
"requestedNodePools": [
"default"
],
"currentNodePools": [
"default"
],
"completedAt": "2022-01-01T03:49:52.531Z",
"images": [
"alpine:latest"
],
"urls": [
"text"
],
"datasources": [
{
"type": "pvc",
"name": "my-pvc-datasource-1",
"id": "123e4567-e89b-12d3-a456-426614174000"
}
],
"environments": [
{
"connections": [
{
"name": "my-pytorch-env",
"toolType": "pytorch",
"connectionType": "ExternalUrl",
"url": "http://wandb.com/yourproject",
"authorizationType": "public",
"authorizedUsers": [
"user@company.ai",
"another@company.ai"
],
"authorizedGroups": [
"group-a",
"group-b"
],
"containerPort": 8080
}
],
"name": "pytorch",
"id": "123e4567-e89b-12d3-a456-426614174000",
"replicaType": "Master"
}
],
"externalConnections": [
{
"name": "my-pytorch-env",
"toolType": "pytorch",
"connectionType": "ExternalUrl",
"url": "http://wandb.com/yourproject",
"authorizationType": "public",
"authorizedUsers": [
"user@company.ai",
"another@company.ai"
],
"authorizedGroups": [
"group-a",
"group-b"
],
"containerPort": 8080
}
],
"distributedFramework": "Pytorch",
"additionalFields": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"preemptible": true,
"environmentVariables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"command": "sleep",
"arguments": "1000",
"phaseReason": "text",
"idleAllocatedGpus": 1,
"totalPendingTimeSeconds": 60,
"totalRunningTimeSeconds": 60,
"category": "Train",
"guaranteedRuntimeEndsAt": "2025-08-01T03:49:52.531Z",
"aiApplicationId": "text",
"aiApplicationName": "text",
"sourceApi": "WorkloadsV2",
"topology": {
"name": "text",
"preferredPlacement": "text",
"requiredPlacement": "text",
"actualPlacement": {
"level": "text",
"value": "text"
}
},
"endpoints": [
{
"host": "text",
"port": 1,
"path": "text",
"tlsEnabled": true,
"protocol": "text",
"url": "text"
}
],
"kubernetesRef": {
"group": "text",
"version": "text"
},
"pendingSchedulingMessages": [
{
"nodePool": "default",
"phaseReason": "NonPreemptibleOverQuota",
"reason": "Non-preemptible over quota",
"orgType": "text",
"userMessage": "You have reached the limit of non-preemptible resources"
}
]
}Retrieve the number of workloads.
Bearer authentication
Return only deleted resources when true.
Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contain, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.
["name!=some-workload-name","allocatedGPU>=2","createdAt>=2021-01-01T00:00:00Z"]Filter results by a free text search.
test projectExecuted successfully.
1Unauthorized
Forbidden
unexpected error
unexpected error
GET /api/v1/workloads/count HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"count": 1
}Retrieves workload data by telemetry type. Optionally filter by specific workload phases.
Telemetry Types:
WORKLOADS_COUNT: Count of workloads
GPU_ALLOCATION: GPU allocation metrics
PENDING_TIME_DISTRIBUTION: Distribution of workloads by current pending time (time since entering Pending phase).
For this type, results are automatically grouped by 4 time buckets and any additional groupBy parameters.
IDLE_ALLOCATED_GPUS: Sum of idle allocated GPU devices across workloads
Bearer authentication
Filter using the Universally Unique Identifier (UUID) of the cluster.
d73a738f-fab3-430a-8fa3-5241493d7128Filter using the nodepool.
defaultFilter using the department id.
1project id to filter by
1Select a telemetry type.
Executed successfully.
specifies what data returned
ALLOCATION_RATIO2023-06-06 12:09:18.211Bad request.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/telemetry?telemetryType=WORKLOADS_COUNT HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"type": "ALLOCATION_RATIO",
"timestamp": "2023-06-06 12:09:18.211",
"values": [
{
"value": "85",
"groups": [
{
"key": "department",
"value": "1",
"name": "department-A"
}
]
}
]
}Retrieves workloads data metrics from the metrics database. Use in reporting and analysis tools.
Bearer authentication
The Universally Unique Identifier (UUID) of the workload.
Start date of time range to fetch data in ISO 8601 timestamp format.
2023-06-06T12:09:18.211ZEnd date of time range to fetch data in ISO 8601 timestamp format.
2023-06-07T12:09:18.211ZThe number of samples to take in the specified time range.
20Example: 20Executed successfully.
Partial success.
Bad request.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/{workloadId}/metrics?metricType=GPU_UTILIZATION&start=2023-06-06T12%3A09%3A18.211Z&end=2023-06-07T12%3A09%3A18.211Z HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"measurements": [
{
"type": "ALLOCATED_GPU",
"labels": {
"gpu": "0"
},
"values": [
{
"value": "85",
"timestamp": "2024-12-20T14:30:00Z"
},
{
"value": "92",
"timestamp": "2024-12-20T14:30:30Z"
},
{
"value": "78",
"timestamp": "2024-12-20T14:37:00Z"
}
]
}
],
"histogram": [
{
"type": "NIM_TIME_TO_FIRST_TOKEN_SECONDS",
"values": [
{
"timestamp": "2024-12-20T14:30:00Z",
"data": {
"0.001": "45",
"0.005": "178",
"0.01": "312",
"0.05": "624",
"0.1": "812",
"0.5": "980",
"1.0": "1004",
"2.0": "1015",
"+Inf": "1024"
}
},
{
"timestamp": "2024-12-20T14:30:30Z",
"data": {
"0.001": "32",
"0.005": "152",
"0.01": "288",
"0.05": "576",
"0.1": "756",
"0.5": "908",
"1.0": "932",
"2.0": "943",
"+Inf": "960"
}
}
]
},
{
"type": "NIM_TIME_TO_FIRST_TOKEN_SECONDS_PERCENTILES",
"values": [
{
"timestamp": "2024-12-20T14:30:00Z",
"data": {
"p50": "0.0734",
"p90": "0.1892",
"p99": "0.2847"
}
},
{
"timestamp": "2024-12-20T14:30:30Z",
"data": {
"p50": "0.0823",
"p90": "0.2134",
"p99": "0.3156"
}
}
]
}
]
}Retrieve the network endpoints exposed by a workload using a workload ID.
Bearer authentication
The Universally Unique Identifier (UUID) of the workload.
Executed successfully.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/{workloadId}/endpoints HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"endpoints": [
{
"host": "text",
"port": 1,
"path": "text",
"tlsEnabled": true,
"protocol": "text",
"url": "text"
}
]
}Retrieve the hierarchy structure elements for a workload. Returns a flat list ordered by level. Requires cluster version >= 2.25.
Bearer authentication
The Universally Unique Identifier (UUID) of the workload.
The offset of the first item returned in the collection.
100The maximum number of entries to return.
50Executed successfully.
Offset for the next page of results. Present only when there are more elements beyond the current page (i.e., the number of returned elements equals the limit).
Bad request.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/{workloadId}/elements HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"next": 1,
"elements": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"hierarchyLevel": 1,
"parentId": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2022-01-01T03:49:52.531Z",
"kubernetesRef": {
"uid": "text",
"name": "text",
"gvk": {
"group": "text",
"version": "text",
"kind": "text"
}
}
}
]
}Retrieve a specific structure element for a workload, including aggregated requested and allocated resources from pods linked to this element. Completed pods are excluded from aggregation. Requires cluster version >= 2.25.
Bearer authentication
The Universally Unique Identifier (UUID) of the workload.
The unique identifier of the structure element.
Executed successfully.
The unique identifier of the structure element.
The display name of the structure element.
The position of the element in the workload structure hierarchy. Valid values are 1 (top-level), 2, and 3.
The unique identifier of the parent element. Empty for level 1 elements, whose parent is implicitly the workload.
The timestamp when the structure element was created.
2022-01-01T03:49:52.531ZBad request.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/{workloadId}/elements/{elementId} HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"hierarchyLevel": 1,
"parentId": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2022-01-01T03:49:52.531Z",
"kubernetesRef": {
"uid": "text",
"name": "text",
"gvk": {
"group": "text",
"version": "text",
"kind": "text"
}
},
"podsRequestedResources": {
"gpuRequestType": "portion",
"gpu": {
"limit": 1.5,
"request": 1
},
"gpuMemory": {
"limit": "2G",
"request": "200M"
},
"cpu": {
"limit": 1.5,
"request": 1
},
"cpuMemory": {
"limit": "2G",
"request": "200M"
},
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"allocatedResources": {
"gpu": 1.5,
"gpuMemory": "200Mi",
"cpu": 0.5,
"cpuMemory": "0B",
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"topology": {
"name": "text",
"actualPlacement": {
"level": "text",
"value": "text"
}
}
}Retrieve metrics data for a specific workload structure element. Requires cluster version 2.25 or later.
Bearer authentication
The Universally Unique Identifier (UUID) of the workload.
The unique identifier of the structure element.
Start date of time range to fetch data in ISO 8601 timestamp format.
2023-06-06T12:09:18.211ZEnd date of time range to fetch data in ISO 8601 timestamp format.
2023-06-07T12:09:18.211ZThe number of samples to take in the specified time range.
20Example: 20Executed successfully.
Partial success.
Bad request.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/{workloadId}/elements/{elementId}/metrics?metricType=GPU_UTILIZATION&start=2023-06-06T12%3A09%3A18.211Z&end=2023-06-07T12%3A09%3A18.211Z HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"measurements": [
{
"type": "ALLOCATED_GPU",
"labels": {
"gpu": "0"
},
"values": [
{
"value": "85",
"timestamp": "2024-12-20T14:30:00Z"
},
{
"value": "92",
"timestamp": "2024-12-20T14:30:30Z"
},
{
"value": "78",
"timestamp": "2024-12-20T14:37:00Z"
}
]
}
],
"histogram": [
{
"type": "NIM_TIME_TO_FIRST_TOKEN_SECONDS",
"values": [
{
"timestamp": "2024-12-20T14:30:00Z",
"data": {
"0.001": "45",
"0.005": "178",
"0.01": "312",
"0.05": "624",
"0.1": "812",
"0.5": "980",
"1.0": "1004",
"2.0": "1015",
"+Inf": "1024"
}
},
{
"timestamp": "2024-12-20T14:30:30Z",
"data": {
"0.001": "32",
"0.005": "152",
"0.01": "288",
"0.05": "576",
"0.1": "756",
"0.5": "908",
"1.0": "932",
"2.0": "943",
"+Inf": "960"
}
}
]
},
{
"type": "NIM_TIME_TO_FIRST_TOKEN_SECONDS_PERCENTILES",
"values": [
{
"timestamp": "2024-12-20T14:30:00Z",
"data": {
"p50": "0.0734",
"p90": "0.1892",
"p99": "0.2847"
}
},
{
"timestamp": "2024-12-20T14:30:30Z",
"data": {
"p50": "0.0823",
"p90": "0.2134",
"p99": "0.3156"
}
}
]
}
]
}Returns the total count of structure elements reported by the cluster and the count of elements stored in the database for the given workload. Requires cluster version >= 2.25.
Bearer authentication
The Universally Unique Identifier (UUID) of the workload.
Executed successfully.
The number of structure elements stored for this workload. When truncation occurs, this will be less than totalElementsCount.
The total number of structure elements that exist for this workload. When no truncation occurred, this equals storedElementsCount.
Bad request.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/{workloadId}/elements/count HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"storedElementsCount": 1,
"totalElementsCount": 1
}Last updated