> For the complete documentation index, see [llms.txt](https://docs.yottalabs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yottalabs.ai/api-and-sdk/api-reference-v1/vms.md).

# VMs

## Create VM

> Create VM

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"OpenapiVm"}],"security":[{}],"paths":{"/openapi/v1/vms/create":{"post":{"summary":"Create VM","deprecated":false,"description":"Create VM","operationId":"create_2","tags":["OpenapiVm"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenapiInstanceRentRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultOpenapiInstanceDetailResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}}}}}},"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.","properties":{}}},"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.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"OpenapiVm"}],"security":[{}],"paths":{"/openapi/v1/vms/{vmId}/terminate":{"delete":{"summary":"Terminate VM","deprecated":false,"description":"Terminate VM","operationId":"terminateInstance","tags":["OpenapiVm"],"parameters":[{"name":"vmId","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}},"11000":{"description":"Instance not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultBoolean"}}},"headers":{}},"11001":{"description":"Instance status invalid","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultBoolean"}}},"headers":{}},"11002":{"description":"No terminate instance permissions","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultBoolean"}}},"headers":{}},"12001":{"description":"Resource status invalid","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultBoolean"}}},"headers":{}}}}}},"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.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"OpenapiVm"}],"security":[{}],"paths":{"/openapi/v1/vms/type":{"get":{"summary":"Get available Instance ModelType","deprecated":false,"description":"Get available Instance ModelType","operationId":"getAvailableMachineModelType_1","tags":["OpenapiVm"],"parameters":[],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultListOpenapiVmsResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}}}}}},"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.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"OpenapiVm"}],"security":[{}],"paths":{"/openapi/v1/vms/{vmId}":{"get":{"summary":"Get VM details","deprecated":false,"description":"Get VM details","operationId":"getInstanceDetail","tags":["OpenapiVm"],"parameters":[{"name":"vmId","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultOpenapiInstanceDetailResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}}}}}},"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.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"OpenapiVm"}],"security":[{}],"paths":{"/openapi/v1/vms/list":{"post":{"summary":"Get Org VM list","deprecated":false,"description":"Get Org VM list","operationId":"getInstanceList","tags":["OpenapiVm"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/YottaPageRequestOpenapiInstanceSearchRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultOpenapiYottaPageResponseOpenapiInstanceResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultObject"}}},"headers":{}}}}}},"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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
