# Create GPU Instance - Documentation

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/api-reference/gpu-instance-create-instance

# Create GPU Instance

POST

/

gpu-instance

/

openapi

/

v1

/

gpu

/

instance

/

create

Try it

Create GPU Instance

cURL

```
curl --request POST \
--url https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create \
--header 'Authorization: &#x3C;authorization>' \
--header 'Content-Type: &#x3C;content-type>' \
--data '
{
"name": "&#x3C;string>",
"productId": "&#x3C;string>",
"gpuNum": 123,
"rootfsSize": 123,
"imageUrl": "&#x3C;string>",
"imageAuth": "&#x3C;string>",
"imageAuthId": "&#x3C;string>",
"ports": "&#x3C;string>",
"envs": [
{
"key": "&#x3C;string>",
"value": "&#x3C;string>"
}
],
"tools": [
{
"name": "&#x3C;string>",
"port": "&#x3C;string>",
"type": "&#x3C;string>"
}
],
"command": "&#x3C;string>",
"entrypoint": "&#x3C;string>",
"clusterId": "&#x3C;string>",
"networkStorages": [
{
"Id": "&#x3C;string>",
"mountPoint": "&#x3C;string>"
}
],
"networkId": "&#x3C;string>",
"kind": "&#x3C;string>",
"month": 123,
"billingMode": "&#x3C;string>",
"autoRenew": true,
"autoRenewMonth": 123,
"minCudaVersion": "&#x3C;string>"
}
'
```

```
import requestsurl = "https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create"payload = { "name": "&#x3C;string>", "productId": "&#x3C;string>", "gpuNum": 123, "rootfsSize": 123, "imageUrl": "&#x3C;string>", "imageAuth": "&#x3C;string>", "imageAuthId": "&#x3C;string>", "ports": "&#x3C;string>", "envs": [ { "key": "&#x3C;string>", "value": "&#x3C;string>" } ], "tools": [ { "name": "&#x3C;string>", "port": "&#x3C;string>", "type": "&#x3C;string>" } ], "command": "&#x3C;string>", "entrypoint": "&#x3C;string>", "clusterId": "&#x3C;string>", "networkStorages": [ { "Id": "&#x3C;string>", "mountPoint": "&#x3C;string>" } ], "networkId": "&#x3C;string>", "kind": "&#x3C;string>", "month": 123, "billingMode": "&#x3C;string>", "autoRenew": True, "autoRenewMonth": 123, "minCudaVersion": "&#x3C;string>"}headers = { "Content-Type": "&#x3C;content-type>", "Authorization": "&#x3C;authorization>"}response = requests.post(url, json=payload, headers=headers)print(response.text)
```

```
const options = { method: 'POST', headers: {'Content-Type': '&#x3C;content-type>', Authorization: '&#x3C;authorization>'}, body: JSON.stringify({ name: '&#x3C;string>', productId: '&#x3C;string>', gpuNum: 123, rootfsSize: 123, imageUrl: '&#x3C;string>', imageAuth: '&#x3C;string>', imageAuthId: '&#x3C;string>', ports: '&#x3C;string>', envs: [{key: '&#x3C;string>', value: '&#x3C;string>'}], tools: [{name: '&#x3C;string>', port: '&#x3C;string>', type: '&#x3C;string>'}], command: '&#x3C;string>', entrypoint: '&#x3C;string>', clusterId: '&#x3C;string>', networkStorages: [{Id: '&#x3C;string>', mountPoint: '&#x3C;string>'}], networkId: '&#x3C;string>', kind: '&#x3C;string>', month: 123, billingMode: '&#x3C;string>', autoRenew: true, autoRenewMonth: 123, minCudaVersion: '&#x3C;string>' })};fetch('https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
```

```
&#x3C;?php$curl = curl_init();curl_setopt_array($curl, [ CURLOPT_URL => "https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'name' => '&#x3C;string>', 'productId' => '&#x3C;string>', 'gpuNum' => 123, 'rootfsSize' => 123, 'imageUrl' => '&#x3C;string>', 'imageAuth' => '&#x3C;string>', 'imageAuthId' => '&#x3C;string>', 'ports' => '&#x3C;string>', 'envs' => [ [ 'key' => '&#x3C;string>', 'value' => '&#x3C;string>' ] ], 'tools' => [ [ 'name' => '&#x3C;string>', 'port' => '&#x3C;string>', 'type' => '&#x3C;string>' ] ], 'command' => '&#x3C;string>', 'entrypoint' => '&#x3C;string>', 'clusterId' => '&#x3C;string>', 'networkStorages' => [ [ 'Id' => '&#x3C;string>', 'mountPoint' => '&#x3C;string>' ] ], 'networkId' => '&#x3C;string>', 'kind' => '&#x3C;string>', 'month' => 123, 'billingMode' => '&#x3C;string>', 'autoRenew' => true, 'autoRenewMonth' => 123, 'minCudaVersion' => '&#x3C;string>' ]), CURLOPT_HTTPHEADER => [ "Authorization: &#x3C;authorization>", "Content-Type: &#x3C;content-type>" ],]);$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}
```

