v1

latestOpenAPI 3.1.02026-07-2676123203.9 KB
Templates

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

imagestring required

Docker image reference

argsstring

Arguments passed to the container entrypoint

diskinteger

Container disk in GB (ephemeral, wiped on restart)

portsstring[]

Exposed ports, formatted as port/protocol

envobject

Environment variables as key-value pairs

registrystring nullable

Container registry credential ID (for private images)

namestring required
serverlessboolean
publicboolean
category'CPU' | 'NVIDIA' | 'AMD'

Controls how the template is grouped and filtered in the Runpod console. It does not affect hardware selection, scheduling, or billing.

  • CPU — CPU-only workloads
  • NVIDIA — NVIDIA GPU workloads
  • AMD — AMD GPU workloads

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

categorystring

The category of the template. The category can be used to filter templates in the Runpod UI. Current categories are NVIDIA, AMD, and CPU.

containerDiskInGbinteger

The amount of disk space, in gigabytes (GB), to allocate on the container disk for a Pod or worker. The data on the container disk is wiped when the Pod or worker restarts. To persist data across restarts, set volumeInGb to configure the local network volume.

containerRegistryAuthIdstring
dockerEntrypointstring[]

If specified, overrides the ENTRYPOINT for the Docker image run on a Pod or worker. If [], uses the ENTRYPOINT defined in the image.

dockerStartCmdstring[]

If specified, overrides the start CMD for the Docker image run on a Pod or worker. If [], uses the start CMD defined in the image.

earnednumber

The amount of Runpod credits earned by the creator of a template by all Pods or workers created from the template.

envobject
idstring

A unique string identifying a template.

imageNamestring

The image tag for the container run on Pods or workers created from a template.

isPublicboolean

Set to true if a template is public and can be used by any Runpod user. Set to false if a template is private and can only be used by the creator.

isRunpodboolean

If true, a template is an official template managed by Runpod.

isServerlessboolean

If true, instances created from a template are Serverless workers. If false, instances created from a template are Pods.

namestring

A user-defined name for a template. The name needs to be unique.

portsstring[]

A list of ports exposed on a Pod or worker. Each port is formatted as [port number]/[protocol]. Protocol can be either http or tcp.

readmestring

A string of markdown-formatted text that describes a template. The readme is displayed in the Runpod UI when a user selects the template.

runtimeInMininteger
volumeInGbinteger

The amount of disk space, in gigabytes (GB), to allocate on the local network volume for a Pod or worker. The data on the local network volume is persisted across restarts. To persist data so that future Pods and workers can access it, create a network volume and set networkVolumeId to attach it to the Pod or worker.

volumeMountPathstring

If a local network volume or network volume is attached to a Pod or worker, the absolute path where the network volume is mounted in the filesystem.

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"
}