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)
Authentication
X-Browser-Use-API-Keystring
API Key authentication via header
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. Up to 10 key-value pairs.
secrets
The secrets for the task. Allowed domains are not required for secrets to be injected, but are recommended.
allowedDomains
The allowed domains for the task.
opVaultId
The ID of the 1Password vault to use for the task. This is used to inject secrets into 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. Set to 'auto' to let the agent decide based on the model capabilities.
systemPromptExtension
Optional extension to the agent system prompt.
judge
Enable judge mode to evaluate task completion against ground truth.
judgeGroundTruth
Expected answer for judge evaluation.
judgeLlm
The LLM model to use for judging. If not provided, uses the default judge LLM.
Response
Successful Response
id
Unique identifier for the created task
sessionId
Session ID where the task was created