Skip to main content

Base URL

All endpoints use this base URL unless otherwise specified.

Session Endpoints

POST /start/start-session

Create a new persistent session that can run multiple tasks. Authentication: Required Request Body:
The task object contains all task-specific parameters. Use startingUrl to specify the URL where the task should begin. Use environmentId (top-level) to attach an environment with saved cookies, browser state, and persistent files. Use policyId (top-level) to enforce automation policy rules on agent actions. Use proxy (top-level) to route the session through a proxy server.
Response (200 OK):
Error Responses:
  • 401 - Missing or invalid API key
  • 402 - Insufficient balance
  • 403 - Account deactivated
  • 429 - Rate limit exceeded
  • 503 - No available instances
See Parameters Reference for detailed parameter descriptions.

POST /start/send-message

Universal endpoint for all session control commands. Handles tasks, state changes, interactions, and guardrails. Authentication: Required Request Body:
Supported Action Types:

actionType: newTask

Start a new task. Returns taskId for polling.
Response (completed within 50 seconds):
Response (still running):

actionType: state

Control task execution (pause, resume, stop, terminate). Returns immediate success.
Response:

actionType: interaction

Manual browser control. Returns immediate success.
Available Interaction Types:
  • takeOverControl - Enable manual mode
  • releaseControl - Return control to AI
  • CLICK - Click at coordinates {x, y}
  • DOUBLE_CLICK - Double click at coordinates {x, y}
  • TYPE - Type text {text, humanLike}
  • KEY_PRESS - Press key {key}
Response:

actionType: guardrail

Respond to guardrail trigger. Returns immediate success.
Response:
Error Responses:
  • 400 - Missing required fields (sessionId, message)
  • 401 - Session not found or unauthorized

POST /start/run-task

Execute a single task with auto-terminating session. Simplified version of start-session + send-message. Authentication: Required
terminateOnCompletion is automatically set to true for this endpoint. The session will close after task completion.
Request Body:
Response (completed within 50 seconds):
Response (still running):
Error Responses:
  • 400 - Missing task.prompt
  • 401 - Missing or invalid API key
  • 402 - Insufficient balance
  • 503 - No available instances

File Upload Endpoints

POST /files/upload

Upload one or more files to use in tasks. Returns fileId references that can be attached to any task endpoint. Authentication: Required Content-Type: multipart/form-data Request:
Response (200 OK):
Use the returned fileId values in the files array at the task level: inside task for /start/start-session, in the request body for /start/run-task, or inside message for /start/send-message. See File Uploads guide for complete examples.

Task Endpoints

GET /task/:sessionId/:taskId

Poll for task result. Path Parameters:
  • sessionId - Session identifier
  • taskId - Task identifier
Response (still running):
Response (completed):
Response (guardrail triggered):
Response (failed):
Error Responses:
  • 404 - Task not found

OpenAI-Compatible Endpoints

POST /v1/chat/completions

OpenAI-compatible chat completions endpoint. Creates a new session for each request and auto-terminates after completion. Authentication: Required (Bearer token)
The OpenAI-compatible endpoint creates a new session for each request. For multi-task workflows, use the native REST API.
Request Body:
Response (Non-Streaming):
Response (Streaming): Server-Sent Events (SSE) format:
Error Responses:
  • 401 - Invalid API key
  • 402 - Insufficient balance
  • 429 - Rate limit exceeded
  • 503 - No browser instances available
  • Guardrail error: {"error": {"message": "Guardrail triggered: I need login credentials to proceed", "type": "guardrail_error", "code": "guardrail_triggered"}}
See OpenAI-Compatible API for detailed integration guide.

GET /v1/models

List available models for OpenAI-compatible endpoint. Authentication: Required (Bearer token) Response:

Monitoring Endpoints

GET /start/health

System health check. Response:

Endpoint Summary