Create Endpoint
curl --request POST \
--url https://api.novita.ai/gpu-instance/openapi/v1/endpoint/create \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"endpoint": {
"name": "<string>",
"appName": "<string>",
"workerConfig": {
"minNum": 123,
"maxNum": 123,
"freeTimeout": 123,
"maxConcurrent": 123,
"gpuNum": 123,
"requestTimeout": 123
},
"ports": [
{
"port": "<string>"
}
],
"policy": {
"type": "<string>",
"value": 123
},
"image": {
"image": "<string>",
"authId": "<string>",
"command": "<string>"
},
"products": [
{
"id": "<string>"
}
],
"rootfsSize": 123,
"volumeMounts": [
{
"type": "<string>",
"size": 123,
"id": "<string>",
"mountPath": "<string>"
}
],
"clusterID": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"healthy": {
"path": "<string>"
}
}
}
'import requests
url = "https://api.novita.ai/gpu-instance/openapi/v1/endpoint/create"
payload = { "endpoint": {
"name": "<string>",
"appName": "<string>",
"workerConfig": {
"minNum": 123,
"maxNum": 123,
"freeTimeout": 123,
"maxConcurrent": 123,
"gpuNum": 123,
"requestTimeout": 123
},
"ports": [{ "port": "<string>" }],
"policy": {
"type": "<string>",
"value": 123
},
"image": {
"image": "<string>",
"authId": "<string>",
"command": "<string>"
},
"products": [{ "id": "<string>" }],
"rootfsSize": 123,
"volumeMounts": [
{
"type": "<string>",
"size": 123,
"id": "<string>",
"mountPath": "<string>"
}
],
"clusterID": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"healthy": { "path": "<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({
endpoint: {
name: '<string>',
appName: '<string>',
workerConfig: {
minNum: 123,
maxNum: 123,
freeTimeout: 123,
maxConcurrent: 123,
gpuNum: 123,
requestTimeout: 123
},
ports: [{port: '<string>'}],
policy: {type: '<string>', value: 123},
image: {image: '<string>', authId: '<string>', command: '<string>'},
products: [{id: '<string>'}],
rootfsSize: 123,
volumeMounts: [{type: '<string>', size: 123, id: '<string>', mountPath: '<string>'}],
clusterID: '<string>',
envs: [{key: '<string>', value: '<string>'}],
healthy: {path: '<string>'}
}
})
};
fetch('https://api.novita.ai/gpu-instance/openapi/v1/endpoint/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/endpoint/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([
'endpoint' => [
'name' => '<string>',
'appName' => '<string>',
'workerConfig' => [
'minNum' => 123,
'maxNum' => 123,
'freeTimeout' => 123,
'maxConcurrent' => 123,
'gpuNum' => 123,
'requestTimeout' => 123
],
'ports' => [
[
'port' => '<string>'
]
],
'policy' => [
'type' => '<string>',
'value' => 123
],
'image' => [
'image' => '<string>',
'authId' => '<string>',
'command' => '<string>'
],
'products' => [
[
'id' => '<string>'
]
],
'rootfsSize' => 123,
'volumeMounts' => [
[
'type' => '<string>',
'size' => 123,
'id' => '<string>',
'mountPath' => '<string>'
]
],
'clusterID' => '<string>',
'envs' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'healthy' => [
'path' => '<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/endpoint/create"
payload := strings.NewReader("{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\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/endpoint/create")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/gpu-instance/openapi/v1/endpoint/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 \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Serverless GPUs
Create Endpoint
POST
/
gpu-instance
/
openapi
/
v1
/
endpoint
/
create
Create Endpoint
curl --request POST \
--url https://api.novita.ai/gpu-instance/openapi/v1/endpoint/create \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"endpoint": {
"name": "<string>",
"appName": "<string>",
"workerConfig": {
"minNum": 123,
"maxNum": 123,
"freeTimeout": 123,
"maxConcurrent": 123,
"gpuNum": 123,
"requestTimeout": 123
},
"ports": [
{
"port": "<string>"
}
],
"policy": {
"type": "<string>",
"value": 123
},
"image": {
"image": "<string>",
"authId": "<string>",
"command": "<string>"
},
"products": [
{
"id": "<string>"
}
],
"rootfsSize": 123,
"volumeMounts": [
{
"type": "<string>",
"size": 123,
"id": "<string>",
"mountPath": "<string>"
}
],
"clusterID": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"healthy": {
"path": "<string>"
}
}
}
'import requests
url = "https://api.novita.ai/gpu-instance/openapi/v1/endpoint/create"
payload = { "endpoint": {
"name": "<string>",
"appName": "<string>",
"workerConfig": {
"minNum": 123,
"maxNum": 123,
"freeTimeout": 123,
"maxConcurrent": 123,
"gpuNum": 123,
"requestTimeout": 123
},
"ports": [{ "port": "<string>" }],
"policy": {
"type": "<string>",
"value": 123
},
"image": {
"image": "<string>",
"authId": "<string>",
"command": "<string>"
},
"products": [{ "id": "<string>" }],
"rootfsSize": 123,
"volumeMounts": [
{
"type": "<string>",
"size": 123,
"id": "<string>",
"mountPath": "<string>"
}
],
"clusterID": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"healthy": { "path": "<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({
endpoint: {
name: '<string>',
appName: '<string>',
workerConfig: {
minNum: 123,
maxNum: 123,
freeTimeout: 123,
maxConcurrent: 123,
gpuNum: 123,
requestTimeout: 123
},
ports: [{port: '<string>'}],
policy: {type: '<string>', value: 123},
image: {image: '<string>', authId: '<string>', command: '<string>'},
products: [{id: '<string>'}],
rootfsSize: 123,
volumeMounts: [{type: '<string>', size: 123, id: '<string>', mountPath: '<string>'}],
clusterID: '<string>',
envs: [{key: '<string>', value: '<string>'}],
healthy: {path: '<string>'}
}
})
};
fetch('https://api.novita.ai/gpu-instance/openapi/v1/endpoint/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/endpoint/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([
'endpoint' => [
'name' => '<string>',
'appName' => '<string>',
'workerConfig' => [
'minNum' => 123,
'maxNum' => 123,
'freeTimeout' => 123,
'maxConcurrent' => 123,
'gpuNum' => 123,
'requestTimeout' => 123
],
'ports' => [
[
'port' => '<string>'
]
],
'policy' => [
'type' => '<string>',
'value' => 123
],
'image' => [
'image' => '<string>',
'authId' => '<string>',
'command' => '<string>'
],
'products' => [
[
'id' => '<string>'
]
],
'rootfsSize' => 123,
'volumeMounts' => [
[
'type' => '<string>',
'size' => 123,
'id' => '<string>',
'mountPath' => '<string>'
]
],
'clusterID' => '<string>',
'envs' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'healthy' => [
'path' => '<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/endpoint/create"
payload := strings.NewReader("{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\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/endpoint/create")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/gpu-instance/openapi/v1/endpoint/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 \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Request Headers
string
requerido
Enum:
application/jsonstring
requerido
Bearer authentication format, for example: Bearer {{API Key}}.
Request Body
object
requerido
Endpoint configuration.
Ocultar properties
Ocultar properties
string
Endpoint name. String with a length limit of 0-220 characters.
string
Application name (reflected in the URL). The application name is part of the Endpoint URL, supports customization, and defaults to the Endpoint ID.
object
requerido
Worker configuration. The valid range is dynamically retrieved through the parameter limits API.
object[]
requerido
HTTP ports. Only one port is supported. Supported port range: 1-65535, excluding internal ports 2222, 2223, and 2224.
Mostrar properties
Mostrar properties
string
requerido
HTTP port.
object
requerido
Scaling policy. The valid range is dynamically retrieved through the parameter limits API.
Mostrar properties
Mostrar properties
string
requerido
Scaling policy type. Available values:
queue: Queue latency policy, scales workers based on request wait time in the queue.concurrency: Queue request policy, scales workers based on the number of requests in the queue.
integer
requerido
The meaning of value depends on the type:
- When type = queue, value represents the queue wait time in seconds.
- When type = concurrency, value represents the maximum number of requests in the queue.
object
requerido
Container image configuration.
Mostrar properties
Mostrar properties
string
requerido
Image address. String with a length limit of 0-511 characters.
string
Private image credential ID (not required for public images or platform user images). String with a length limit of 0-255 characters.
string
Container startup command. String with a length limit of 0-2047 characters.
integer
requerido
Root filesystem size in GB. Currently fixed at 100.
object[]
requerido
Storage configuration in GB.
Mostrar properties
Mostrar properties
string
requerido
Storage type. Available values:
local: Local storage.network: Network storage.
integer
Local storage size, currently fixed at 30. Not required for network storage.
string
Network storage ID. Not required for local storage.
string
requerido
Storage mount path. String with a length limit of 0-255 characters.
string
Cluster information. Required when mounting cloud storage and must match the cluster ID where the cloud storage is located. String with a length limit of 0-255 characters.
object[]
Response
string
The created Endpoint ID.
Última modificación el 15 de mayo de 2026
⌘I