# Create 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/gpus-v2-create-instance

# Create Instance

POST

/

gpus

/

v2

/

instances

Try it

Create Instance

cURL

```
curl --request POST \
--url https://api.novita.ai/gpus/v2/instances \
--header 'Authorization: &#x3C;authorization>' \
--header 'Content-Type: &#x3C;content-type>' \
--data '
{
"name": "example-instance",
"product_id": "product-id",
"image": "registry.example.com/namespace/image:tag",
"billing": {
"mode": "prepaid",
"prepaid": {
"months": 1,
"auto_renew": {
"enabled": true,
"months": 1
}
}
},
"resource": {
"rootfs_size_gb": 20,
"gpu_num": 1,
"min_cuda_version": ""
},
"registry_auth_id": "registry-auth-id",
"entrypoint": "",
"command": "",
"envs": [
{
"key": "ENV_NAME",
"value": "ENV_VALUE"
}
],
"ports": [
{
"port": 8080,
"protocol": "tcp"
}
],
"network": {
"id": "vpc-550e8400-e29b-41d4-a716-446655440000",
"ip": "10.2.1.1"
},
"volumes": [
{
"type": "network",
"id": "network-storage-id",
"mount_point": "/data"
}
],
"candidate_regions": [
"region-id"
],
"tools": {
"jupyter": {
"enabled": true,
"port": 8888,
"protocol": "http"
}
},
"auto_migrate": {
"enabled": false,
"include_system_disk": false
}
}
'
```

