Docs / API reference

Templates

A template stores an image, disks, ports, environment and start command so you can launch identical pods or endpoints. Registry credentials let templates, pods and endpoints pull private images.

The template object

NameTypeDescription
idstringUnique ID, prefixed tpl_.
objectstringAlways template.
namestringUnique within the organization.
typeenumPOD or SERVERLESS. Serverless templates ignore ports and volumeInGb.
visibilityenumPRIVATE (only you) or TEAM (everyone in the organization).
imagestringDocker image reference.
registryCredentialIdstring | nullCredentials for a private registry.
startCommandstring | nullOverrides the image's CMD.
containerDiskInGbintegerContainer disk size.
volumeInGbintegerVolume disk size (pods only).
volumeMountPathstringMount path of the volume (pods only).
portsarrayPorts to expose (pods only).
envobjectEnvironment variables, may reference {{ secrets.NAME }}.
readmestring | nullMarkdown shown in the console when launching.
createdAtstringISO 8601 timestamp.
updatedAtstringISO 8601 timestamp.
template object
{
  "id": "tpl_2w7q9k4x",
  "object": "template",
  "name": "pytorch-jupyter",
  "type": "POD",
  "visibility": "TEAM",
  "image": "apipods/pytorch:2.9.0-py3.12-cuda12.8.1",
  "registryCredentialId": null,
  "startCommand": null,
  "containerDiskInGb": 50,
  "volumeInGb": 100,
  "volumeMountPath": "/workspace",
  "ports": [
    {
      "port": 8888,
      "protocol": "http"
    },
    {
      "port": 22,
      "protocol": "tcp"
    }
  ],
  "env": {
    "JUPYTER_PASSWORD": "{{ secrets.JUPYTER_PASSWORD }}"
  },
  "readme": "PyTorch 2.9 with JupyterLab on port 8888 and SSH on port 22.",
  "createdAt": "2026-09-04T11:00:00Z",
  "updatedAt": "2026-11-01T15:22:31Z"
}

Endpoints

MethodPathDescription
GET/templatesList templates
POST/templatesCreate a template
GET/templates/{templateId}Retrieve a template
PATCH/templates/{templateId}Update a template
DELETE/templates/{templateId}Delete a template
GET/registry-credentialsList registry credentials
POST/registry-credentialsAdd registry credentials
DELETE/registry-credentials/{registryCredentialId}Delete registry credentials

List templates

GET/templates

Templates visible to you: your private templates plus all TEAM templates. Also includes Apipods-maintained templates when includeOfficial=true.

Parameters

NameInTypeDescription
typequeryenumPOD or SERVERLESS.
includeOfficialquerybooleanInclude official templates (IDs start with tpl_ap). Default false.
limitqueryinteger1 to 100, default 20.
cursorquerystringPagination cursor.

Request

curl https://api.apipods.com/v1/templates?type=POD \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "object": "list",
  "data": [
    {
      "id": "tpl_2w7q9k4x",
      "object": "template",
      "name": "pytorch-jupyter",
      "type": "POD",
      "visibility": "TEAM",
      "image": "apipods/pytorch:2.9.0-py3.12-cuda12.8.1",
      "registryCredentialId": null,
      "startCommand": null,
      "containerDiskInGb": 50,
      "volumeInGb": 100,
      "volumeMountPath": "/workspace",
      "ports": [
        {
          "port": 8888,
          "protocol": "http"
        },
        {
          "port": 22,
          "protocol": "tcp"
        }
      ],
      "env": {
        "JUPYTER_PASSWORD": "{{ secrets.JUPYTER_PASSWORD }}"
      },
      "readme": "PyTorch 2.9 with JupyterLab on port 8888 and SSH on port 22.",
      "createdAt": "2026-09-04T11:00:00Z",
      "updatedAt": "2026-11-01T15:22:31Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}

Create a template

POST/templates

Creates a template. Pass templateId when creating a pod or endpoint to use it.

Parameters

NameInTypeDescription
namerequiredbodystringUnique name.
typerequiredbodyenumPOD or SERVERLESS.
imagerequiredbodystringDocker image.
visibilitybodyenumDefault PRIVATE.
…bodyAny other field of the template object.

Request

curl -X POST https://api.apipods.com/v1/templates \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "pytorch-jupyter",
    "type": "POD",
    "visibility": "TEAM",
    "image": "apipods/pytorch:2.9.0-py3.12-cuda12.8.1",
    "containerDiskInGb": 50,
    "volumeInGb": 100,
    "ports": [
      {
        "port": 8888,
        "protocol": "http"
      },
      {
        "port": 22,
        "protocol": "tcp"
      }
    ],
    "env": {
      "JUPYTER_PASSWORD": "{{ secrets.JUPYTER_PASSWORD }}"
    }
  }'

Response

201 Created
{
  "id": "tpl_2w7q9k4x",
  "object": "template",
  "name": "pytorch-jupyter",
  "type": "POD",
  "visibility": "TEAM",
  "image": "apipods/pytorch:2.9.0-py3.12-cuda12.8.1",
  "registryCredentialId": null,
  "startCommand": null,
  "containerDiskInGb": 50,
  "volumeInGb": 100,
  "volumeMountPath": "/workspace",
  "ports": [
    {
      "port": 8888,
      "protocol": "http"
    },
    {
      "port": 22,
      "protocol": "tcp"
    }
  ],
  "env": {
    "JUPYTER_PASSWORD": "{{ secrets.JUPYTER_PASSWORD }}"
  },
  "readme": "PyTorch 2.9 with JupyterLab on port 8888 and SSH on port 22.",
  "createdAt": "2026-09-04T11:00:00Z",
  "updatedAt": "2026-11-01T15:22:31Z"
}
StatusWhen
400invalid_parameter: a template with this name already exists.

Retrieve a template

GET/templates/{templateId}

Returns one template.

Parameters

NameInTypeDescription
templateIdrequiredpathstringThe template ID.

Request

curl https://api.apipods.com/v1/templates/tpl_2w7q9k4x \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "id": "tpl_2w7q9k4x",
  "object": "template",
  "name": "pytorch-jupyter",
  "type": "POD",
  "visibility": "TEAM",
  "image": "apipods/pytorch:2.9.0-py3.12-cuda12.8.1",
  "registryCredentialId": null,
  "startCommand": null,
  "containerDiskInGb": 50,
  "volumeInGb": 100,
  "volumeMountPath": "/workspace",
  "ports": [
    {
      "port": 8888,
      "protocol": "http"
    },
    {
      "port": 22,
      "protocol": "tcp"
    }
  ],
  "env": {
    "JUPYTER_PASSWORD": "{{ secrets.JUPYTER_PASSWORD }}"
  },
  "readme": "PyTorch 2.9 with JupyterLab on port 8888 and SSH on port 22.",
  "createdAt": "2026-09-04T11:00:00Z",
  "updatedAt": "2026-11-01T15:22:31Z"
}

