> For the complete documentation index, see [llms.txt](https://docs.cloudeka.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudeka.ai/release-notes/cloudeka-api/ai-rafay/create-a-virtual-machine-instance.md).

# Create a virtual machine instance

```json
{"openapi":"3.1.1","info":{"title":"Cloudeka AI - API Documentation","version":"1.0.0"},"tags":[{"name":"AI Rafay","description":"API endpoints for AI Rafay (base: /rafay)"}],"servers":[{"url":"https://ai.cloudeka.id/"}],"paths":{"/rafay/v1/virtualmachine/instance/create":{"post":{"tags":["AI Rafay","Virtual Machine"],"summary":"Create a virtual machine instance","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ai_rafay__response.Response"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ai_rafay__response.Response"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ai_rafay__response.Response"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ai_rafay__request.RafayVirtualMachineCreate"}}},"description":"Request body","required":true}}}},"components":{"schemas":{"ai_rafay__response.Response":{"type":"object","properties":{"data":{},"error":{},"message":{"type":"string"},"upstream":{}}},"ai_rafay__request.RafayVirtualMachineCreate":{"type":"object","required":["controller_endpoint","gpu_count","gpu_name","name","node_selector","profile_name","project_id","service_port","service_type","target_port","username","vcluster_host_name","vcluster_host_namespace","vcluster_name","vcluster_namespace","vm_boot_size","vm_cpu_count","vm_image","vm_memory_size","vm_name","vm_ssh_public_key","vm_user"],"properties":{"api_key":{"type":"string"},"controller_endpoint":{"type":"string"},"gpu_count":{"type":"string"},"gpu_enabled":{"type":"string","enum":["true","false"]},"gpu_name":{"type":"string"},"name":{"type":"string"},"node_selector":{"type":"string"},"profile_name":{"type":"string"},"profile_system_catalog":{"type":"boolean"},"project_id":{"type":"string"},"service_port":{"type":"string"},"service_type":{"type":"string"},"target_port":{"type":"string"},"username":{"type":"string"},"vcluster_host_name":{"type":"string"},"vcluster_host_namespace":{"type":"string"},"vcluster_name":{"type":"string"},"vcluster_namespace":{"type":"string"},"vm_boot_size":{"type":"string"},"vm_cpu_count":{"type":"string"},"vm_image":{"type":"string"},"vm_memory_size":{"type":"string"},"vm_name":{"type":"string"},"vm_password":{"type":"string"},"vm_ssh_public_key":{"type":"string"},"vm_user":{"type":"string"}}}}}}
```
