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

# Create Vm

> Create a new VM with specified hardware requirements.
Requires sufficient credits and calls the VM provisioning service.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/external/vms/create
openapi: 3.1.0
info:
  title: Lyceum Cloud Execution API
  version: 0.1.0
servers: []
security: []
paths:
  /api/v2/external/vms/create:
    post:
      tags:
        - VMs
      summary: Create Vm
      description: |-
        Create a new VM with specified hardware requirements.
        Requires sufficient credits and calls the VM provisioning service.
      operationId: create_vm_api_v2_external_vms_create_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVMRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VMResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateVMRequest:
      properties:
        user_public_key:
          type: string
          minLength: 1
          title: User Public Key
        hardware_profile:
          type: string
          title: Hardware Profile
        instance_specs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Instance Specs
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
        instance_type:
          type: string
          enum:
            - on-demand
            - spot
          title: Instance Type
          default: on-demand
      type: object
      required:
        - user_public_key
        - hardware_profile
      title: CreateVMRequest
      description: Request model for creating a new VM.
    VMResponse:
      properties:
        vm_id:
          type: string
          title: Vm Id
        status:
          type: string
          title: Status
        ip_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Ip Address
        created_at:
          type: string
          format: date-time
          title: Created At
        instance_specs:
          additionalProperties: true
          type: object
          title: Instance Specs
        hardware_profile:
          anyOf:
            - type: string
            - type: 'null'
          title: Hardware Profile
        gpu_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Gpu Count
        instance_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Instance Type
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
        billed:
          anyOf:
            - type: number
            - type: 'null'
          title: Billed
        croesus_billed:
          anyOf:
            - type: number
            - type: 'null'
          title: Croesus Billed
        status_check_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Check Url
        polling_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Polling Message
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Id
      type: object
      required:
        - vm_id
        - status
        - created_at
        - instance_specs
      title: VMResponse
      description: Response model for VM operations.
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````