> ## 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.

# Resize Cluster

> Resize a Slurm cluster by changing its worker node count.

Requires `factory:write` (see module docstring); `slurm_clusters`
scopes alone are rejected. Team-admin gated like add/remove member.
The cluster must have
self-service enabled (checked by the resize service). Grows by
claiming eligible idle nodes (same filters as deploy); shrinks by
releasing only idle nodes, never touching running jobs.

Returns the verified membership after the mutation settles — the
actual final size may differ from the request if node release was
best-effort and fell short.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /api/v1/slurm-clusters/{team_id}/{job_id}/resize
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/slurm-clusters/{team_id}/{job_id}/resize:
    post:
      tags:
        - slurm-clusters
      summary: Resize Cluster
      description: |-
        Resize a Slurm cluster by changing its worker node count.

        Requires `factory:write` (see module docstring); `slurm_clusters`
        scopes alone are rejected. Team-admin gated like add/remove member.
        The cluster must have
        self-service enabled (checked by the resize service). Grows by
        claiming eligible idle nodes (same filters as deploy); shrinks by
        releasing only idle nodes, never touching running jobs.

        Returns the verified membership after the mutation settles — the
        actual final size may differ from the request if node release was
        best-effort and fell short.
      operationId: resize_cluster_api_v1_slurm_clusters__team_id___job_id__resize_post
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            title: Team Id
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            title: Job Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResizeClusterRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResizeClusterResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    ResizeClusterRequest:
      properties:
        numNodes:
          type: integer
          minimum: 1
          title: Numnodes
      type: object
      required:
        - numNodes
      title: ResizeClusterRequest
      description: |-
        Request to resize a Slurm cluster's worker node count.

        Target worker-node count (not a delta), so retried requests are
        idempotent. The service enforces a ceiling of max(64, current_size),
        so oversized clusters can shrink but not grow past 64.
    ResizeClusterResponse:
      properties:
        numNodes:
          type: integer
          title: Numnodes
        added:
          items:
            type: string
          type: array
          title: Added
        removed:
          items:
            type: string
          type: array
          title: Removed
      type: object
      required:
        - numNodes
        - added
        - removed
      title: ResizeClusterResponse
      description: |-
        Result of a cluster resize operation.

        Membership is verified from a fresh label listing after the
        mutation completes — never just the requested target — since label
        release is best-effort and can fall short.
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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