```
import requestsurl = "https://api.novita.ai/gpus/v2/instances"payload = { "name": "example-instance", "product_id": "product-id", "image": "registry.example.com/namespace/image:tag", "billing": { "mode": "prepaid", "prepaid": { "months": 1, "auto_renew": { "enabled": True, "months": 1 } } }, "resource": { "rootfs_size_gb": 20, "gpu_num": 1, "min_cuda_version": "" }, "registry_auth_id": "registry-auth-id", "entrypoint": "", "command": "", "envs": [ { "key": "ENV_NAME", "value": "ENV_VALUE" } ], "ports": [ { "port": 8080, "protocol": "tcp" } ], "network": { "id": "vpc-550e8400-e29b-41d4-a716-446655440000", "ip": "10.2.1.1" }, "volumes": [ { "type": "network", "id": "network-storage-id", "mount_point": "/data" } ], "candidate_regions": ["region-id"], "tools": { "jupyter": { "enabled": True, "port": 8888, "protocol": "http" } }, "auto_migrate": { "enabled": False, "include_system_disk": False }}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: 'example-instance', product_id: 'product-id', image: 'registry.example.com/namespace/image:tag', billing: {mode: 'prepaid', prepaid: {months: 1, auto_renew: {enabled: true, months: 1}}}, resource: {rootfs_size_gb: 20, gpu_num: 1, min_cuda_version: ''}, registry_auth_id: 'registry-auth-id', entrypoint: '', command: '', envs: [{key: 'ENV_NAME', value: 'ENV_VALUE'}], ports: [{port: 8080, protocol: 'tcp'}], network: {id: 'vpc-550e8400-e29b-41d4-a716-446655440000', ip: '10.2.1.1'}, volumes: [{type: 'network', id: 'network-storage-id', mount_point: '/data'}], candidate_regions: ['region-id'], tools: {jupyter: {enabled: true, port: 8888, protocol: 'http'}}, auto_migrate: {enabled: false, include_system_disk: false} })};fetch('https://api.novita.ai/gpus/v2/instances', 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/gpus/v2/instances", 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' => 'example-instance', 'product_id' => 'product-id', 'image' => 'registry.example.com/namespace/image:tag', 'billing' => [ 'mode' => 'prepaid', 'prepaid' => [ 'months' => 1, 'auto_renew' => [ 'enabled' => true, 'months' => 1 ] ] ], 'resource' => [ 'rootfs_size_gb' => 20, 'gpu_num' => 1, 'min_cuda_version' => '' ], 'registry_auth_id' => 'registry-auth-id', 'entrypoint' => '', 'command' => '', 'envs' => [ [ 'key' => 'ENV_NAME', 'value' => 'ENV_VALUE' ] ], 'ports' => [ [ 'port' => 8080, 'protocol' => 'tcp' ] ], 'network' => [ 'id' => 'vpc-550e8400-e29b-41d4-a716-446655440000', 'ip' => '10.2.1.1' ], 'volumes' => [ [ 'type' => 'network', 'id' => 'network-storage-id', 'mount_point' => '/data' ] ], 'candidate_regions' => [ 'region-id' ], 'tools' => [ 'jupyter' => [ 'enabled' => true, 'port' => 8888, 'protocol' => 'http' ] ], 'auto_migrate' => [ 'enabled' => false, 'include_system_disk' => false ] ]), 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/gpus/v2/instances"	payload := strings.NewReader("{\n \"name\": \"example-instance\",\n \"product_id\": \"product-id\",\n \"image\": \"registry.example.com/namespace/image:tag\",\n \"billing\": {\n \"mode\": \"prepaid\",\n \"prepaid\": {\n \"months\": 1,\n \"auto_renew\": {\n \"enabled\": true,\n \"months\": 1\n }\n }\n },\n \"resource\": {\n \"rootfs_size_gb\": 20,\n \"gpu_num\": 1,\n \"min_cuda_version\": \"\"\n },\n \"registry_auth_id\": \"registry-auth-id\",\n \"entrypoint\": \"\",\n \"command\": \"\",\n \"envs\": [\n {\n \"key\": \"ENV_NAME\",\n \"value\": \"ENV_VALUE\"\n }\n ],\n \"ports\": [\n {\n \"port\": 8080,\n \"protocol\": \"tcp\"\n }\n ],\n \"network\": {\n \"id\": \"vpc-550e8400-e29b-41d4-a716-446655440000\",\n \"ip\": \"10.2.1.1\"\n },\n \"volumes\": [\n {\n \"type\": \"network\",\n \"id\": \"network-storage-id\",\n \"mount_point\": \"/data\"\n }\n ],\n \"candidate_regions\": [\n \"region-id\"\n ],\n \"tools\": {\n \"jupyter\": {\n \"enabled\": true,\n \"port\": 8888,\n \"protocol\": \"http\"\n }\n },\n \"auto_migrate\": {\n \"enabled\": false,\n \"include_system_disk\": false\n }\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/gpus/v2/instances") .header("Content-Type", "&#x3C;content-type>") .header("Authorization", "&#x3C;authorization>") .body("{\n \"name\": \"example-instance\",\n \"product_id\": \"product-id\",\n \"image\": \"registry.example.com/namespace/image:tag\",\n \"billing\": {\n \"mode\": \"prepaid\",\n \"prepaid\": {\n \"months\": 1,\n \"auto_renew\": {\n \"enabled\": true,\n \"months\": 1\n }\n }\n },\n \"resource\": {\n \"rootfs_size_gb\": 20,\n \"gpu_num\": 1,\n \"min_cuda_version\": \"\"\n },\n \"registry_auth_id\": \"registry-auth-id\",\n \"entrypoint\": \"\",\n \"command\": \"\",\n \"envs\": [\n {\n \"key\": \"ENV_NAME\",\n \"value\": \"ENV_VALUE\"\n }\n ],\n \"ports\": [\n {\n \"port\": 8080,\n \"protocol\": \"tcp\"\n }\n ],\n \"network\": {\n \"id\": \"vpc-550e8400-e29b-41d4-a716-446655440000\",\n \"ip\": \"10.2.1.1\"\n },\n \"volumes\": [\n {\n \"type\": \"network\",\n \"id\": \"network-storage-id\",\n \"mount_point\": \"/data\"\n }\n ],\n \"candidate_regions\": [\n \"region-id\"\n ],\n \"tools\": {\n \"jupyter\": {\n \"enabled\": true,\n \"port\": 8888,\n \"protocol\": \"http\"\n }\n },\n \"auto_migrate\": {\n \"enabled\": false,\n \"include_system_disk\": false\n }\n}") .asString();
```

