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>",
  "imageUrl": "<string>",
  "imageAuth": "<string>",
  "imageAuthId": "<string>",
  "ports": "<string>",
  "envs": [
    {
      "key": "<string>",
      "value": "<string>"
    }
  ],
  "tools": [
    {
      "name": "<string>",
      "port": "<string>",
      "type": "<string>"
    }
  ],
  "command": "<string>",
  "clusterId": "<string>",
  "localStorageMountPoint": "<string>",
  "networkStorages": [
    {
      "Id": "<string>",
      "mountPoint": "<string>"
    }
  ],
  "networkId": "<string>",
  "kind": "<string>"
}'
{
  "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

CPU instance name. String, length limit: 0-255 characters.

productId
string
required

Product ID for deploying the instance. You can query this via the List CPU Products API. String, length limit: 1-255 characters.

imageUrl
string
required

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

imageAuth
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.

imageAuthId
string

Image repository authentication ID.

ports
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.

envs
object[]

Instance environment variables. Array, up to 30 environment variables.

tools
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.

command
string

Container startup command. This setting will override the Docker image’s CMD. 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. String, length limit: 0-255 characters.

localStorageMountPoint
string

Mount point for local storage. Default: “/workspace”. String, length limit: 1-4095 characters.

networkStorages
object[]

Cloud storage mount configuration. Array, 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: cpu, gpu. Must be set to cpu.

Response

id
string

Created instance ID.