POST
/
gpu-instance
/
openapi
/
v1
/
gpu
/
instance
/
create

Request Headers

Content-Type
string
required

Enum: application/json

Authorization
string
required

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

Request Body

name
string
required

Instance name.

productId
string
required

ID of the product used to deploy the instance.

gpuNum
integer
required

Number of GPUs allocated to the instance.

cpuNum
integer

Number of vCPU cores allocated to the instance.

memory
integer

Memory allocated to the instance (GB).

diskSize
integer
required

Disk space allocated to each instance (GB).

rootfsSize
integer
required

Root filesystem storage (GB).

imageUrl
string
required

Docker image URL to initialize the instance.

imageAuth
string

Docker image registry credentials in username:password format.

ports
string
required

Exposed ports.

envs
object[]

Environment variables.

tools
object[]

Official docker image built-in tools.

command
string
required

Startup command for the instance.

clusterId
string

ID of the cluster where the instance will be deployed.

localStorageMountPoint
string

Mount point for the local storage.

networkStorages
object[]

Cloud Mount Configuration (supports up to 30 cloud storage mounts)

networkStorageId
string

ID of the network storage.

networkStorageMountPoint
string

Mount point for the network storage.

networkId
string

VPC Network ID; leave empty if not using a VPC network.

kind
string
required

Instance TypeEnum: gpu

Response

id
string

ID of the created instance.

Example

Request

curl --request POST \
  --url 'https://api.novita.ai/gpu-instance/openapi/v1/gpu/instance/create' \\
  --header 'Authorization: Bearer {{API Key}}' \\
  --header 'Content-Type: application/json' \\
  --data '{
  "name": "gpu-test",                
  "productId": "26",                      
  "gpuNum": 1,                           
  "cpuNum": 0,                           
  "memory": 0,                        
  "diskSize": 60,                       
  "rootfsSize": 30,                       
  "imageUrl": "infrai/pytorch:2.2.1",     
  "imageAuth": "",                        
  "ports": "8080/tcp,8081/http",                  
  "envs": [                             
      {
          "key": "test",
          "value": "test"
      }
  ],
  "tools": [
      {
          "name": "Jupyter",
          "port": "8888",
          "type": "http"
      }
  ],
  "command": "",                         
  "clusterId": "",                            
  "localStorageMountPoint": "/workspace",
  "networkStorages": [
      {
          "Id": "e797ce8f-f4ff-4b3b-b7a8-6972d96f46f2",
          "mountPoint": "/network_0"
      },
      {
          "Id": "b924cdf5-82ec-4903-bdb2-74a03f2b0ae7",
          "mountPoint": "/network_1"
      }
  ],
  "networkId": "18f1ff05-1370-45ce-a4c6-b58d5e8d547e", 
  "kind": "gpu"
}'

Response

{
  "id": "<string>"
}