# Create Template - Documentation

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/api-reference/gpu-instance-create-template

# Create Template

POST

/

gpu-instance

/

openapi

/

v1

/

template

/

create

Try it

Create Template

cURL

```
curl --request POST \
--url https://api.novita.ai/gpu-instance/openapi/v1/template/create \
--header 'Authorization: &#x3C;authorization>' \
--header 'Content-Type: &#x3C;content-type>' \
--data '
{
"template": {
"name": "&#x3C;string>",
"readme": "&#x3C;string>",
"type": "&#x3C;string>",
"channel": "&#x3C;string>",
"image": "&#x3C;string>",
"imageAuth": "&#x3C;string>",
"startCommand": "&#x3C;string>",
"entrypoint": "&#x3C;string>",
"rootfsSize": 123,
"ports": [
{
"type": "&#x3C;string>",
"ports": [
123
]
}
],
"envs": [
{
"key": "&#x3C;string>",
"value": "&#x3C;string>"
}
],
"minCudaVersion": "&#x3C;string>"
}
}
'
```

200

```
{
"templateId": "&#x3C;string>"
}
```

##

[​](#request-headers)

Request Headers

[​](#param-content-type)

Content-Type

string

required

Enum: `application/json`

[​](#param-authorization)

Authorization

string

required

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

##

[​](#request-body)

Request Body

[​](#param-template)

template

object

required

Template settings.

Hide properties

[​](#param-name)

name

string

required

Template name. String, length limit: 1-255 characters.

[​](#param-readme)

readme

string

Template README content (in Markdown format). String, length limit: 0-102400 characters.

[​](#param-type)

type

string

required

Template type.

Enum: `instance`

[​](#param-channel)

channel

string

required

Template channel.

Enum: `private`

[​](#param-image)

image

string

required

Docker image address for instance startup. String, length limit: 1-500 characters.

[​](#param-image-auth)

imageAuth

string

Image repository authentication ID for private images. String, length limit: 0-255 characters.

[​](#param-start-command)

startCommand

string

Startup command for the instance. String, length limit: 0-2047 characters.

[​](#param-entrypoint)

entrypoint

string

Instance startup entrypoint. This setting will override the Docker image’s ENTRYPOINT. String, length limit: 0-2047 characters.

[​](#param-rootfs-size)

rootfsSize

integer

required

Root filesystem storage (GB). Integer, value must be greater than 0.

[​](#param-ports)

ports

object[]

Exposed port settings.

Hide properties

[​](#param-type-1)

type

string

required

Exposed port types.

Enum: `http`, `tcp`

[​](#param-ports-1)

ports

integer[]

required

Exposed ports (maximum of 10). Supported port range: 1-65535, except for 2222, 2223, 2224 which are reserved for internal use.

[​](#param-envs)

envs

object[]

Environment variables injected into the instance. Up to 100 environment variable pairs can be created.

Hide properties

[​](#param-key)

key

string

Environment variable key. String, length limit: 0-511 characters.

[​](#param-value)

value

string

Environment variable value. String, length limit: 0-4095 characters.

[​](#param-min-cuda-version)

minCudaVersion

string

Minimum supported CUDA version. String, length limit: 0-255 characters. Format example: 11.8, 12.4.

##

[​](#response)

Response

[​](#param-template-id)

templateId

string

ID of the created template.

##

[​](#example)

Example

Request

```
curl --request POST \
--url 'https://api.novita.ai/gpu-instance/openapi/v1/template/create' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
"template": {
"name": "test",
"readme": "readme",
"type": "instance",
"channel": "private",
"readme": "test create template",
"image": "nginx",
"imageAuth": "",
"startCommand": "echo test",
"entrypoint": "",
"rootfsSize": 60,
"ports": [
{
"type": "http",
"ports": [80, 443]
},
{
"type": "tcp",
"ports": [90, 95]
}
],
"envs": [
{
"key": "test1",
"value": "template1"
},
{
"key": "test2",
"value": "test2"
}
],
"minCudaVersion": "11.8"
}
}'
```

Response

```
{
"templateId": "1"
}
```

Last modified on December 24, 2025
