# Upgrade 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-upgrade-instance

# Upgrade Instance

POST

/

gpu-instance

/

openapi

/

v1

/

gpu

/

instance

/

upgrade

Try it

Upgrade Instance

cURL

```
curl --request POST \
--url https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/upgrade \
--header 'Authorization: ' \
--header 'Content-Type: ' \
--data '
{
"instanceId": "",
"imageUrl": "",
"imageAuthId": "",
"envs": [
{
"key": "",
"value": ""
}
],
"command": "",
"entrypoint": "",
"save": true,
"networkVolume": {
"volumeMounts": [
{
"type": "",
"id": "",
"mountPath": ""
}
]
}
}
'
```

```
import requests

url = "https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/upgrade"

payload = {
"instanceId": "",
"imageUrl": "",
"imageAuthId": "",
"envs": [
{
"key": "",
"value": ""
}
],
"command": "",
"entrypoint": "",
"save": True,
"networkVolume": { "volumeMounts": [
{
"type": "",
"id": "",
"mountPath": ""
}
] }
}
headers = {
"Content-Type": "",
"Authorization": ""
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

```
const options = {
method: 'POST',
headers: {'Content-Type': '', Authorization: ''},
body: JSON.stringify({
instanceId: '',
imageUrl: '',
imageAuthId: '',
envs: [{key: '', value: ''}],
command: '',
entrypoint: '',
save: true,
networkVolume: {volumeMounts: [{type: '', id: '', mountPath: ''}]}
})
};

fetch('https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/upgrade', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
```

```
"https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/upgrade",
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([
'instanceId' => '',
'imageUrl' => '',
'imageAuthId' => '',
'envs' => [
[
'key' => '',
'value' => ''
]
],
'command' => '',
'entrypoint' => '',
'save' => true,
'networkVolume' => [
'volumeMounts' => [
[
'type' => '',
'id' => '',
'mountPath' => ''
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: ",
"Content-Type: "
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
```

```
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/upgrade"

payload := strings.NewReader("{\n \"instanceId\": \"\",\n \"imageUrl\": \"\",\n \"imageAuthId\": \"\",\n \"envs\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"command\": \"\",\n \"entrypoint\": \"\",\n \"save\": true,\n \"networkVolume\": {\n \"volumeMounts\": [\n {\n \"type\": \"\",\n \"id\": \"\",\n \"mountPath\": \"\"\n }\n ]\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "")
req.Header.Add("Authorization", "")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
```

```
HttpResponse response = Unirest.post("https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/upgrade")
.header("Content-Type", "")
.header("Authorization", "")
.body("{\n \"instanceId\": \"\",\n \"imageUrl\": \"\",\n \"imageAuthId\": \"\",\n \"envs\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"command\": \"\",\n \"entrypoint\": \"\",\n \"save\": true,\n \"networkVolume\": {\n \"volumeMounts\": [\n {\n \"type\": \"\",\n \"id\": \"\",\n \"mountPath\": \"\"\n }\n ]\n }\n}")
.asString();
```

```
require 'uri'
require 'net/http'

url = URI("https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/upgrade")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = ''
request["Authorization"] = ''
request.body = "{\n \"instanceId\": \"\",\n \"imageUrl\": \"\",\n \"imageAuthId\": \"\",\n \"envs\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"command\": \"\",\n \"entrypoint\": \"\",\n \"save\": true,\n \"networkVolume\": {\n \"volumeMounts\": [\n {\n \"type\": \"\",\n \"id\": \"\",\n \"mountPath\": \"\"\n }\n ]\n }\n}"

response = http.request(request)
puts response.read_body
```

##

[​](#api-description)

API Description

When upgrading an instance, all parameters must be provided in full.

##

[​](#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-instance-id)

instanceId

string

required

The ID of the instance to be upgraded.

[​](#param-image-url)

imageUrl

string

required

Container image URL. String, length limit: 1-500 characters.

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

imageAuthId

string

Image registry authentication ID.

[​](#param-envs)

envs

object[]

required

Instance environment variables. Up to 100 environment variable pairs 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-command)

command

string

required

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

[​](#param-entrypoint)

entrypoint

string

required

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

[​](#param-save)

save

boolean

required

Whether to retain data from the previous instance. Boolean, values: true or false.

[​](#param-network-volume)

networkVolume

object

required

Configure cloud storage (type: network). Each instance supports mounting up to 30 cloud storage volumes. To remove all cloud storage mounts, set volumeMounts to an empty array: [].

Show properties

[​](#param-volume-mounts)

volumeMounts

object[]

required

Cloud storage mount information.

Hide properties

[​](#param-type)

type

string

required

Storage type. Must be set to network.

[​](#param-id)

id

string

required

Cloud storage ID.

[​](#param-mount-path)

mountPath

string

required

Mount path for the cloud storage. Default: “/network”. String, length limit: 1-4095 characters.

Last modified on December 24, 2025