```
package mainimport (	"fmt"	"strings"	"net/http"	"io")func main() {	url := "https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create"	payload := strings.NewReader("{\n \"name\": \"&#x3C;string>\",\n \"productId\": \"&#x3C;string>\",\n \"gpuNum\": 123,\n \"rootfsSize\": 123,\n \"imageUrl\": \"&#x3C;string>\",\n \"imageAuth\": \"&#x3C;string>\",\n \"imageAuthId\": \"&#x3C;string>\",\n \"ports\": \"&#x3C;string>\",\n \"envs\": [\n {\n \"key\": \"&#x3C;string>\",\n \"value\": \"&#x3C;string>\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"&#x3C;string>\",\n \"port\": \"&#x3C;string>\",\n \"type\": \"&#x3C;string>\"\n }\n ],\n \"command\": \"&#x3C;string>\",\n \"entrypoint\": \"&#x3C;string>\",\n \"clusterId\": \"&#x3C;string>\",\n \"networkStorages\": [\n {\n \"Id\": \"&#x3C;string>\",\n \"mountPoint\": \"&#x3C;string>\"\n }\n ],\n \"networkId\": \"&#x3C;string>\",\n \"kind\": \"&#x3C;string>\",\n \"month\": 123,\n \"billingMode\": \"&#x3C;string>\",\n \"autoRenew\": true,\n \"autoRenewMonth\": 123,\n \"minCudaVersion\": \"&#x3C;string>\"\n}")	req, _ := http.NewRequest("POST", url, payload)	req.Header.Add("Content-Type", "&#x3C;content-type>")	req.Header.Add("Authorization", "&#x3C;authorization>")	res, _ := http.DefaultClient.Do(req)	defer res.Body.Close()	body, _ := io.ReadAll(res.Body)	fmt.Println(string(body))}
```

```
HttpResponse&#x3C;String> response = Unirest.post("https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create") .header("Content-Type", "&#x3C;content-type>") .header("Authorization", "&#x3C;authorization>") .body("{\n \"name\": \"&#x3C;string>\",\n \"productId\": \"&#x3C;string>\",\n \"gpuNum\": 123,\n \"rootfsSize\": 123,\n \"imageUrl\": \"&#x3C;string>\",\n \"imageAuth\": \"&#x3C;string>\",\n \"imageAuthId\": \"&#x3C;string>\",\n \"ports\": \"&#x3C;string>\",\n \"envs\": [\n {\n \"key\": \"&#x3C;string>\",\n \"value\": \"&#x3C;string>\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"&#x3C;string>\",\n \"port\": \"&#x3C;string>\",\n \"type\": \"&#x3C;string>\"\n }\n ],\n \"command\": \"&#x3C;string>\",\n \"entrypoint\": \"&#x3C;string>\",\n \"clusterId\": \"&#x3C;string>\",\n \"networkStorages\": [\n {\n \"Id\": \"&#x3C;string>\",\n \"mountPoint\": \"&#x3C;string>\"\n }\n ],\n \"networkId\": \"&#x3C;string>\",\n \"kind\": \"&#x3C;string>\",\n \"month\": 123,\n \"billingMode\": \"&#x3C;string>\",\n \"autoRenew\": true,\n \"autoRenewMonth\": 123,\n \"minCudaVersion\": \"&#x3C;string>\"\n}") .asString();
```

```
require 'uri'require 'net/http'url = URI("https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create")http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Post.new(url)request["Content-Type"] = '&#x3C;content-type>'request["Authorization"] = '&#x3C;authorization>'request.body = "{\n \"name\": \"&#x3C;string>\",\n \"productId\": \"&#x3C;string>\",\n \"gpuNum\": 123,\n \"rootfsSize\": 123,\n \"imageUrl\": \"&#x3C;string>\",\n \"imageAuth\": \"&#x3C;string>\",\n \"imageAuthId\": \"&#x3C;string>\",\n \"ports\": \"&#x3C;string>\",\n \"envs\": [\n {\n \"key\": \"&#x3C;string>\",\n \"value\": \"&#x3C;string>\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"&#x3C;string>\",\n \"port\": \"&#x3C;string>\",\n \"type\": \"&#x3C;string>\"\n }\n ],\n \"command\": \"&#x3C;string>\",\n \"entrypoint\": \"&#x3C;string>\",\n \"clusterId\": \"&#x3C;string>\",\n \"networkStorages\": [\n {\n \"Id\": \"&#x3C;string>\",\n \"mountPoint\": \"&#x3C;string>\"\n }\n ],\n \"networkId\": \"&#x3C;string>\",\n \"kind\": \"&#x3C;string>\",\n \"month\": 123,\n \"billingMode\": \"&#x3C;string>\",\n \"autoRenew\": true,\n \"autoRenewMonth\": 123,\n \"minCudaVersion\": \"&#x3C;string>\"\n}"response = http.request(request)puts response.read_body
```

