POST
/
gpu-instance
/
openapi
/
v1
/
gpu
/
instance
/
create
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>",
  "gpuNum": 123,
  "rootfsSize": 123,
  "imageUrl": "<string>",
  "imageAuth": "<string>",
  "imageAuthId": "<string>",
  "ports": "<string>",
  "envs": [
    {
      "key": "<string>",
      "value": "<string>"
    }
  ],
  "tools": [
    {
      "name": "<string>",
      "port": "<string>",
      "type": "<string>"
    }
  ],
  "command": "<string>",
  "clusterId": "<string>",
  "networkStorages": [
    {
      "Id": "<string>",
      "mountPoint": "<string>"
    }
  ],
  "networkId": "<string>",
  "kind": "<string>",
  "month": 123
}'
{
  "id": "<string>"
}

Request Headers

Content-Type
string
required

Enum: application/json

Authorization
string
required

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

Request Body

name
string

Instance name. String, length limit: 0-255 characters.

productId
string
required

GPU product ID. String, length limit: 1-255 characters. You can query this via the List GPU Products API.

gpuNum
integer
required

Number of GPUs. Integer, valid range: [1, 8].

rootfsSize
integer
required

Root filesystem size. Integer, valid range: [10, 6144]. If the minimum value is less than 10 GB, the system will default to 10 GB. The maximum value is dynamically limited by available storage resources and can be queried via the product list API.

imageUrl
string
required

Image URL. String, length limit: 1-500 characters.

imageAuth
string

Image authentication (username:password). String, length limit: 0-10239 characters.

imageAuthId
string

Image repository authentication ID.

ports
string

Instance open ports, 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.

envs
object[]

Instance environment variables. Up to 30 environment variables can be created.

tools
object[]

Enable official image support tools. Currently, some official images only include Jupyter. The total number of ports used by ports + tools must not exceed 15.

command
string

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

clusterId
string

Specify the cluster ID to create the instance in. If left empty, the instance will be created in a random cluster.

networkStorages
object[]

Cloud storage mount configuration. Up to 30 cloud storages can be mounted.

networkId
string

VPC network ID. Leave empty if not using a VPC network.

kind
string
required

Instance type. Valid values: [gpu, cpu].

month
integer

Number of months for subscription instance. Set to 0 to create a pay-as-you-go instance. Integer, value must be greater than or equal to 0.

Response

id
string

Created instance ID.