curl --request GET \
--url https://api.primeintellect.ai/api/v1/factory/workloads \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.primeintellect.ai/api/v1/factory/workloads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.primeintellect.ai/api/v1/factory/workloads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.primeintellect.ai/api/v1/factory/workloads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.primeintellect.ai/api/v1/factory/workloads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.primeintellect.ai/api/v1/factory/workloads")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/factory/workloads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"as_of": "2023-11-07T05:31:56Z",
"workloads": [
{
"id": "<string>",
"type": "training",
"cluster_display_name": "<string>",
"state": "queued",
"owner": {
"kind": "prime",
"display_name": "<string>"
},
"source": {
"kind": "training",
"status": "ok",
"observed_at": "2023-11-07T05:31:56Z"
},
"name": "<string>",
"native_state": "<string>",
"requested_gpus": 123,
"allocated_gpus": 123,
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"scheduler_display_name": "<string>"
}
],
"sources": [
{
"kind": "training",
"status": "ok",
"observed_at": "2023-11-07T05:31:56Z"
}
],
"schema_version": 1
}{
"errors": [
{
"param": "<string>",
"details": "<string>"
}
]
}Get Factory Workloads
The team’s Model Factory workloads feed (the squeue): leaf
training runs, inference deployments and native Slurm jobs with
owner, state, requested/allocated GPUs, per-source freshness and
— for terminal states (completed/failed/all) — the completion
stamp of the terminal record (ended_at), bounded and newest
first.
The selected team_id must be a team the token’s user is a
member of; data of other teams is never returned. The default
state window is running + queued. Windows that include terminal
states read the terminal records (RFTRun/Job rows; the slurmdbd
accounting read for native Slurm jobs) and are bounded to
limit rows (default 50, max 200), newest first; since bounds
them further by timestamp.
curl --request GET \
--url https://api.primeintellect.ai/api/v1/factory/workloads \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.primeintellect.ai/api/v1/factory/workloads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.primeintellect.ai/api/v1/factory/workloads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.primeintellect.ai/api/v1/factory/workloads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.primeintellect.ai/api/v1/factory/workloads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.primeintellect.ai/api/v1/factory/workloads")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/factory/workloads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"as_of": "2023-11-07T05:31:56Z",
"workloads": [
{
"id": "<string>",
"type": "training",
"cluster_display_name": "<string>",
"state": "queued",
"owner": {
"kind": "prime",
"display_name": "<string>"
},
"source": {
"kind": "training",
"status": "ok",
"observed_at": "2023-11-07T05:31:56Z"
},
"name": "<string>",
"native_state": "<string>",
"requested_gpus": 123,
"allocated_gpus": 123,
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"scheduler_display_name": "<string>"
}
],
"sources": [
{
"kind": "training",
"status": "ok",
"observed_at": "2023-11-07T05:31:56Z"
}
],
"schema_version": 1
}{
"errors": [
{
"param": "<string>",
"details": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Team whose Model Factory fleet to read
Limit rows to one workload type (legacy spelling; the frozen-contract type wins when both are sent)
training, inference, slurm Limit rows to one workload type (the frozen-contract spelling of the filter)
training, inference, slurm Limit rows to one normalized state, or 'all' (every mappable state); default is running + queued
running, queued, completed, failed, all ISO-8601 bound: rows whose completion (terminal rows) or creation stamp is older are excluded
Row bound (1..200); defaults to 50 server-side for state windows that include terminal states, unbounded otherwise
1 <= x <= 200Response
Successful Response
Was this page helpful?