> ## Documentation Index
> Fetch the complete documentation index at: https://docs.primeintellect.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Factory Utilization

> The team's Model Factory utilization curve: Slurm node
allocated/idle counts per bucket, derived from the slurmdbd
accounting record with the live jobs read as the truth for the
current bucket. Per-source freshness travels in `sources`; gaps
are gaps, never zero-filled.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json get /api/v1/factory/utilization
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/factory/utilization:
    get:
      tags:
        - factory
      summary: Get Factory Utilization
      description: |-
        The team's Model Factory utilization curve: Slurm node
        allocated/idle counts per bucket, derived from the slurmdbd
        accounting record with the live jobs read as the truth for the
        current bucket. Per-source freshness travels in `sources`; gaps
        are gaps, never zero-filled.
      operationId: get_factory_utilization_api_v1_factory_utilization_get
      parameters:
        - name: team_id
          in: query
          required: true
          schema:
            type: string
            description: Team whose Model Factory fleet to read
            title: Team Id
          description: Team whose Model Factory fleet to read
        - name: window
          in: query
          required: false
          schema:
            enum:
              - 1h
              - 24h
              - 7d
              - 30d
              - 90d
            type: string
            description: >-
              Curve window; bucket sizes scale with the window (1h->1min,
              24h->5min, 7d->hourly, 30d->3h, 90d->daily)
            default: 24h
            title: Window
          description: >-
            Curve window; bucket sizes scale with the window (1h->1min,
            24h->5min, 7d->hourly, 30d->3h, 90d->daily)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FactoryUtilizationResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    FactoryUtilizationResponse:
      properties:
        schema_version:
          type: integer
          enum:
            - 1
          const: 1
          title: Schema Version
          default: 1
        as_of:
          type: string
          format: date-time
          title: As Of
        window:
          type: string
          enum:
            - 1h
            - 24h
            - 7d
            - 30d
            - 90d
          title: Window
        bucket_seconds:
          type: integer
          title: Bucket Seconds
        clusters:
          items:
            $ref: '#/components/schemas/FactoryClusterUtilization'
          type: array
          title: Clusters
      additionalProperties: false
      type: object
      required:
        - as_of
        - window
        - bucket_seconds
        - clusters
      title: FactoryUtilizationResponse
      description: |-
        Envelope for the cluster utilization curve (public + internal
        routes).
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    FactoryClusterUtilization:
      properties:
        display_name:
          type: string
          title: Display Name
        status:
          type: string
          enum:
            - online
            - offline
          title: Status
        total_nodes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Nodes
        derived_from:
          type: string
          enum:
            - accounting
          const: accounting
          title: Derived From
          default: accounting
        series:
          items:
            $ref: '#/components/schemas/FactoryNodeUtilizationPoint'
          type: array
          title: Series
          default: []
        source:
          anyOf:
            - $ref: '#/components/schemas/FactorySourceStatus'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - display_name
        - status
      title: FactoryClusterUtilization
      description: |-
        One cluster's node-allocation curve (the "Cluster utilization").

        DERIVATION (honesty contract): the series is derived from the
        slurmdbd accounting job records — a node counts as allocated for the
        whole bucket in which a job's [start, end) interval overlaps it.
        Approximations, documented here and rendered as such:
        - a node held by ANY job counts as allocated (Slurm's own
          allocated/mixed distinction is not recoverable from this source);
        - the denominator (`total_nodes`) is the deployment's CURRENT
          claimed-node count from the capacity snapshot — node-count
          history is not persisted, so `idle` assumes the fleet was its
          current size across the window;
        - `draining` (and drain/down nodes inside `idle`) are not derivable
          from accounting; draining stays null and idle may include nodes
          that were down or draining;
        - a failed accounting read surfaces through `source` (ok/stale/
          error) with the partial curve still served, exactly like the
          workloads feed's degraded-source rule — never a silent gap.
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
    FactoryNodeUtilizationPoint:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        allocated:
          anyOf:
            - type: integer
            - type: 'null'
          title: Allocated
        idle:
          anyOf:
            - type: integer
            - type: 'null'
          title: Idle
        draining:
          anyOf:
            - type: integer
            - type: 'null'
          title: Draining
      additionalProperties: false
      type: object
      required:
        - timestamp
      title: FactoryNodeUtilizationPoint
      description: |-
        One bucket of the node-allocation curve (bucket-start timestamp).

        `allocated` = distinct nodes held by any job during the bucket
        (union across overlapping jobs; None = unreadable node evidence
        for the bucket — never zero-filled). `idle` = the cluster's
        current claimed node count minus allocated; None when the
        denominator is unknown or allocated is null (never zero-filled,
        never negative). `draining` is always None in v1: node states over
        time need a sampler the platform does not have — the field exists
        so the contract never lies about what is known.
    FactorySourceStatus:
      properties:
        kind:
          type: string
          enum:
            - capacity
            - training
            - inference
            - slurm
          title: Kind
        status:
          type: string
          enum:
            - ok
            - stale
            - error
          title: Status
        observed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Observed At
      additionalProperties: false
      type: object
      required:
        - kind
        - status
      title: FactorySourceStatus
      description: |-
        Freshness/coverage entry for one evidence source.

        EXACTLY these three keys. No source id, adapter detail, endpoint or
        raw error may ever be added here.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.