Template
Create Template
Model APIs
- Image, Audio and Video
GPUs
- GPU Instance
- Cluster
- Instance
- Template
- Product
- Image Registry
- Storage
Template
Create Template
POST
/
gpu-instance
/
openapi
/
v1
/
template
/
create
Request Headers
Enum: application/json
Bearer authentication format, for example: Bearer {{API Key}}.
Request Body
Template settings.
Template name.
Template README content (in Markdown format).
Template type.
Enum: instance
Template channel.
Enum: private
Docker image address for instance startup.
Startup command for the instance.
Root filesystem storage (GB).
Local volume storage (GB).
Local volume mount path.
Response
ID of the created template.
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",
"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"
}
]
}
}'
Response
{
"templateId": "1"
}
Was this page helpful?