curl --request POST \
--url https://api.novita.ai/gpu-instance/openapi/v1/template/create \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '{
"template": {
"name": "<string>",
"readme": "<string>",
"type": "<string>",
"channel": "<string>",
"image": "<string>",
"startCommand": "<string>",
"rootfsSize": 123,
"ports": [
{
"type": "<string>",
"ports": [
"<string>"
]
}
],
"volumes": [
{
"type": "<string>",
"size": 123,
"mountPath": "<string>"
}
],
"envs": [
{
"key": "<string>",
"value": "<string>"
}
]
}
}'
{
"templateId": "<string>"
}
curl --request POST \
--url https://api.novita.ai/gpu-instance/openapi/v1/template/create \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '{
"template": {
"name": "<string>",
"readme": "<string>",
"type": "<string>",
"channel": "<string>",
"image": "<string>",
"startCommand": "<string>",
"rootfsSize": 123,
"ports": [
{
"type": "<string>",
"ports": [
"<string>"
]
}
],
"volumes": [
{
"type": "<string>",
"size": 123,
"mountPath": "<string>"
}
],
"envs": [
{
"key": "<string>",
"value": "<string>"
}
]
}
}'
{
"templateId": "<string>"
}
application/json
Hide properties
instance
private
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"
}
]
}
}'
{
"templateId": "1"
}
Was this page helpful?