# Take a screenshot
curl -H "Authorization: Bearer $TASKCLOUD_API_KEY" \
https://api.task.cloud/v1/sandboxes/$ID/screenshot -o screen.png
# Click, then type
curl -X POST -H "Authorization: Bearer $TASKCLOUD_API_KEY" \
-H "Content-Type: application/json" \
https://api.task.cloud/v1/sandboxes/$ID/input \
-d '{"actions":[
{"action":"left_click","coordinate":[640,410]},
{"action":"type","text":"hello from the agent"},
{"action":"key","text":"Return"}]}'
import { Client } from "@taskcloud/sdk";
const client = new Client(); // reads TASKCLOUD_API_KEY
const sbx = await client.sandboxes.create({ template: "desktop" });
const shot = await sbx.desktop.screenshot(); // { data (base64), media_type, width, height }
await sbx.desktop.input({
actions: [
{ action: "left_click", coordinate: [640, 410] },
{ action: "type", text: "hello from the agent" },
{ action: "key", text: "Return" },
],
});
// Let your user watch, read-only, for 10 minutes
const { url } = await sbx.desktop.stream({ ttl_seconds: 600, read_only: true });