Skip to main content
POST
/
templates
/
save
/templates/save
curl --request POST \
  --url https://api.shadeform.ai/v1/templates/save \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "name": "My Template",
  "description": "A template for ML workloads",
  "public": true,
  "auto_delete": {
    "date_threshold": "2006-01-02T15:04:05-07:00",
    "spend_threshold": "3.14"
  },
  "alert": {
    "date_threshold": "2006-01-02T15:04:05-07:00",
    "spend_threshold": "3.14"
  },
  "volume_mount": {
    "auto": true
  },
  "tags": [
    "ml",
    "pytorch"
  ],
  "envs": [
    {
      "name": "HUGGING_FACE_HUB_TOKEN",
      "value": "hugging_face_api_token"
    }
  ],
  "networking": {
    "ufw_rules": [
      {
        "rule": "allow",
        "from_ip": "192.168.1.0/24",
        "to_ip": "10.0.0.0/8",
        "port": "80",
        "proto": "tcp"
      }
    ]
  }
}
'
{
  "id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}

Authorizations

X-API-KEY
string
header
required

Body

application/json
name
string
required

Name of the template

Example:

"My Template"

description
string

Description of the template

Example:

"A template for ML workloads"

public
boolean

Whether the template is publicly available

Example:

true

launch_configuration
object

Defines automatic actions after the instance becomes active.

auto_delete
object

Set a date or spend threshold to automatically delete the instance

alert
object

Alert configuration

volume_mount
object

Volume mount configuration

tags
string[]

Tags associated with the template

Example:
["ml", "pytorch"]
envs
object[]

Environment variables for the template

networking
object

Network and firewall configuration

Response

200 - application/json

Returns a TemplateCreateResponse object

Response of the /templates/save API call

id
string<uuid>
required

The unique identifier for the instance. Used in the instances for the /instances/{id}/info and /instances/{id}/delete APIs.

Example:

"d290f1ee-6c54-4b01-90e6-d701748f0851"