Skip to main content
POST
/
v1
/
templates
curl -X POST https://api.runtools.ai/v1/templates \
  -H "X-API-Key: rt_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "my-fullstack",
    "name": "Full Stack Environment",
    "os": "ubuntu-24.04",
    "runtimes": [
      { "name": "node", "version": "20" },
      { "name": "python", "version": "3.12" }
    ],
    "apt": ["postgresql-client", "redis-tools"],
    "npm": ["typescript", "tsx"],
    "pip": ["numpy", "pandas"],
    "env": {
      "NODE_ENV": "development"
    }
  }'
{
  "data": {
    "id": "tpl_abc123",
    "slug": "my-fullstack",
    "name": "Full Stack Environment",
    "status": "building",
    "createdAt": "2025-01-21T10:00:00Z"
  }
}

Request Body

slug
string
required
Unique template identifier
name
string
required
Display name
os
string
default:"ubuntu-24.04"
Base OS: ubuntu-22.04, ubuntu-24.04, debian-12, alpine-3.19
runtimes
array
Runtimes to install
apt
array
System packages to install
npm
array
NPM packages (if node/bun selected)
pip
array
Pip packages (if python selected)
env
object
Environment variables
dockerfile
string
Custom Dockerfile (alternative to builder config)

Response

id
string
Template ID
slug
string
Template slug
status
string
Build status: pending, building, ready, failed
curl -X POST https://api.runtools.ai/v1/templates \
  -H "X-API-Key: rt_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "my-fullstack",
    "name": "Full Stack Environment",
    "os": "ubuntu-24.04",
    "runtimes": [
      { "name": "node", "version": "20" },
      { "name": "python", "version": "3.12" }
    ],
    "apt": ["postgresql-client", "redis-tools"],
    "npm": ["typescript", "tsx"],
    "pip": ["numpy", "pandas"],
    "env": {
      "NODE_ENV": "development"
    }
  }'
{
  "data": {
    "id": "tpl_abc123",
    "slug": "my-fullstack",
    "name": "Full Stack Environment",
    "status": "building",
    "createdAt": "2025-01-21T10:00:00Z"
  }
}

Notes

  • Build typically takes 2-5 minutes
  • Use Get Template to check build status
  • Once status: ready, template can be used for sandboxes