import "dotenv/config";import Dedalus from "dedalus-labs";const client = new Dedalus({ xAPIKey: process.env.DEDALUS_API_KEY });const ws = await client.machines.create({ vcpu: 2, memory_mib: 4096, storage_gib: 10 });let m = ws;while (m.status.phase !== "running") { await new Promise((s) => setTimeout(s, 2000)); m = await client.machines.retrieve({ machine_id: ws.machine_id });}const mid = ws.machine_id;
exec(mid, cmd) below is a thin wrapper around client.machines.executions.create that polls until succeeded/failed and returns stdout. See the reference repo for the 15-line helper.
Enable the HTTP endpoint before starting the gateway or you restart it. setsid is how you detach: the execution API waits on foreground processes, and nohup & alone inherits the session.
model is an agent target. Override the backing LLM with x-openclaw-model: anthropic/claude-sonnet-4-6. Streaming with "stream": true. Sessions share history by user.