Coasty/

Developer API

Machines

Provision a cloud VM the agent can drive

Provisioning

Provisioning, at a glance

Provision a cloud VM the agent can drive

POST /v1/machines
Provisioning creates an isolated Linux or Windows desktop, waits for the driver to become ready, and exposes a stable machine ID.

A machine is the stable execution target used by Tasks and Workflows. It can be a managed Coasty cloud VM or an external machine whose driver you operate. For a managed VM, provision one, poll until it is running, then either hand it to a task run (the agent drives it to done) or drive it yourself with the action endpoints. Machines are optional for primitives: /predict, /sessions, and /ground run against your screen. You only need a Coasty machine or an enrolled external machine when you want the hosted Task/Workflow runtime to own the loop.

Provision with POST /v1/machines. Only display_name is required; everything else has a sensible default. The body rejects unknown fields, so a typo returns 422 VALIDATION_ERROR rather than being silently ignored.

FieldTypeDefaultNotes
display_namestringrequiredHuman label, 1–64 chars.
os_typeenumlinuxlinux or windows. Windows costs more to run.
desktop_enabledbooleanfalseInstalls a GUI (XFCE + VNC). Required for screenshots and VNC.
cpu_coresnumberauto1–16. Capped by your tier.
memory_gbnumberauto1–64. Capped by your tier.
storage_gbnumberauto8–500.
restore_from_snapshotbooleanfalseBoot from your latest snapshot instead of a clean image (Linux only).
ttl_minutesnumbernullAuto-destroy after N minutes (5–10080). Omit for no auto-destroy — see Lifecycle & TTL.
metadataobjectnullFree-form tags: ≤16 entries, 64-char keys, 256-char values.
curl — provision a Linux desktop VM
curl -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"display_name": "agent-box", "os_type": "linux", "desktop_enabled": true, "ttl_minutes": 120}'

Provisioning is asynchronous. The response returns immediately with the machine in creating status and a connection object whose secrets are redacted. The VM is not drivable yet — poll GET /v1/machines/{id} until status is running before you send actions or start a run.

JSON
{
  "machine": {
    "id": "9f2c1e7a-3b6d-4c81-9a0e-2d5f8b1c4e90",
    "display_name": "agent-box",
    "kind": "managed",
    "capabilities": [
      "screenshot",
      "mouse",
      "keyboard",
      "scroll",
      "terminal",
      "files",
      "browser"
    ],
    "protocol_version": null,
    "connection_status": null,
    "last_seen_at": null,
    "status": "creating",
    "os_type": "linux",
    "desktop_enabled": true,
    "cpu_cores": 2,
    "memory_gb": 4,
    "storage_gb": 16,
    "public_ip": null,
    "auto_destroy_at": "2026-06-17T14:30:00Z",
    "ttl_minutes": 120,
    "is_test": false,
    "created_at": "2026-06-17T12:30:00Z"
  },
  "connection": {
    "public_ip": null,
    "ssh_port": 22,
    "ssh_username": "ubuntu",
    "has_ssh_key": true,
    "has_vnc_password": true
  },
  "request_id": "req_2f9c1a7b3e4d"
}

The machine object — returned by provision, list, and get:

FieldTypeDescription
idstringStable id. A UUID for live VMs; mch_test_<hex> for test-key mocks. Pass it to runs, workflows, and every /v1/machines/{id} call.
display_namestringThe human label you set at provision time.
kindenummanaged for a Coasty VM; external for a customer-operated driver.
capabilitiesstring[]Declared driver capabilities: screenshot, mouse, keyboard, scroll, terminal, files, browser.
protocol_versionstring|nullExternal driver protocol (currently 1); null for managed machines.
connection_statusenum|nullExternal liveness: connected, disconnected, stale, or revoked; null for managed machines.
last_seen_atdatetime|nullMost recent authenticated external-driver activity; null for managed machines.
statusstringLifecycle status — see the status table. Poll this until running before driving the machine.
os_typestring"linux" or "windows".
desktop_enabledbooleanWhether a GUI (XFCE + VNC) is installed. Required for screenshots and VNC.
cpu_coresnumberProvisioned vCPUs.
memory_gbnumberProvisioned RAM in GB.
storage_gbnumberProvisioned disk in GB.
public_ipstring|nullPublic IP once assigned (null while creating).
auto_destroy_atstring|nullISO-8601 resource-expiry time: managed infrastructure is destroyed; external registration/access is revoked. null means no TTL.
ttl_minutesnumber|nullThe resource TTL last applied (null = no automatic destroy/revoke).
is_testbooleantrue for a test-key mock VM. Lets you guard against mixing sandbox and live ids.
billingobject|nullRuntime-billing summary (rates, total_credits_billed, suspended_for_billing, auto_destroy_at). null on machines not metered to the API wallet.
created_atstringISO-8601 creation time.
started_atstring|nullISO-8601 time it last reached running.
metadataobjectYour free-form key/value tags (echoed back verbatim).

List your machines with GET /v1/machines (newest first, ?limit= 1–200, default 50) — it returns { data, has_more, request_id }. Fetch one with GET /v1/machines/{id}. Both read straight from the registry, so they keep working even when provisioning is busy.

Provisioning a live machine needs the machines:write scope, a wallet balance of at least 20 credits (including Unlimited consumer subscribers), and room under your plan's concurrent-machine cap. Building? An sk-coasty-test- key returns a fully-shaped mock VM (id mch_test_…, is_test: true) with zero billing — up to 5 at a time.
API reference — Coasty Computer Use API | Coasty - AI Computer-Use Agent