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

# Create a virtual machine

> Provision a new VM. Charges the user wallet immediately for the first cycle (plus any addons) and enqueues the create action. Returns 202 with the VM detail and the action id to poll. Requires the `vms:write` scope.



## OpenAPI

````yaml https://api.vmarea.com/api/public/v1/openapi.json post /api/public/v1/vms
openapi: 3.1.0
info:
  title: VMArea Public API
  version: 1.0.0
  description: >-
    The VMArea Public API lets you provision and manage VMs, networks,
    firewalls, SSH keys, backups, and webhooks programmatically. Authenticate
    every request with an API token (`x-api-key` header) created in the
    dashboard. Tokens carry coarse scopes (e.g. `vms:write`); endpoints reject
    calls that lack the scope they require.
  contact:
    name: VMArea Support
    url: https://vmarea.com/support
servers:
  - url: https://api.vmarea.com/api/v1
    description: Production
security:
  - ApiKey: []
paths:
  /api/public/v1/vms:
    post:
      tags:
        - VMs
      summary: Create a virtual machine
      description: >-
        Provision a new VM. Charges the user wallet immediately for the first
        cycle (plus any addons) and enqueues the create action. Returns 202 with
        the VM detail and the action id to poll. Requires the `vms:write` scope.
      operationId: createVm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                regionId:
                  type: string
                  pattern: ^[cC][^\s-]{8,}$
                osTemplateId:
                  type: string
                  pattern: ^[cC][^\s-]{8,}$
                planId:
                  type: string
                  pattern: ^[cC][^\s-]{8,}$
                customConfig:
                  type: object
                  properties:
                    vcpu:
                      type: integer
                      minimum: 1
                      maximum: 64
                    ram:
                      type: integer
                      minimum: 512
                      maximum: 262144
                    disk:
                      type: integer
                      minimum: 10
                      maximum: 1024
                    bandwidth:
                      type: integer
                      minimum: -1
                  required:
                    - vcpu
                    - ram
                    - disk
                    - bandwidth
                  additionalProperties: false
                hostname:
                  type: string
                  minLength: 1
                  maxLength: 63
                  pattern: ^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$
                password:
                  type: string
                  minLength: 8
                  maxLength: 128
                sshKeyIds:
                  type: array
                  items:
                    type: string
                    pattern: ^[cC][^\s-]{8,}$
                  maxItems: 20
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                dailyBackupEnabled:
                  type: boolean
                  default: false
                network10gEnabled:
                  type: boolean
                  default: false
                isProtected:
                  type: boolean
                  default: false
                firewallIds:
                  type: array
                  items:
                    type: string
                    pattern: ^[cC][^\s-]{8,}$
                  maxItems: 10
                  default: []
                privateNetworkIds:
                  type: array
                  items:
                    type: string
                    pattern: ^[cC][^\s-]{8,}$
                  maxItems: 5
                  default: []
              required:
                - regionId
                - osTemplateId
                - hostname
              additionalProperties: false
      responses:
        '202':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      vm:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          hostname:
                            type: string
                          status:
                            type: string
                          vcpu:
                            type: integer
                          ram:
                            type: integer
                          disk:
                            type: integer
                          bandwidth:
                            type: integer
                          networkSpeed:
                            type: integer
                          network10gEnabled:
                            type: boolean
                          dailyBackupEnabled:
                            type: boolean
                          isProtected:
                            type: boolean
                          ipAddress:
                            type: string
                            nullable: true
                          region:
                            type: object
                            properties:
                              slug:
                                type: string
                              name:
                                type: string
                            required:
                              - slug
                              - name
                            additionalProperties: false
                            nullable: true
                          plan:
                            type: object
                            properties:
                              slug:
                                type: string
                              name:
                                type: string
                              priceMonthly: {}
                            required:
                              - slug
                              - name
                            additionalProperties: false
                            nullable: true
                          osTemplate:
                            type: object
                            properties:
                              slug:
                                type: string
                              name:
                                type: string
                              version:
                                type: string
                                nullable: true
                            required:
                              - slug
                              - name
                              - version
                            additionalProperties: false
                            nullable: true
                          billing:
                            type: object
                            properties:
                              priceMonthly: {}
                              nextRenewalAt:
                                type: string
                                format: date-time
                                nullable: true
                              status:
                                type: string
                            required:
                              - nextRenewalAt
                              - status
                            additionalProperties: false
                            nullable: true
                          createdAt:
                            type: string
                            format: date-time
                          bandwidthUsedBytes:
                            type: number
                          bandwidthPackBytes:
                            type: string
                          sshKeys:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                                fingerprint:
                                  type: string
                              required:
                                - id
                                - name
                                - fingerprint
                              additionalProperties: false
                          firewalls:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                              required:
                                - id
                                - name
                              additionalProperties: false
                          privateNetworks:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                              required:
                                - id
                                - name
                              additionalProperties: false
                          updatedAt:
                            type: string
                            format: date-time
                        required:
                          - id
                          - name
                          - hostname
                          - status
                          - vcpu
                          - ram
                          - disk
                          - bandwidth
                          - networkSpeed
                          - network10gEnabled
                          - dailyBackupEnabled
                          - isProtected
                          - ipAddress
                          - region
                          - plan
                          - osTemplate
                          - billing
                          - createdAt
                          - bandwidthUsedBytes
                          - bandwidthPackBytes
                          - sshKeys
                          - firewalls
                          - privateNetworks
                          - updatedAt
                        additionalProperties: false
                        nullable: true
                      actionId:
                        type: string
                    required:
                      - vm
                      - actionId
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                required:
                  - success
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                required:
                  - success
                  - error
                additionalProperties: false
        '402':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                required:
                  - success
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                required:
                  - success
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: string
                required:
                  - success
                  - error
                additionalProperties: false
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        Long-lived API token created at
        https://vmarea.com/dashboard/settings/api-keys. Tokens are
        scope-restricted; this spec lists the scope each endpoint requires.

````