Paperspace Machines API

Programmatically manage Paperspace virtual machines — GPU and CPU compute instances. Covers the machine lifecycle (create, start, stop, restart, delete), machine events, team-member access grants per machine, desktop streaming configuration, and a region-keyed machine-availability lookup.

OpenAPI Specification

paperspace-machines-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Paperspace Container Registries Activity Machines API
  version: v1
  description: 'Manage container registry credentials used by Paperspace Deployments to

    pull private images. Authenticate with a team-scoped API key as

    `Authorization: Bearer $API_TOKEN`.

    '
servers:
- url: https://api.paperspace.com/v1
  description: Production
security:
- bearerAuth: []
tags:
- name: Machines
  description: Virtual machine lifecycle and metadata.
paths:
  /machines:
    get:
      tags:
      - Machines
      operationId: listMachines
      summary: List Machines
      description: Fetches a list of machines visible to the caller's team.
      parameters:
      - $ref: '#/components/parameters/After'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/OrderBy'
      - $ref: '#/components/parameters/Order'
      responses:
        '200':
          description: A page of machines.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MachineList'
    post:
      tags:
      - Machines
      operationId: createMachine
      summary: Create Machine
      description: Provisions a new Paperspace machine in the specified region with the chosen machine type and template.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MachineCreate'
      responses:
        '201':
          description: Machine created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
  /machines/{id}:
    parameters:
    - $ref: '#/components/parameters/MachineId'
    get:
      tags:
      - Machines
      operationId: getMachine
      summary: Get Machine
      description: Fetches a single machine by ID.
      responses:
        '200':
          description: Machine.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
    put:
      tags:
      - Machines
      operationId: updateMachine
      summary: Update Machine
      description: Updates a machine — name, auto-shutdown, public IP, machine type, and other mutable fields.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MachineUpdate'
      responses:
        '200':
          description: Updated machine.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
    delete:
      tags:
      - Machines
      operationId: deleteMachine
      summary: Delete Machine
      description: Deletes a single machine by ID and releases the associated resources.
      responses:
        '204':
          description: Deleted.
  /machines/{id}/start:
    parameters:
    - $ref: '#/components/parameters/MachineId'
    patch:
      tags:
      - Machines
      operationId: startMachine
      summary: Start Machine
      description: Starts a stopped machine.
      responses:
        '200':
          description: Machine state transition acknowledged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
  /machines/{id}/stop:
    parameters:
    - $ref: '#/components/parameters/MachineId'
    patch:
      tags:
      - Machines
      operationId: stopMachine
      summary: Stop Machine
      description: Stops a running machine — compute billing pauses; storage continues to bill.
      responses:
        '200':
          description: Machine state transition acknowledged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
  /machines/{id}/restart:
    parameters:
    - $ref: '#/components/parameters/MachineId'
    patch:
      tags:
      - Machines
      operationId: restartMachine
      summary: Restart Machine
      description: Restarts a machine.
      responses:
        '200':
          description: Machine state transition acknowledged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
  /machines/{id}/desktop:
    parameters:
    - $ref: '#/components/parameters/MachineId'
    get:
      tags:
      - Machines
      operationId: getMachineDesktop
      summary: Get Desktop Streaming Configuration
      description: Retrieves desktop streaming configuration settings used by the Paperspace client.
      responses:
        '200':
          description: Desktop configuration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesktopConfig'
components:
  schemas:
    DesktopConfig:
      type: object
      properties:
        host:
          type: string
        token:
          type: string
        port:
          type: integer
        protocol:
          type: string
    MachineCreate:
      type: object
      required:
      - name
      - machineType
      - region
      - templateId
      properties:
        name:
          type: string
        machineType:
          type: string
        region:
          type: string
        templateId:
          type: string
        diskSize:
          type: integer
        startOnCreate:
          type: boolean
        publicIp:
          type: string
        autoShutdownTimeoutHours:
          type: integer
    MachineList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Machine'
        hasMore:
          type: boolean
        nextPage:
          type: string
    MachineUpdate:
      type: object
      properties:
        name:
          type: string
        machineType:
          type: string
        autoShutdownTimeoutHours:
          type: integer
        autoSnapshotFrequency:
          type: string
    Machine:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        state:
          type: string
          enum:
          - ready
          - false
          - starting
          - stopping
          - restarting
          - provisioning
          - serviceready
          - upgrading
          - failed
        machineType:
          type: string
          description: e.g. H100, A100-80G, A6000, V100, A5000, A4000, P6000.
        region:
          type: string
        os:
          type: string
        cpus:
          type: integer
        ram:
          type: integer
        gpu:
          type: string
        storageTotal:
          type: integer
        publicIp:
          type: string
          nullable: true
        privateIp:
          type: string
          nullable: true
        autoShutdownEnabled:
          type: boolean
        autoSnapshotEnabled:
          type: boolean
        teamId:
          type: string
        userId:
          type: string
        dtCreated:
          type: string
          format: date-time
        dtLastRun:
          type: string
          format: date-time
  parameters:
    MachineId:
      in: path
      name: id
      required: true
      schema:
        type: string
    OrderBy:
      in: query
      name: orderBy
      schema:
        type: string
    Limit:
      in: query
      name: limit
      schema:
        type: integer
        minimum: 1
        maximum: 120
    Order:
      in: query
      name: order
      schema:
        type: string
        enum:
        - asc
        - desc
    After:
      in: query
      name: after
      schema:
        type: string
      description: Pagination cursor.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: api-key