Model APIs
- Introduction
- LLM API
- Image, Audio and Video
GPUs
- GPU Instance
- Cluster
- Instance
- Template
- Product
- Network
- Image Registry
- Storage
- Serverless GPUs
Template
Create Template
POST
/
gpu-instance
/
openapi
/
v1
/
template
/
create
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>"
}
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).
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?
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>"
}
Assistant
Responses are generated using AI and may contain mistakes.