Skip to main content
POST
/
v2
/
templates
Error
A valid request URL is required to generate request examples
{
  "image": "runpod/pytorch:2.8.0-py3.11-cuda12.8.1",
  "args": "",
  "disk": 50,
  "ports": [
    "8888/http",
    "22/tcp"
  ],
  "env": {
    "JUPYTER_PASSWORD": "hunter2"
  },
  "registry": null,
  "id": "tpl_abc",
  "name": "My PyTorch Template",
  "mounts": {
    "persistent": {
      "size": 20,
      "path": "/workspace"
    }
  },
  "serverless": false,
  "public": false
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Reusable container configuration shared across templates, pods, and serverless endpoints. Adding a field here automatically propagates to all three resources.

image
string
required

Docker image reference

Example:

"runpod/pytorch:2.8.0-py3.11-cuda12.8.1"

name
string
required
Minimum string length: 1
Example:

"My PyTorch Template"

category
enum<string>
required

Hardware family this template targets.

  • CPU — CPU-only workloads
  • NVIDIA — NVIDIA GPU workloads
  • AMD — AMD GPU workloads
Available options:
CPU,
NVIDIA,
AMD
args
string

Arguments passed to the container entrypoint

Example:

""

disk
integer

Container disk in GB (ephemeral, wiped on restart)

Required range: x >= 1
Example:

50

ports
string[]

Exposed ports, formatted as port/protocol

Example:
["8888/http", "22/tcp"]
env
object

Environment variables as key-value pairs

Example:
{ "JUPYTER_PASSWORD": "hunter2" }
registry
string | null

Container registry credential ID (for private images)

Example:

null

mounts
object

Storage mounts attached to a template. Templates support only a single persistent mount today; any network property is rejected with 422 by the schema validator.

PATCH semantics: omitting mounts or sending {} leaves the existing mount unchanged.

serverless
boolean
default:false
public
boolean
default:false

Response

Created

Reusable container configuration shared across templates, pods, and serverless endpoints. Adding a field here automatically propagates to all three resources.

image
string
required

Docker image reference

Example:

"runpod/pytorch:2.8.0-py3.11-cuda12.8.1"

args
string
required

Arguments passed to the container entrypoint

Example:

""

disk
integer
required

Container disk in GB (ephemeral, wiped on restart)

Required range: x >= 1
Example:

50

ports
string[]
required

Exposed ports, formatted as port/protocol

Example:
["8888/http", "22/tcp"]
env
object
required

Environment variables as key-value pairs

Example:
{ "JUPYTER_PASSWORD": "hunter2" }
registry
string | null
required

Container registry credential ID (for private images)

Example:

null

id
string
required
Example:

"tpl_abc"

name
string
required
Example:

"My PyTorch Template"

mounts
object
required

Storage mounts attached to a template. Templates support only a single persistent mount today; any network property is rejected with 422 by the schema validator.

PATCH semantics: omitting mounts or sending {} leaves the existing mount unchanged.

serverless
boolean
required

Whether this template is for serverless workers (true) or pods (false)

Example:

false

public
boolean
required

Whether this template is visible to other RunPod users

Example:

false

category
enum<string>
required

Hardware family this template targets.

  • CPU — CPU-only workloads
  • NVIDIA — NVIDIA GPU workloads
  • AMD — AMD GPU workloads
Available options:
CPU,
NVIDIA,
AMD