Machines
GET /v1/agents/machines
View as MarkdownLists the computers on your account.
Request
curl -s "$SAI_API_URL/v1/agents/machines" \
-H "Authorization: Bearer $SAI_API_KEY"Response
{
"machines": [
{
"machineId": "m_9c1e",
"name": "Sai cloud computer",
"updatedAt": 1789990000000,
"status": "hibernated",
"canWake": true,
"kind": "cloud",
"online": true
},
{
"machineId": "m_7f2a",
"name": "Work Desktop",
"updatedAt": 1790000000000,
"status": "active",
"canWake": false,
"kind": "own",
"online": true
}
]
}Rows are sorted by name.
Free accounts
A free account whose computer is not claimed right now sees one synthetic row:
{
"machines": [
{
"machineId": "free-3fA9kQ2xYz",
"name": "Sai cloud computer (free)",
"updatedAt": 0,
"canWake": false,
"kind": "cloud",
"online": false
}
]
}online: false means the first message will claim and start the computer, which takes about two minutes. While it is claimed, the row is a normal one with the same machineId.
Note
kind,onlineand the free-account row are available from October 1.
Create a computer
POST /v1/agents/machinesCreates a Windows cloud computer for a paid account. It needs a signed-in session: the portal's Create a cloud computer button in the Playground calls it. An API key cannot create a computer, because a computer costs money and is created with the account owner's own checks (plan, payment method, quota, one creation at a time).
Body (optional):
{ "name": "Work PC" }Response 202:
{
"taskId": "3f1c…",
"message": "Creating your computer. It appears in GET /v1/agents/machines within a few minutes."
}Poll GET /v1/agents/machines until the new computer is listed with online: true, usually within a few minutes.
Live screen
POST /v1/agents/machines/:machineId/liveReturns a view-only stream of one of your computers' screens: what the live view shows. The stream uses Apache Guacamole; connect websocketUrl with its JavaScript client (Guacamole.WebSocketTunnel + Guacamole.Client) and draw nothing back.
curl -s -X POST "$SAI_API_URL/v1/agents/machines/m_9c1e/live" \
-H "Authorization: Bearer $SAI_API_KEY"Response 200:
{
"machineId": "m_9c1e",
"websocketUrl": "wss://proxy.vm.api.simular.cloud/guacamole/websocket-tunnel?token=…",
"width": 1920,
"height": 1080
}websocketUrl carries a session token for that computer. Hand it only to your viewer, and get a new one when the stream ends. Split the query string off the URL and pass it to client.connect(), because Guacamole appends it itself.