ThinkRun

llms.txt

Agent API

Execute autonomous browser tasks with AI. Submit a natural-language instruction and the agent creates a session, plans actions, and executes them automatically. Poll for status or cancel at any time.

Workflow

  1. Submit — POST an instruction to /api/agent/execute. Returns a taskId immediately.
  2. Poll — GET /api/agent/:taskId/status until the status is terminal (completed, failed, or timeout).
  3. Cancel (optional) — POST /api/agent/:taskId/cancel to abort a running task.

Endpoints

POST/api/agent/execute

Start an autonomous agent task. The agent creates a browser session, plans actions based on your instruction, and executes them automatically.

Body Parameters

instructionstringrequiredNatural-language instruction for the agent (max 10,000 chars)
backendstringAI backend: "gemini" (default) or "claude"
timeoutMsnumberExecution timeout in ms (30000–600000, default 300000)

Response

{
  "success": true,
  "data": {
    "taskId": "a1b2c3d4-...",
    "sessionId": "e5f6g7h8-...",
    "status": "starting",
    "backend": "gemini"
  },
  "message": "Agent execution delegated to browser machine. Poll /api/agent/:taskId/status for progress."
}
GET/api/agent/:taskId/status

Poll the status of an agent task. Returns current progress, output, and final result when complete.

Query Parameters

sessionIdstringSession ID hint for cross-machine polling (optional)

Response

{
  "success": true,
  "data": {
    "taskId": "a1b2c3d4-...",
    "status": "completed",
    "output": "Successfully navigated to example.com and extracted the page title.",
    "startedAt": "2026-02-09T12:00:00Z",
    "completedAt": "2026-02-09T12:00:15Z"
  }
}
POST/api/agent/:taskId/cancel

Cancel a running agent task. The task must be owned by the authenticated user.

Response

{
  "success": true,
  "message": "Agent task cancelled"
}

Task Statuses

StatusTerminalDescription
startingNoSession is being provisioned
pendingNoWaiting for machine to be ready
runningNoAgent is executing browser actions
completedYesTask finished successfully
failedYesTask encountered an error
timeoutYesTask exceeded the timeout limit
cancelledYesTask was cancelled by the user

MCP Page Cache Tools

Three stateless MCP tools — no sessionId required. Install: npx @thinkrun/mcp. Cloud mode consumes credits; local is free.

ToolREST endpointCredits (cloud)Description
page_cache_htmlPOST /api/cache/html1Fetch rendered HTML. Returns { html, metadata }
page_cache_textPOST /api/cache/text1Extract plain text. Returns { text, metadata }
page_cache_screenshotPOST /api/cache/screenshot3Capture PNG. Returns { artifactUrl, metadata }

All three tools accept url (required) and options (optional). Key options: provider (cloud|local), sensitive, waitFor, timeout, fullPage, maxDimension. Set options.sensitive: true to prevent the URL from being sent to third-party scrapers.