Base URL
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.401- Missing or invalid API key402- Insufficient balance403- Account deactivated429- Rate limit exceeded503- No available instances
POST /start/send-message
Universal endpoint for all session control commands. Handles tasks, state changes, interactions, and guardrails. Authentication: Required Request Body:actionType: newTask
Start a new task. Returns taskId for polling.actionType: state
Control task execution (pause, resume, stop, terminate). Returns immediate success.actionType: interaction
Manual browser control. Returns immediate success.takeOverControl- Enable manual modereleaseControl- Return control to AICLICK- Click at coordinates{x, y}DOUBLE_CLICK- Double click at coordinates{x, y}TYPE- Type text{text, humanLike}KEY_PRESS- Press key{key}
actionType: guardrail
Respond to guardrail trigger. Returns immediate success.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: RequiredterminateOnCompletion is automatically set to true for this endpoint. The session will close after task completion.400- Missing task.prompt401- Missing or invalid API key402- Insufficient balance503- No available instances
File Upload Endpoints
POST /files/upload
Upload one or more files to use in tasks. ReturnsfileId references that can be attached to any task endpoint.
Authentication: Required
Content-Type: multipart/form-data
Request:
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 identifiertaskId- Task identifier
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.
401- Invalid API key402- Insufficient balance429- Rate limit exceeded503- No browser instances available- Guardrail error:
{"error": {"message": "Guardrail triggered: I need login credentials to proceed", "type": "guardrail_error", "code": "guardrail_triggered"}}