Skip to main content
POST
/
v2
/
sandboxes
/
templates
Create a SandboxTemplate
curl --request POST \
  --url https://api.example.com/v2/sandboxes/templates \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "image": "<string>",
  "resources": {
    "cpu": "500m",
    "memory": "512Mi",
    "storage": "1Gi"
  },
  "volume_mounts": [
    {
      "volume_name": "<string>",
      "mount_path": "<string>"
    }
  ],
  "proxy_config": {
    "rules": [
      {
        "name": "<string>",
        "match_hosts": [
          "<string>"
        ],
        "inject_headers": {},
        "match_paths": [
          "<string>"
        ],
        "enabled": true
      }
    ],
    "no_proxy": [
      "<string>"
    ]
  }
}
'
{
  "name": "<string>",
  "image": "<string>",
  "resources": {
    "cpu": "500m",
    "memory": "512Mi",
    "storage": "1Gi"
  },
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "volume_mounts": [
    {
      "volume_name": "<string>",
      "mount_path": "<string>"
    }
  ],
  "proxy_config": {
    "rules": [
      {
        "name": "<string>",
        "match_hosts": [
          "<string>"
        ],
        "inject_headers": {},
        "match_paths": [
          "<string>"
        ],
        "enabled": true
      }
    ],
    "no_proxy": [
      "<string>"
    ]
  },
  "created_at": "<string>",
  "updated_at": "<string>"
}

Headers

X-API-Key
string | null
authorization
string | null
X-Tenant-Id
string | null

Body

application/json

Request model for creating a SandboxTemplate.

Users can only configure the container image, resource limits, volume mounts, and optional proxy configuration. All other pod spec details are filled in with secure defaults.

name
string
required

Name of the template (max 63 chars, DNS-1035 format: lowercase alphanumeric and hyphens, must start with letter)

image
string
required

Container image to use for the sandbox

Examples:

"python:3.12-slim"

"node:20-slim"

resources
ResourceSpec · object

Resource limits for the sandbox

volume_mounts
VolumeMountSpec · object[]

Optional list of volumes to mount in the sandbox

proxy_config
ProxyConfig · object

Optional proxy configuration for injecting secrets/headers into outbound HTTPS requests. When set, a smithbox-proxy sidecar will be deployed alongside the sandbox container.

Response

Successful Response

Response model for a SandboxTemplate.

name
string
required
image
string
required
resources
ResourceSpec · object
required

Resource specification for a sandbox.

id
string<uuid> | null

Unique template identifier

volume_mounts
VolumeMountSpec · object

Specification for mounting a volume in a sandbox template.

proxy_config
ProxyConfig · object

Proxy configuration for a sandbox template.

When proxy_config is set, a smithbox-proxy sidecar will be deployed alongside the sandbox container to intercept HTTPS traffic and inject headers based on the configured rules.

created_at
string | null
updated_at
string | null