```
require 'uri'require 'net/http'url = URI("https://api.novita.ai/gpus/v2/instances")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\": \"example-instance\",\n \"product_id\": \"product-id\",\n \"image\": \"registry.example.com/namespace/image:tag\",\n \"billing\": {\n \"mode\": \"prepaid\",\n \"prepaid\": {\n \"months\": 1,\n \"auto_renew\": {\n \"enabled\": true,\n \"months\": 1\n }\n }\n },\n \"resource\": {\n \"rootfs_size_gb\": 20,\n \"gpu_num\": 1,\n \"min_cuda_version\": \"\"\n },\n \"registry_auth_id\": \"registry-auth-id\",\n \"entrypoint\": \"\",\n \"command\": \"\",\n \"envs\": [\n {\n \"key\": \"ENV_NAME\",\n \"value\": \"ENV_VALUE\"\n }\n ],\n \"ports\": [\n {\n \"port\": 8080,\n \"protocol\": \"tcp\"\n }\n ],\n \"network\": {\n \"id\": \"vpc-550e8400-e29b-41d4-a716-446655440000\",\n \"ip\": \"10.2.1.1\"\n },\n \"volumes\": [\n {\n \"type\": \"network\",\n \"id\": \"network-storage-id\",\n \"mount_point\": \"/data\"\n }\n ],\n \"candidate_regions\": [\n \"region-id\"\n ],\n \"tools\": {\n \"jupyter\": {\n \"enabled\": true,\n \"port\": 8888,\n \"protocol\": \"http\"\n }\n },\n \"auto_migrate\": {\n \"enabled\": false,\n \"include_system_disk\": false\n }\n}"response = http.request(request)puts response.read_body
```

200

```
{
"id": "ca338f12f3"
}
```

#### Headers

[​](#parameter-content-type)

Content-Type

string

required

Allowed value: application/json.

[​](#parameter-authorization)

Authorization

string

required

Bearer authentication format, e.g.: `Bearer {{API_KEY}}`.

#### Body

application/json

[​](#body-name)

name

string

required

Instance name. String, length: 1-255 characters.

Example:

`"example-instance"`

[​](#body-product-id)

product_id

string

required

Product ID.

Example:

`"product-id"`

[​](#body-image)

image

string

required

Image address. String, length: 1-500 characters.

Example:

`"registry.example.com/namespace/image:tag"`

[​](#body-billing)

billing

object

required

Billing configuration.

Show child attributes

[​](#body-resource)

resource

object

required

Resource configuration.

Show child attributes

[​](#body-type)

type

enum<string>

Instance type. Allowed values: `gpu`, `cpu`. Default: `gpu`.

Available options:

`gpu`,

`cpu`

[​](#body-registry-auth-id)

registry_auth_id

string

Saved registry authentication ID. String, length: 0-255 characters.

Example:

`"registry-auth-id"`

[​](#body-entrypoint)

entrypoint

string

Container entrypoint.

Example:

`""`

[​](#body-command)

command

string

Container startup command.

Example:

`""`

[​](#body-envs)

envs

object[]

Environment variable list.

Show child attributes

[​](#body-ports)

ports

object[]

Exposed port list.

Show child attributes

[​](#body-network)

network

object

VPC network configuration.

Show child attributes

[​](#body-volumes)

volumes

object[]

Data disk / network storage mounts.

Show child attributes

[​](#body-candidate-regions)

candidate_regions

string[]

Candidate regions for scheduling. The instance is finally scheduled to one of them.

Example:

```
["region-id"]
```

[​](#body-tools)

tools

object

Instance tool configuration. Currently only Jupyter is supported.

Show child attributes

[​](#body-auto-migrate)

auto_migrate

object

Auto-migrate configuration.

Show child attributes

#### Response

200 - application/json

OK

[​](#response-id)

id

string

ID of the created instance

Example:

`"ca338f12f3"`

Last modified on June 23, 2026
