# VMs

## Create VM

> Create VM

```json
{"openapi":"3.1.0","info":{"title":"saas-platform","version":"1.0.0"},"tags":[{"name":"OpenapiVm","description":"OpenAPI VM API"}],"servers":[{"url":"https://api.yottalabs.ai","description":"Generated server url"}],"security":[{}],"paths":{"/openapi/v1/vms/create":{"post":{"tags":["OpenapiVm"],"summary":"Create VM","description":"Create VM","operationId":"create_2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenapiInstanceRentRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultOpenapiInstanceDetailResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}}}}}},"components":{"schemas":{"OpenapiInstanceRentRequest":{"type":"object","description":"Instance Rent Request","properties":{"vmTypeId":{"type":"integer","format":"int32","description":"machine model type id"},"region":{"type":"string","description":"region"},"regionId":{"type":"integer","format":"int32"},"nickName":{"type":"string","maxLength":255,"minLength":1},"isSpot":{"type":"integer","format":"int32","description":"is spot instance, 0: on-demand, 1: spot","maximum":1,"minimum":0},"volumeMountPaths":{"type":"object","additionalProperties":{"type":"string"},"description":"Volume mount paths mapping: volumeId -> mountPath. If not specified, default path will be used."}},"required":["isSpot","nickName","region","vmTypeId"]},"ResultOpenapiInstanceDetailResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/OpenapiInstanceDetailResponse","description":"data"}}},"OpenapiInstanceDetailResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"orgId":{"type":"string"},"nickname":{"type":"string"},"gpuDisplayName":{"type":"string"},"ipAddress":{"type":"string"},"domainName":{"type":"string"},"cpuCores":{"type":"integer","format":"int32"},"memoryInGb":{"type":"string"},"gpuCount":{"type":"integer","format":"int32"},"gpuMemoryInGb":{"type":"string"},"region":{"type":"string"},"storageInGb":{"type":"string"},"notebookUrl":{"type":"string"},"sshTemplate":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"terminatedAt":{"type":"integer","format":"int64"},"updatedAt":{"type":"integer","format":"int64"},"osInfo":{"type":"string"},"gpuType":{"type":"string"},"isSpot":{"type":"integer","format":"int32"}}},"ResultObject":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Terminate VM

> Terminate VM

```json
{"openapi":"3.1.0","info":{"title":"saas-platform","version":"1.0.0"},"tags":[{"name":"OpenapiVm","description":"OpenAPI VM API"}],"servers":[{"url":"https://api.yottalabs.ai","description":"Generated server url"}],"security":[{}],"paths":{"/openapi/v1/vms/{vmId}/terminate":{"delete":{"tags":["OpenapiVm"],"summary":"Terminate VM","description":"Terminate VM","operationId":"terminateInstance","parameters":[{"name":"vmId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}},"11000":{"description":"Instance not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultBoolean"}}}},"11001":{"description":"Instance status invalid","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultBoolean"}}}},"11002":{"description":"No terminate instance permissions","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultBoolean"}}}},"12001":{"description":"Resource status invalid","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultBoolean"}}}}}}}},"components":{"schemas":{"ResultObject":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"ResultBoolean":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"type":"boolean","description":"data"}}}}}}
```

## Get available Instance ModelType

> Get available Instance ModelType

```json
{"openapi":"3.1.0","info":{"title":"saas-platform","version":"1.0.0"},"tags":[{"name":"OpenapiVm","description":"OpenAPI VM API"}],"servers":[{"url":"https://api.yottalabs.ai","description":"Generated server url"}],"security":[{}],"paths":{"/openapi/v1/vms/type":{"get":{"tags":["OpenapiVm"],"summary":"Get available Instance ModelType","description":"Get available Instance ModelType","operationId":"getAvailableMachineModelType_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultListOpenapiVmsResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}}}}}},"components":{"schemas":{"ResultListOpenapiVmsResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"type":"array","description":"data","items":{"$ref":"#/components/schemas/OpenapiVmsResponse"}}}},"OpenapiVmsResponse":{"type":"object","properties":{"gpuType":{"type":"string"},"regions":{"type":"array","items":{"$ref":"#/components/schemas/OpenapiVmsRegionsResponse"}}}},"OpenapiVmsRegionsResponse":{"type":"object","properties":{"region":{"type":"string"},"types":{"type":"array","items":{"$ref":"#/components/schemas/OpenapiVmsTypesResponse"}}}},"OpenapiVmsTypesResponse":{"type":"object","properties":{"vmTypeId":{"type":"integer","format":"int32"},"gpuCount":{"type":"integer","format":"int32"},"pricePerHour":{"type":"string"},"supportSpot":{"type":"integer","format":"int32"},"spotPricePerHour":{"type":"string"},"currency":{"type":"string"},"displayName":{"type":"string"},"cpuCores":{"type":"integer","format":"int32"},"memoryInGb":{"type":"string"},"gpuMemoryInGb":{"type":"string"},"gpuTotalMemoryInGb":{"type":"string"},"storageType":{"type":"string"},"storageCapacityInGb":{"type":"string"},"osName":{"type":"string"},"osVersion":{"type":"string"},"supportOnDemand":{"type":"integer","format":"int32"},"ondemandAvailable":{"type":"integer","format":"int32"},"spotAvailable":{"type":"integer","format":"int32"}}},"ResultObject":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Get VM details

> Get VM details

```json
{"openapi":"3.1.0","info":{"title":"saas-platform","version":"1.0.0"},"tags":[{"name":"OpenapiVm","description":"OpenAPI VM API"}],"servers":[{"url":"https://api.yottalabs.ai","description":"Generated server url"}],"security":[{}],"paths":{"/openapi/v1/vms/{vmId}":{"get":{"tags":["OpenapiVm"],"summary":"Get VM details","description":"Get VM details","operationId":"getInstanceDetail","parameters":[{"name":"vmId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultOpenapiInstanceDetailResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}}}}}},"components":{"schemas":{"ResultOpenapiInstanceDetailResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/OpenapiInstanceDetailResponse","description":"data"}}},"OpenapiInstanceDetailResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"orgId":{"type":"string"},"nickname":{"type":"string"},"gpuDisplayName":{"type":"string"},"ipAddress":{"type":"string"},"domainName":{"type":"string"},"cpuCores":{"type":"integer","format":"int32"},"memoryInGb":{"type":"string"},"gpuCount":{"type":"integer","format":"int32"},"gpuMemoryInGb":{"type":"string"},"region":{"type":"string"},"storageInGb":{"type":"string"},"notebookUrl":{"type":"string"},"sshTemplate":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"terminatedAt":{"type":"integer","format":"int64"},"updatedAt":{"type":"integer","format":"int64"},"osInfo":{"type":"string"},"gpuType":{"type":"string"},"isSpot":{"type":"integer","format":"int32"}}},"ResultObject":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Get Org VM list

> Get Org VM list

```json
{"openapi":"3.1.0","info":{"title":"saas-platform","version":"1.0.0"},"tags":[{"name":"OpenapiVm","description":"OpenAPI VM API"}],"servers":[{"url":"https://api.yottalabs.ai","description":"Generated server url"}],"security":[{}],"paths":{"/openapi/v1/vms/list":{"post":{"tags":["OpenapiVm"],"summary":"Get Org VM list","description":"Get Org VM list","operationId":"getInstanceList","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/YottaPageRequestOpenapiInstanceSearchRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultOpenapiYottaPageResponseOpenapiInstanceResponse"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}}}}}}},"components":{"schemas":{"YottaPageRequestOpenapiInstanceSearchRequest":{"type":"object","description":"Yotta Page Request","properties":{"search":{"$ref":"#/components/schemas/OpenapiInstanceSearchRequest","description":"The search data is empty and {} needs to be transmitted"},"pageNumber":{"type":"integer","format":"int64","description":"Yotta pageNumber","minimum":1},"pageSize":{"type":"integer","format":"int64","description":"Yotta pageSize","minimum":1},"pageMark":{"type":"integer","format":"int64","description":"Yotta pageMark for cursor-based pagination"},"totalPage":{"type":"integer","format":"int64","description":"Yotta totalPage"},"totalRow":{"type":"integer","format":"int64","description":"Yotta totalRow"},"nextPage":{"type":"boolean","description":"Next Page"}},"required":["pageNumber","pageSize","search"]},"OpenapiInstanceSearchRequest":{"type":"object","description":"Instance Search Request","properties":{"status":{"type":"string","description":"Status for filtering by multiple statuses @see InstanceStatusEnum"}}},"ResultOpenapiYottaPageResponseOpenapiInstanceResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/OpenapiYottaPageResponseOpenapiInstanceResponse","description":"data"}}},"OpenapiYottaPageResponseOpenapiInstanceResponse":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/OpenapiInstanceResponse"}},"pageNumber":{"type":"integer","format":"int64"},"pageSize":{"type":"integer","format":"int64"},"totalPage":{"type":"integer","format":"int64"},"totalRow":{"type":"integer","format":"int64"}}},"OpenapiInstanceResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"orgId":{"type":"string"},"nickname":{"type":"string"},"gpuDisplayName":{"type":"string"},"ipAddress":{"type":"string"},"domainName":{"type":"string"},"cpuCores":{"type":"integer","format":"int32"},"memoryInGb":{"type":"string"},"gpuCount":{"type":"integer","format":"int32"},"gpuMemoryInGb":{"type":"string"},"region":{"type":"string","description":"0: US"},"storageInGb":{"type":"string"},"notebookUrl":{"type":"string"},"sshTemplate":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"terminatedAt":{"type":"integer","format":"int64"},"updatedAt":{"type":"integer","format":"int64"},"osInfo":{"type":"string"},"gpuType":{"type":"string"},"isSpot":{"type":"integer","format":"int32"}}},"ResultObject":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yottalabs.ai/api-and-sdk/api-reference-v1/vms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
