Skip to main content
POST
Create a template

Authorizations

Authorization
string
header
required

Runpod API key authentication. Generate an API key in the Runpod console and send it in the Authorization header as Bearer <api_key>. Keys are scoped to the permissions granted when created; requests may return 403 when a valid key lacks access to the requested resource or action.

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"

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:
env
object

Environment variables as key-value pairs

Example:
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
category
enum<string>
default:NVIDIA

Optional. Defaults to NVIDIA when omitted.

Available options:
CPU,
NVIDIA,
AMD

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:
env
object
required

Environment variables as key-value pairs

Example:
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

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
Available options:
CPU,
NVIDIA,
AMD