---
title: "Get Factory Workloads"
method: GET
path: "/api/v1/factory/workloads"
tags: ["factory"]
---

# Get Factory Workloads

`GET /api/v1/factory/workloads`

## Request

- Base URL: `https://api.primeintellect.ai`
- URL: `https://api.primeintellect.ai/api/v1/factory/workloads`
- Auth: HTTP bearer

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.

## Query parameters

- `team_id` string, required: Team whose Model Factory fleet to read
- `workload_type` 'training' | 'inference' | 'slurm': Limit rows to one workload type (legacy spelling; the frozen-contract `type` wins when both are sent)
- `type` 'training' | 'inference' | 'slurm': Limit rows to one workload type (the frozen-contract spelling of the filter)
- `state` 'running' | 'queued' | 'completed' | 'failed' | 'all': Limit rows to one normalized state, or 'all' (every mappable state); default is running + queued
- `since` string, date-time, nullable: ISO-8601 bound: rows whose completion (terminal rows) or creation stamp is older are excluded
- `limit` integer, nullable: Row bound (1..200); defaults to 200 for every window (the response carries `truncated` when matching rows exist beyond the page)

## Response `200`

Successful Response

- FactoryWorkloadsResponse: Envelope for the workloads feed (public + internal routes). `truncated` is True when matching rows existed beyond the returned page (default/explicit limit, cap 200) — consumers surface a "+N more" affordance instead of presenting the page as the whole queue. Absent/False means the page IS every matching row.
  - `schema_version` 1
  - `as_of` string, date-time, required
  - `workloads` FactoryWorkload[], required
    - `id` string, required
    - `type` 'training' | 'inference' | 'slurm', required
    - `cluster_display_name` string, required
    - `name` string, nullable
    - `state` 'queued' | 'running' | 'stopping' | 'completed' | 'failed' | 'unknown', required
    - `native_state` string, nullable
    - `owner` WorkloadOwner, required: Who owns one workload — display identity only, never internal. `kind="prime"` shows only the linked Prime user's public display name (never email, internal user id or any other identity field). `kind="slurm"` shows the native Slurm username when resolvable (the slurmrestd-reported name or the platform-provisioned roster mapping of the wire's numeric uid), OR the numeric uid string when the name is unresolvable — e.g. out-of-band Slurm users created directly on the cluster: the uid is the native identity of record the live wire always carries, matching squeue's own rendering of unresolved users. `kind` stays "slurm" in both cases. `kind="unknown"` (display_name null) is reserved for jobs with NO user identity on the wire. A Slurm deployment owner is NOT assumed to own jobs other users submitted. Nulls stay null and are never disguised with an empty string or a fallback id/email.
      - `kind` 'prime' | 'slurm' | 'unknown', required
      - `display_name` string, nullable
    - `requested_gpus` integer, nullable
    - `allocated_gpus` integer, nullable
    - `created_at` string, date-time, nullable
    - `started_at` string, date-time, nullable
    - `ended_at` string, date-time, nullable
    - `scheduler_display_name` string, nullable
    - `source` WorkloadSource, required: Freshness/coverage entry for the evidence behind one row. EXACTLY these three keys (same vocabulary as FactorySourceStatus). No source id, adapter detail, endpoint or raw error may ever be added here.
      - `kind` 'training' | 'inference' | 'slurm', required
      - `status` 'ok' | 'stale' | 'error', required
      - `observed_at` string, date-time, nullable
  - `sources` WorkloadSource[], required
    - `kind` 'training' | 'inference' | 'slurm', required
    - `status` 'ok' | 'stale' | 'error', required
    - `observed_at` string, date-time, nullable
  - `truncated` boolean

## Other responses

- `401`: Authorization failed
- `422`: Invalid request data

## Changes

> 49 revisions in range; 1 not diffed.

- **2026-10-12** `8537b45307ec`: 1 info
  - added the optional property `truncated` to the response with the `200` status
- **2026-10-11** `9062b670646d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/primeintellect/apis/pi-api/changes/api/v1/factory/workloads/get.md)

---

[API](https://skmtc.dev/primeintellect/apis/pi-api.md) - [All operations](https://skmtc.dev/primeintellect/apis/pi-api/llms.txt) - [OpenAPI document](https://skmtc.dev/primeintellect/apis/pi-api/revisions/7f032a9306b0?raw)
