Create CPU Instance
curl --request POST \
--url https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "<string>",
"productId": "<string>",
"imageUrl": "<string>",
"imageAuth": "<string>",
"imageAuthId": "<string>",
"ports": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"tools": [
{
"name": "<string>",
"port": "<string>",
"type": "<string>"
}
],
"command": "<string>",
"entrypoint": "<string>",
"clusterId": "<string>",
"localStorageMountPoint": "<string>",
"networkStorages": [
{
"Id": "<string>",
"mountPoint": "<string>"
}
],
"networkId": "<string>",
"kind": "<string>"
}
'import requests
url = "https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create"
payload = {
"name": "<string>",
"productId": "<string>",
"imageUrl": "<string>",
"imageAuth": "<string>",
"imageAuthId": "<string>",
"ports": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"tools": [
{
"name": "<string>",
"port": "<string>",
"type": "<string>"
}
],
"command": "<string>",
"entrypoint": "<string>",
"clusterId": "<string>",
"localStorageMountPoint": "<string>",
"networkStorages": [
{
"Id": "<string>",
"mountPoint": "<string>"
}
],
"networkId": "<string>",
"kind": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
name: '<string>',
productId: '<string>',
imageUrl: '<string>',
imageAuth: '<string>',
imageAuthId: '<string>',
ports: '<string>',
envs: [{key: '<string>', value: '<string>'}],
tools: [{name: '<string>', port: '<string>', type: '<string>'}],
command: '<string>',
entrypoint: '<string>',
clusterId: '<string>',
localStorageMountPoint: '<string>',
networkStorages: [{Id: '<string>', mountPoint: '<string>'}],
networkId: '<string>',
kind: '<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));<?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' => '<string>',
'productId' => '<string>',
'imageUrl' => '<string>',
'imageAuth' => '<string>',
'imageAuthId' => '<string>',
'ports' => '<string>',
'envs' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'tools' => [
[
'name' => '<string>',
'port' => '<string>',
'type' => '<string>'
]
],
'command' => '<string>',
'entrypoint' => '<string>',
'clusterId' => '<string>',
'localStorageMountPoint' => '<string>',
'networkStorages' => [
[
'Id' => '<string>',
'mountPoint' => '<string>'
]
],
'networkId' => '<string>',
'kind' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <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/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"productId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuth\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"ports\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"port\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"localStorageMountPoint\": \"<string>\",\n \"networkStorages\": [\n {\n \"Id\": \"<string>\",\n \"mountPoint\": \"<string>\"\n }\n ],\n \"networkId\": \"<string>\",\n \"kind\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"name\": \"<string>\",\n \"productId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuth\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"ports\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"port\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"localStorageMountPoint\": \"<string>\",\n \"networkStorages\": [\n {\n \"Id\": \"<string>\",\n \"mountPoint\": \"<string>\"\n }\n ],\n \"networkId\": \"<string>\",\n \"kind\": \"<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 = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"name\": \"<string>\",\n \"productId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuth\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"ports\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"port\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"localStorageMountPoint\": \"<string>\",\n \"networkStorages\": [\n {\n \"Id\": \"<string>\",\n \"mountPoint\": \"<string>\"\n }\n ],\n \"networkId\": \"<string>\",\n \"kind\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Instance
Create CPU Instance
POST
/
gpu-instance
/
openapi
/
v1
/
gpu
/
instance
/
create
Create CPU Instance
curl --request POST \
--url https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "<string>",
"productId": "<string>",
"imageUrl": "<string>",
"imageAuth": "<string>",
"imageAuthId": "<string>",
"ports": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"tools": [
{
"name": "<string>",
"port": "<string>",
"type": "<string>"
}
],
"command": "<string>",
"entrypoint": "<string>",
"clusterId": "<string>",
"localStorageMountPoint": "<string>",
"networkStorages": [
{
"Id": "<string>",
"mountPoint": "<string>"
}
],
"networkId": "<string>",
"kind": "<string>"
}
'import requests
url = "https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create"
payload = {
"name": "<string>",
"productId": "<string>",
"imageUrl": "<string>",
"imageAuth": "<string>",
"imageAuthId": "<string>",
"ports": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"tools": [
{
"name": "<string>",
"port": "<string>",
"type": "<string>"
}
],
"command": "<string>",
"entrypoint": "<string>",
"clusterId": "<string>",
"localStorageMountPoint": "<string>",
"networkStorages": [
{
"Id": "<string>",
"mountPoint": "<string>"
}
],
"networkId": "<string>",
"kind": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
name: '<string>',
productId: '<string>',
imageUrl: '<string>',
imageAuth: '<string>',
imageAuthId: '<string>',
ports: '<string>',
envs: [{key: '<string>', value: '<string>'}],
tools: [{name: '<string>', port: '<string>', type: '<string>'}],
command: '<string>',
entrypoint: '<string>',
clusterId: '<string>',
localStorageMountPoint: '<string>',
networkStorages: [{Id: '<string>', mountPoint: '<string>'}],
networkId: '<string>',
kind: '<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));<?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' => '<string>',
'productId' => '<string>',
'imageUrl' => '<string>',
'imageAuth' => '<string>',
'imageAuthId' => '<string>',
'ports' => '<string>',
'envs' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'tools' => [
[
'name' => '<string>',
'port' => '<string>',
'type' => '<string>'
]
],
'command' => '<string>',
'entrypoint' => '<string>',
'clusterId' => '<string>',
'localStorageMountPoint' => '<string>',
'networkStorages' => [
[
'Id' => '<string>',
'mountPoint' => '<string>'
]
],
'networkId' => '<string>',
'kind' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <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/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"productId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuth\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"ports\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"port\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"localStorageMountPoint\": \"<string>\",\n \"networkStorages\": [\n {\n \"Id\": \"<string>\",\n \"mountPoint\": \"<string>\"\n }\n ],\n \"networkId\": \"<string>\",\n \"kind\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"name\": \"<string>\",\n \"productId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuth\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"ports\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"port\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"localStorageMountPoint\": \"<string>\",\n \"networkStorages\": [\n {\n \"Id\": \"<string>\",\n \"mountPoint\": \"<string>\"\n }\n ],\n \"networkId\": \"<string>\",\n \"kind\": \"<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 = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"name\": \"<string>\",\n \"productId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuth\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"ports\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"port\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"localStorageMountPoint\": \"<string>\",\n \"networkStorages\": [\n {\n \"Id\": \"<string>\",\n \"mountPoint\": \"<string>\"\n }\n ],\n \"networkId\": \"<string>\",\n \"kind\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Request Headers
string
required
Enum:
application/jsonstring
required
Bearer authentication format, for example: Bearer {{API Key}}.
Request Body
string
CPU instance name. String, length limit: 0-255 characters.
string
required
Product ID for deploying the instance. You can query this via the List CPU Products API. String, length limit: 1-255 characters.
string
required
Container image URL. String, length limit: 1-500 characters.
string
Image repository authentication. Format: username:password. Required for private images; not required for public images or platform images. String, length limit: 0-10239 characters.
string
Image repository authentication ID.
string
Ports exposed by the instance. String, 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.
object[]
object[]
Enable official image support tools. Array. Currently, some official images only include Jupyter. The total number of ports used by ports + tools must not exceed 15.
string
Container startup command. This setting will override the Docker image’s CMD. String, length limit: 0-2047 characters.
string
Container startup entrypoint. This setting will override the Docker image’s ENTRYPOINT. String, length limit: 0-2047 characters.
string
Specify the cluster ID to create the instance in. If left empty, the instance will be created in a random cluster. String, length limit: 0-255 characters.
string
Mount point for local storage. Default: “/workspace”. String, length limit: 1-4095 characters.
object[]
string
VPC network ID. Leave empty if not using a VPC network.
string
required
Instance type. Valid values: cpu, gpu. Must be set to cpu.
Response
string
Created instance ID.
Last modified on December 24, 2025
Was this page helpful?
⌘I