v1
latestOpenAPI 3.1.02026-07-2676123203.9 KBTemplates
Create a template
Creates a reusable container-configuration preset — image, disk, ports, env, registry, and mount settings — for pods and serverless endpoints. createPod and createEndpoint don't take a template ID; instead, spread a template's fields into the request body directly. Returns the created template.
post/v2/templates
Request body
Example request
{
"image": "runpod/pytorch:2.8.0-py3.11-cuda12.8.1",
"disk": 50,
"ports": [
"8888/http",
"22/tcp"
],
"env": {
"JUPYTER_PASSWORD": "hunter2"
},
"name": "My PyTorch Template",
"mounts": {
"persistent": {
"size": 20,
"path": "/workspace"
}
}
}Response
Created
Example response
{
"category": "NVIDIA",
"containerDiskInGb": 50,
"dockerEntrypoint": [],
"dockerStartCmd": [],
"earned": 100,
"env": {
"ENV_VAR": "value"
},
"id": "30zmvf89kd",
"imageName": "runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04",
"isRunpod": true,
"isServerless": true,
"name": "my template",
"ports": [
"8888/http",
"22/tcp"
],
"volumeInGb": 20,
"volumeMountPath": "/workspace"
}