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

# Create VM

> Create a new VM instance

Create a new VM instance in a project.

### Required Parameters

* `name`: VM name
* `type`: VM type/size
* `location`: Deployment location
* `ssh_public_key`: SSH public key for access

### Optional Parameters

* `image`: OS image name
* `disks`: Additional disk configurations
* `startup_script`: Script to run on startup
* `shutdown_script`: Script to run on shutdown


## OpenAPI

````yaml POST /projects/{id}/vms
openapi: 3.1.0
info:
  title: mkinf API v0.1
  description: ''
  version: 1.0.0
servers:
  - url: https://api.mkinf.io/v0.1
    description: Prod Env
security: []
tags: []
paths:
  /projects/{id}/vms:
    post:
      tags: []
      summary: Create VM
      description: Create a new VM instance
      parameters:
        - name: id
          in: path
          description: Project id
          required: true
          example: b3e571f6-c87d-4135-8081-ab219e92544e
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name
                type:
                  type: string
                  description: VM Type
                image:
                  type: string
                  description: Image name
                location:
                  type: string
                  description: Location
                ssh_public_key:
                  type: string
                  description: SSH public key
                disks:
                  type: array
                  items:
                    type: object
                    properties:
                      disk_id:
                        type: string
                        description: Disk id
                      attachment_type:
                        type: string
                        enum:
                          - os
                          - data
                        description: Attachment type
                      mode:
                        type: string
                        enum:
                          - read-only
                          - read-write
                        description: Attachment mode
                    required:
                      - attachment_type
                      - disk_id
                      - mode
                    description: Disk
                  description: Disks
                startup_script:
                  type: string
                  description: Startup script
                shutdown_script:
                  type: string
                  description: Shutdown script
              required:
                - name
                - ssh_public_key
                - type
                - location
            example:
              name: mkinf-node-01
              type: l40s-48gb.1x
              location: us-east1-a
              image: ubuntu22.04-nvidia-pcie-docker
              ssh_public_key: ssh-rsa AAAAB...
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  operation:
                    type: object
                    properties:
                      completed_at:
                        type: string
                      metadata:
                        type: object
                        properties: {}
                      operation_id:
                        type: string
                      result:
                        type: object
                        properties: {}
                      started_at:
                        type: string
                      state:
                        type: string
                    required:
                      - completed_at
                      - metadata
                      - operation_id
                      - result
                      - started_at
                      - state
                required:
                  - operation
              examples:
                '1':
                  summary: Success
                  value:
                    operation:
                      completed_at: '2021-12-03T19:59:34Z'
                      metadata: {}
                      operation_id: F6EF489C-086E-458D-B812-7962964A28C9
                      result: {}
                      started_at: '2021-12-03T19:58:34Z'
                      state: IN_PROGRESS
          headers: {}
      deprecated: false
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````