200

```
{
"id": "&#x3C;string>"
}
```

##

[​](#request-headers)

Request Headers

[​](#param-content-type)

Content-Type

string

required

Enum: `application/json`

[​](#param-authorization)

Authorization

string

required

Bearer authentication format, for example: Bearer {{API Key}}.

##

[​](#request-body)

Request Body

[​](#param-name)

name

string

Instance name. String, length limit: 0-255 characters.

[​](#param-product-id)

productId

string

required

GPU product ID. String, length limit: 1-255 characters. You can query this via the [List GPU Products API](/docs/api-reference/gpu-instance-list-products).

[​](#param-gpu-num)

gpuNum

integer

required

Number of GPUs. Integer, valid range: [1, 8].

[​](#param-rootfs-size)

rootfsSize

integer

required

Root filesystem size. Integer, valid range: [10, 6144]. If the minimum value is less than 10 GB, the system will default to 10 GB. The maximum value is dynamically limited by available storage resources and can be queried via the product list API.

[​](#param-image-url)

imageUrl

string

required

Image URL. String, length limit: 1-500 characters.

[​](#param-image-auth)

imageAuth

string

Image authentication (username:password). String, length limit: 0-10239 characters.

[​](#param-image-auth-id)

imageAuthId

string

Image repository authentication ID.

[​](#param-ports)

ports

string

Instance open ports, e.g.: 80/http, 3306/tcp. Supported port range: [1-65535], except for 2222, 2223, 2224 which are reserved for internal use. Supported port types: [tcp, http]. The total number of ports used by ports + tools must not exceed 15.

[​](#param-envs)

envs

object[]

Instance environment variables. Up to 100 environment variables can be created.

Show properties

[​](#param-key)

key

string

Environment variable name. String, length limit: 0-511 characters.

[​](#param-value)

value

string

Environment variable value. String, length limit: 0-4095 characters.

[​](#param-tools)

tools

object[]

Enable official image support tools. Currently, some official images only include Jupyter. The total number of ports used by ports + tools must not exceed 15.

Show properties

[​](#param-name-1)

name

string

Tool name. Valid values: [Jupyter].

[​](#param-port)

port

string

Port used by the tool. Supported port range: [1-65535], except for 2222, 2223, 2224 which are reserved for internal use.

[​](#param-type)

type

string

Port type used by the tool. Supported types: [tcp, http].

[​](#param-command)

command

string

Instance startup command. String, length limit: 0-2047 characters.

[​](#param-entrypoint)

entrypoint

string

Instance startup entrypoint. This setting will override the Docker image’s ENTRYPOINT. String, length limit: 0-2047 characters.

[​](#param-cluster-id)

clusterId

string

Specify the cluster ID to create the instance in. If left empty, the instance will be created in a random cluster.

[​](#param-network-storages)

networkStorages

object[]

Cloud storage mount configuration. Up to 30 cloud storages can be mounted.

Show properties

[​](#param-id)

Id

string

Network storage ID.

[​](#param-mount-point)

mountPoint

string

Network storage mount path. Default: “/network”. String, length limit: 1-4095 characters.

[​](#param-network-id)

networkId

string

VPC network ID. Leave empty if not using a VPC network.

[​](#param-kind)

kind

string

required

Instance type. Valid values: [gpu, cpu].

[​](#param-month)

month

integer

Number of months for subscription instance. Set to 0 to create a pay-as-you-go instance. Integer, value must be greater than or equal to 0.

[​](#param-billing-mode)

billingMode

string

Instance billing mode. Valid values: `onDemand`, `monthly`, `spot`.

Default: `onDemand`.

Note: If month > 0 is set, `monthly` billing mode will be enforced.

- `onDemand`: Pay-as-you-go billing

- `monthly`: Monthly subscription billing

- `spot`: Spot instance billing

[​](#param-auto-renew)

autoRenew

boolean

Whether to automatically renew. Boolean, default value: false.

Note: This parameter is only effective when monthly billing is enabled.

[​](#param-auto-renew-month)

autoRenewMonth

integer

Number of months to automatically renew. Integer, valid range: [1, 12].

Note: This parameter is only effective when monthly billing is enabled and auto renew is enabled.

[​](#param-min-cuda-version)

minCudaVersion

string

Minimum CUDA version supported for instance creation. Must be specified in the format: 11.8, 12.4, etc. String, length limit: 0-255 characters.

##

[​](#response)

Response

[​](#param-id)

id

string

Created instance ID.

Last modified on January 19, 2026
