Create Task
You can either:
- Start a new task (auto creates a new simple session)
- Start a new task in an existing session (you can create a custom session before starting the task and reuse it for follow-up tasks)
Headers
X-Browser-Use-API-Key
Request
This endpoint expects an object.
task
The task prompt/instruction for the agent.
llm
The LLM model to use for the agent.
startUrl
The URL to start the task from.
maxSteps
Maximum number of steps the agent can take before stopping.
structuredOutput
The stringified JSON schema for the structured output.
sessionId
The ID of the session where the task will run.
metadata
The metadata for the task.
secrets
The secrets for the task.
allowedDomains
The allowed domains for the task.
highlightElements
Tells the agent to highlight interactive elements on the page.
flashMode
Whether agent flash mode is enabled.
thinking
Whether agent thinking mode is enabled.
vision
Whether agent vision capabilities are enabled.
systemPromptExtension
Optional extension to the agent system prompt.
Response
Successful Response
id
Unique identifier for the created task