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

# Create a machine

> Provisions a new machine in the specified cluster with the given compute configuration.



## OpenAPI

````yaml /openapi.json post /v1/compute/machines
openapi: 3.1.0
info:
  title: CNAP API
  version: 1.0.0
  description: >-
    Public API for managing CNAP workspaces, clusters, templates, products, and
    deployments.


    Authenticate with a Personal Access Token via the `Authorization: Bearer
    cnap_pat_...` header.


    Workspace-scoped endpoints require the `X-Workspace-Id` header.
servers:
  - url: https://api.cnap.tech
    description: Production
security: []
paths:
  /v1/compute/machines:
    post:
      tags:
        - Compute
      summary: Create a machine
      description: >-
        Provisions a new machine in the specified cluster with the given compute
        configuration.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                config_ref:
                  type: string
                  description: ComputeConfig ID
                cluster_id:
                  type: string
                  description: Cluster ID
                node_claim:
                  description: Machine requirements (instance type, resources, taints)
              required:
                - config_ref
                - cluster_id
      responses:
        '201':
          description: Machine created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Config not found (NodeClassNotReady)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComputeError'
        '503':
          description: No capacity available (InsufficientCapacity)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComputeError'
      security:
        - BearerAuth: []
components:
  schemas:
    Machine:
      type: object
      properties:
        provider_id:
          type: string
          example: compute://abc123
        node_name:
          type: string
          example: worker-xl8r2
        status:
          type: string
          example: provisioning
      required:
        - provider_id
        - node_name
        - status
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: not_found
            message:
              type: string
              example: Resource not found
            param:
              type: string
              description: The request field that caused the error
              example: name
            suggestion:
              type: string
              example: Run `cnap clusters list` to see available clusters
            details: {}
          required:
            - code
            - message
      required:
        - error
    ComputeError:
      type: object
      properties:
        type:
          type: string
          example: InsufficientCapacity
          description: >-
            Machine-readable error type (e.g., InsufficientCapacity,
            NodeClaimNotFound)
        message:
          type: string
          example: cpx31 out of stock in fsn1
      required:
        - type
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Personal Access Token (cnap_pat_...) or OAuth2 JWT. Create tokens at
        https://cnap.tech/account/tokens

````