Skip to main content

Desktop API

All communication with your desktop goes through the Desktop API:
https://desktop.api.getnen.ai/desktops/{desktop_id}
This base URL serves two endpoints:
EndpointMethodDescription
/toolsGETDiscover available tools and their schemas
/executePOSTExecute a tool action (screenshot, click, type, etc.)

Authentication

All requests require a Bearer token in the Authorization header:
import httpx

DESKTOP_ID = "dsk_abc123def456"
BASE_URL = f"https://desktop.api.getnen.ai/desktops/{DESKTOP_ID}"
headers = {"Authorization": "Bearer sk_nen_..."}

Discover Tools

Get the list of available tools and their schemas:
curl -H "Authorization: Bearer sk_nen_..." \
  "https://desktop.api.getnen.ai/desktops/dsk_abc123def456/tools"
Returns an array of tool definitions compatible with any LLM’s tool/function-calling format.

Execute a Tool

Send an action to the desktop controller:
result = httpx.post(
    f"{BASE_URL}/execute",
    json={"action": {"tool": "computer", "action": "screenshot", "params": {}}},
    headers=headers,
    timeout=30.0,
).json()

# result: {"status": "ok", "base64_image": "iVBOR..."}
The request body format is:
{
  "action": {
    "tool": "computer",
    "action": "screenshot",
    "params": {}
  }
}
FieldDescription
toolTool name (e.g., computer)
actionAction to perform (screenshot, left_click, type, key, scroll, etc.)
paramsAction-specific parameters (coordinate, text, amount, etc.)

Connection Health

Verify connectivity by calling the tools endpoint:
curl -H "Authorization: Bearer sk_nen_..." \
  "https://desktop.api.getnen.ai/desktops/dsk_abc123def456/tools"
A successful response (HTTP 200 with tool schemas) means the desktop is ready.

Next Steps

Tools Reference

Learn the full request/response format for tool calls

Quickstart

Run a complete agent loop