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

# Create cluster

> Provision a GPU cluster. Poll `GET /request/info/{request_id}` to track progress.



## OpenAPI

````yaml https://engine.tensorpool.dev/openapi.json post /cluster/create
openapi: 3.1.0
info:
  title: TensorPool API
  description: >
    TensorPool API


    All API endpoints (except `/healthz`) require authentication using your
    TensorPool API key.


    ### For REST Endpoints


    Include your API key in the `Authorization` header as a Bearer token:


    ```bash

    Authorization: Bearer YOUR_TENSORPOOL_KEY

    ```

    ### For WebSocket Endpoints


    Send your API key as the first message in JSON format:


    ```json

    {"TENSORPOOL_KEY": "YOUR_TENSORPOOL_KEY"}

    ```
  version: 0.1.0
servers: []
security: []
tags:
  - name: job
    description: >-
      GPU job execution and management. Run workloads on ephemeral clusters with
      automatic cleanup.
  - name: cluster
    description: >-
      GPU cluster provisioning and lifecycle management. Create persistent
      compute resources.
  - name: storage
    description: >-
      Shared storage volume management. Persistent storage that can be attached
      to eligible clusters.
  - name: object-storage
    description: S3-compatible object storage management.
  - name: ssh
    description: SSH key management for secure cluster access.
  - name: user
    description: >-
      User account management including balance, billing, and organization
      operations.
  - name: requests
    description: Cloud resource provisioning request tracking and status monitoring.
paths:
  /cluster/create:
    post:
      tags:
        - cluster
      summary: Create cluster
      description: >-
        Provision a GPU cluster. Poll `GET /request/info/{request_id}` to track
        progress.
      operationId: cluster_create_cluster_create_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClusterCreateRestRequest'
        required: true
      responses:
        '202':
          description: Cluster creation initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClusterCreateRestResponse'
        '400':
          description: Invalid parameters or cluster name conflict
        '402':
          description: Insufficient balance
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
      security:
        - HTTPBearer: []
components:
  schemas:
    ClusterCreateRestRequest:
      properties:
        instance_type:
          type: string
          title: Instance Type
          description: >-
            GPU instance type (e.g., '1xH100', '8xH100', '1xH200', '8xH200',
            '8xB200'). See https://docs.tensorpool.dev/resources/instance-types
        public_keys:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Public Keys
          description: >-
            SSH public keys to add to cluster nodes. Combined with user and org
            saved keys.
          default: []
        num_nodes:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Num Nodes
          description: Number of nodes in the cluster
          default: 1
        tp_cluster_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tp Cluster Name
          description: Custom name for the cluster
        container:
          anyOf:
            - type: string
            - type: 'null'
          title: Container
          description: Container image for cluster instances
        deletion_protection:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Deletion Protection
          description: Enable deletion protection
          default: false
        save_keys:
          type: boolean
          title: Save Keys
          description: Save new SSH keys to user profile
          default: true
      type: object
      required:
        - instance_type
      title: ClusterCreateRestRequest
      description: Request body for POST /cluster/create.
    ClusterCreateRestResponse:
      properties:
        cluster_id:
          type: string
          title: Cluster Id
          description: TensorPool cluster ID
        instance_ids:
          items:
            type: string
          type: array
          title: Instance Ids
          description: List of instance IDs
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: Request ID for tracking
        message:
          type: string
          title: Message
          description: Status message
      type: object
      required:
        - cluster_id
        - message
      title: ClusterCreateRestResponse
      description: Response for POST /cluster/create.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````