Update a template

PATCH/templates/{templateId}

Updates a template. Existing pods and endpoints created from it are not changed; they copied the values at creation time.

Parameters

NameInTypeDescription
templateIdrequiredpathstringThe template ID.

Request

curl -X PATCH https://api.apipods.com/v1/templates/tpl_2w7q9k4x \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "apipods/pytorch:2.9.1-py3.12-cuda12.8.1"
  }'

Response

200 OK
{
  "id": "tpl_2w7q9k4x",
  "object": "template",
  "name": "pytorch-jupyter",
  "type": "POD",
  "visibility": "TEAM",
  "image": "apipods/pytorch:2.9.1-py3.12-cuda12.8.1",
  "registryCredentialId": null,
  "startCommand": null,
  "containerDiskInGb": 50,
  "volumeInGb": 100,
  "volumeMountPath": "/workspace",
  "ports": [
    {
      "port": 8888,
      "protocol": "http"
    },
    {
      "port": 22,
      "protocol": "tcp"
    }
  ],
  "env": {
    "JUPYTER_PASSWORD": "{{ secrets.JUPYTER_PASSWORD }}"
  },
  "readme": "PyTorch 2.9 with JupyterLab on port 8888 and SSH on port 22.",
  "createdAt": "2026-09-04T11:00:00Z",
  "updatedAt": "2026-11-18T13:10:00Z"
}

Delete a template

DELETE/templates/{templateId}

Deletes a template. Pods and endpoints created from it keep running; their templateId stays set for reference.

Parameters

NameInTypeDescription
templateIdrequiredpathstringThe template ID.

Request

curl -X DELETE https://api.apipods.com/v1/templates/tpl_2w7q9k4x \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

Returns 204 No Content with an empty body.

List registry credentials

GET/registry-credentials

Returns stored credentials. Passwords and tokens are write-only and never returned.

Request

curl https://api.apipods.com/v1/registry-credentials \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "object": "list",
  "data": [
    {
      "id": "rcr_6w2m9q4k",
      "object": "registry_credential",
      "name": "ghcr-acme",
      "registry": "ghcr.io",
      "username": "acme-bot",
      "createdAt": "2026-10-02T09:12:44Z",
      "updatedAt": "2026-10-02T09:12:44Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}

Add registry credentials

POST/registry-credentials

Stores credentials for a private registry (Docker Hub, GHCR, ECR, GCR, Artifact Registry or any registry that supports basic auth). Use a read-only token.

Parameters

NameInTypeDescription
namerequiredbodystringDisplay name.
registryrequiredbodystringRegistry host, e.g. ghcr.io or docker.io.
usernamerequiredbodystringRegistry username.
passwordrequiredbodystringPassword or access token. Write-only.

Request

curl -X POST https://api.apipods.com/v1/registry-credentials \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ghcr-acme",
    "registry": "ghcr.io",
    "username": "acme-bot",
    "password": "ghp_…"
  }'

Response

201 Created
{
  "id": "rcr_6w2m9q4k",
  "object": "registry_credential",
  "name": "ghcr-acme",
  "registry": "ghcr.io",
  "username": "acme-bot",
  "createdAt": "2026-10-02T09:12:44Z",
  "updatedAt": "2026-10-02T09:12:44Z"
}

Delete registry credentials

DELETE/registry-credentials/{registryCredentialId}

Deletes credentials. Running pods and workers keep their pulled image, but new pulls of a private image will fail.

Parameters

NameInTypeDescription
registryCredentialIdrequiredpathstringThe credential ID.

Request

curl -X DELETE https://api.apipods.com/v1/registry-credentials/rcr_6w2m9q4k \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

Returns 204 No Content with an empty body.