Skip to main content
POST
/
api
/
v1
/
cvms
/
provision
Provision DStack app
curl --request POST \
  --url https://cloud-api.phala.com/api/v1/cvms/provision \
  --header 'Content-Type: application/json' \
  --data '
{
  "compose_file": {
    "name": "<string>",
    "allowed_envs": [
      "<string>"
    ],
    "bash_script": "<string>",
    "default_gateway_domain": "<string>",
    "docker_compose_file": "<string>",
    "init_script": "<string>",
    "kms_enabled": true,
    "local_key_provider_enabled": false,
    "manifest_version": 2,
    "no_instance_id": false,
    "pre_launch_script": "<string>",
    "public_logs": true,
    "public_sysinfo": true,
    "public_tcbinfo": true,
    "runner": "docker-compose",
    "gateway_enabled": true,
    "features": [
      "kms",
      "tproxy-net"
    ],
    "salt": "<string>",
    "secure_time": false,
    "storage_fs": "zfs",
    "tproxy_enabled": true
  },
  "name": "<string>",
  "instance_type": "<string>",
  "vcpu": 123,
  "memory": 123,
  "disk_size": 123,
  "image": "<string>",
  "prefer_dev": true,
  "teepod_id": 123,
  "region": "<string>",
  "listed": true,
  "kms_id": "<string>",
  "kms": "phala",
  "nonce": 123,
  "app_id": "<string>",
  "env_keys": [
    "<string>"
  ],
  "ports": [
    {
      "protocol": "<string>",
      "host_port": 123,
      "vm_port": 123,
      "host_address": "<string>"
    }
  ],
  "encrypted_env": "<string>",
  "user_config": "<string>",
  "hugepages": false,
  "pin_numa": false,
  "gpus": {
    "gpus": [
      {
        "slot": "<string>",
        "product_id": "<string>"
      }
    ],
    "attach_mode": "listed"
  },
  "kms_urls": [
    "<string>"
  ],
  "gateway_urls": [
    "<string>"
  ],
  "experimental_vpc_server_app_id": "<string>"
}
'

Body

application/json

Request for provisioning a DStack app with automatic resource matching.

Most fields are optional and will be automatically determined by the resource matching logic in preflight_dstack_app. Only compose_file and name are required.

compose_file
AppComposeV2 · object
required
name
string
required

CVM name (used as hostname): 5-63 chars, must start with letter, can contain letters/numbers/hyphens

instance_type
string | null
vcpu
integer | null
memory
integer | null
disk_size
integer | null
image
string | null
prefer_dev
boolean | null

Prefer dev OS image (True) or non-dev OS image (False). When None, auto-selects based on image name or defaults to dev.

teepod_id
integer | null
region
string | null
listed
boolean
default:true
kms_id
string | null
kms
enum<string> | null
default:phala
Available options:
phala,
ethereum,
base,
legacy
nonce
integer | null

Optional nonce for deterministic app_id generation. When provided, app_id must also be provided. System will verify: app_id == get_create_address(team_wallet, nonce)

app_id
string | null

Optional app_id for manual specification. Required when nonce is provided. Only works with PHALA KMS.

env_keys
string[]
ports
PortMapping · object[] | null
encrypted_env
string | null
user_config
string | null
hugepages
boolean
default:false
pin_numa
boolean
default:false
gpus
GpuConfig · object
kms_urls
string[]
gateway_urls
string[]
experimental_vpc_server_app_id
string | null

Response

Provision data with compose_hash for creation