POST
/
templates
Create a new template
curl --request POST \
  --url https://rest.runpod.io/v1/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "category": "NVIDIA",
  "containerDiskInGb": 50,
  "containerRegistryAuthId": "<string>",
  "dockerEntrypoint": [],
  "dockerStartCmd": [],
  "env": {
    "ENV_VAR": "value"
  },
  "imageName": "<string>",
  "isPublic": false,
  "isServerless": false,
  "name": "<string>",
  "ports": [
    "8888/http",
    "22/tcp"
  ],
  "readme": "",
  "volumeInGb": 20,
  "volumeMountPath": "/workspace"
}'
{
  "category": "NVIDIA",
  "containerDiskInGb": 50,
  "containerRegistryAuthId": "<string>",
  "dockerEntrypoint": [],
  "dockerStartCmd": [],
  "earned": 100,
  "env": {
    "ENV_VAR": "value"
  },
  "id": "30zmvf89kd",
  "imageName": "runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04",
  "isPublic": false,
  "isRunpod": true,
  "isServerless": true,
  "name": "my template",
  "ports": [
    "8888/http",
    "22/tcp"
  ],
  "readme": "<string>",
  "runtimeInMin": 123,
  "volumeInGb": 20,
  "volumeMountPath": "/workspace"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create a new template.

imageName
string
required

Docker image name.

name
string
required

Template name.

category
enum<string>
default:NVIDIA

The compute category of the resource defined by this template.

Available options:
NVIDIA,
AMD,
CPU
containerDiskInGb
integer
default:50

The amount of disk space in GB to allocate for the container.

containerRegistryAuthId
string

The unique string representing the container auth object needed for a private image.

dockerEntrypoint
string[]

If specified, overrides the ENTRYPOINT for the Docker image run on the Pods using this template. If [], uses the ENTRYPOINT defined in the DockerFile.

dockerStartCmd
string[]

If specified, overrides the start CMD for the Docker image run on the Pods using this template. If [], uses the start CMD defined in the DockerFile.

env
object
Example:
{ "ENV_VAR": "value" }
isPublic
boolean
default:false

If this is a Pod template, specifies whether the template is visible to other Runpod users.

isServerless
boolean
default:false

Whether the template specifies a Serverless worker or a Pod.

ports
string[]

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

Example:
["8888/http", "22/tcp"]
readme
string
default:""

README content in markdown format.

volumeInGb
integer
default:20

The amount of disk space, in gigabytes (GB), to allocate on the Pods deployed with this template.

volumeMountPath
string
default:/workspace

If a volume is attached to a Pod deployed with this template, the absolute path where the volume will be mounted in the filesystem.

Response

Successful operation.

category
string

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

Example:

"NVIDIA"

containerDiskInGb
integer

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.

Example:

50

containerRegistryAuthId
string
dockerEntrypoint
string[]

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

Example:
[]
dockerStartCmd
string[]

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.

Example:
[]
earned
number

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

Example:

100

env
object
Example:
{ "ENV_VAR": "value" }
id
string

A unique string identifying a template.

Example:

"30zmvf89kd"

imageName
string

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

Example:

"runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04"

isPublic
boolean

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.

Example:

false

isRunpod
boolean

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

Example:

true

isServerless
boolean

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

Example:

true

name
string

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

Example:

"my template"

ports
string[]

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.

Example:
["8888/http", "22/tcp"]
readme
string

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

runtimeInMin
integer
volumeInGb
integer

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.

Example:

20

volumeMountPath
string

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:

"/workspace"