Request Headers
Enum:
application/json
Bearer authentication format, for example: Bearer {{API Key}}.
Request Body
Template settings.
Hide properties
Hide properties
Template name.
Template README content (in Markdown format).
Template type.
Enum:
Enum:
instance
Template channel.
Enum:
Enum:
private
Docker image address for instance startup.
Startup command for the instance.
Root filesystem storage (GB).
Response
ID of the created template.
Example
RequestCopy
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",
"image": "redis",
"startCommand": "",
"rootfsSize": 10,
"localVolumeSize": 20,
"localVolumeMount": "/workspace",
"ports": [
{
"type": "tcp",
"ports": [
"8080",
"8090"
]
},
{
"type": "http",
"ports": [
"6000",
"60001"
]
}
],
"volumes": [
{
"type": "local",
"size": 20,
"mountPath": "/workspace"
}
],
"envs": [
{
"key": "testkey",
"value": "123"
}
]
}
}'
Copy
{
"templateId": "1"
}