Create and start a new Browser Use Agent task.
This is the main endpoint for running AI agents. You can either:
When starting a new session:
When adding to an existing session:
Key features:
Args:
Returns:
Raises:
Request model for creating a new task
Attributes: task: The task prompt/instruction for the agent agent_settings: Agent configuration (optional) browser_settings: Browser configuration (optional) included_file_names: Optional list of file names to include in the task (file names from user file presigned upload URL response) structured_output_json: JSON schema for structured output (optional) metadata: Additional metadata associated with the task (optionally set by the user) secrets: Sensitive data (passwords, tokens) for the session (deleted after session is stopped)
Successful Response
Response model for creating a task
Attributes: task_id: An unique identifier for the created task session_id: The ID of the session this task belongs to