LogoFreestyle
API Reference/V m

Fork_vm

Fork VM

POST/v1/vms/{vm_id}/fork

Request Body

application/jsonRequired
idleTimeoutSecondsinteger | null
Format: "int64"
portsarray | null

Optional list of ports to expose externally. If not provided, port 3000 will be exposed on port 443 by default. Pass an empty array to disable external ports. Only ports 8081 and 443 can be configured externally for now. Any target port is allowed.

readySignalTimeoutSecondsinteger | null

Whether the api request should wait for the VM to be ready before returning. By default, the VM is considered ready when the serial console is ready for login.

Default: trueFormat: "int64"
waitForReadySignalboolean | null

How long to wait for the ready signal before timing out. Defaults to 120 seconds if not provided.

workdirstring | null

Optional working directory for the VM. File system and shell commands will be executed in this directory.

persistenceobject | object | object

Path Parameters

vm_idRequiredstring

Response Body

curl -X POST "https://api.freestyle.sh/v1/vms/<string>/fork" \
  -H "Content-Type: application/json" \
  -d '{
    "idleTimeoutSeconds": 0,
    "ports": [
      {
        "port": 443,
        "targetPort": 3000
      }
    ],
    "readySignalTimeoutSeconds": true,
    "waitForReadySignal": true,
    "workdir": "string",
    "persistence": {}
  }'

Freestyle AI

Documentation assistant

Experimental: AI responses may not always be accurate—please verify important details with the official documentation.

How can I help?

Ask me about Freestyle while you browse the docs.