Quickstart
Deploy and start a server in five minutes with the SDK or plain HTTP.
1. Create an API key
Sign in, open Dashboard → API keys, and create a key. Copy the secret — it is shown only once.
bashexport CLOUD_API_KEY="ak_live_..."
2. Install the SDK
bashnpm install @enzonic/cloud-api
3. Find an egg and a region
tsimport { CloudClient } from "@enzonic/cloud-api"; const cloud = new CloudClient({ apiKey: process.env.CLOUD_API_KEY! }); const { eggs } = await cloud.eggs(); const { regions } = await cloud.regions(); console.log(eggs[0]); // { instanceId, eggId, name, ... } console.log(regions); // [{ region: "USA", deployable: true, ... }]
4. Deploy
tsconst server = await cloud.servers.create({ name: "lobby-smp", eggId: eggs[0].eggId, instanceId: eggs[0].instanceId, // optional; auto-picked otherwise region: "USA", // or null for auto ramMb: 2048, cpuPercent: 200, diskMb: 10240, }); await cloud.servers.power(server.id, "start"); console.log("Deployed", server.id);
5. Manage it
tsawait cloud.servers.command(server.id, "say Hello from Cloud API"); const usage = await cloud.servers.resources(server.id); const { data } = await cloud.files.list(server.id, "/") as any; await cloud.servers.delete(server.id); // when you're done
That's the whole loop. See Deploying servers for the full set of options.