Create Task
Create and start a new task.
You can either:
- Start a new task without a sessionId (auto-creates a session with US proxy by default). Note: Tasks without a sessionId are one-off tasks that automatically close the session upon completion (keep_alive=false). Use sessionSettings to configure the auto-created session (e.g. proxyCountryCode, profileId, screen dimensions).
- Start a new task in an existing session (reuse for follow-up tasks or custom configuration)
Note: Without sessionSettings, a US proxy is enabled by default. Providing sessionSettings overrides defaults — proxy is only enabled if proxyCountryCode is set. For full control over session configuration (e.g. keep_alive), create a session first via POST /sessions with your desired settings, then pass that sessionId when creating tasks.
POST
/
tasks
Create Task
const options = {
method: 'POST',
headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
task: '<string>',
llm: 'browser-use-2.0',
startUrl: '<string>',
maxSteps: 100,
structuredOutput: '<string>',
sessionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {},
secrets: {},
allowedDomains: ['<string>'],
opVaultId: '<string>',
sessionSettings: {
profileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
proxyCountryCode: 'us',
browserScreenWidth: 3232,
browserScreenHeight: 1888,
enableRecording: false
},
highlightElements: false,
flashMode: false,
thinking: false,
vision: true,
systemPromptExtension: '',
judge: false,
judgeGroundTruth: '<string>',
skillIds: ['<string>']
})
};
fetch('https://api.browser-use.com/api/v2/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.browser-use.com/api/v2/tasks \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"task": "<string>",
"llm": "browser-use-2.0",
"startUrl": "<string>",
"maxSteps": 100,
"structuredOutput": "<string>",
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"secrets": {},
"allowedDomains": [
"<string>"
],
"opVaultId": "<string>",
"sessionSettings": {
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"proxyCountryCode": "us",
"browserScreenWidth": 3232,
"browserScreenHeight": 1888,
"enableRecording": false
},
"highlightElements": false,
"flashMode": false,
"thinking": false,
"vision": true,
"systemPromptExtension": "",
"judge": false,
"judgeGroundTruth": "<string>",
"skillIds": [
"<string>"
]
}
'import requests
url = "https://api.browser-use.com/api/v2/tasks"
payload = {
"task": "<string>",
"llm": "browser-use-2.0",
"startUrl": "<string>",
"maxSteps": 100,
"structuredOutput": "<string>",
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"secrets": {},
"allowedDomains": ["<string>"],
"opVaultId": "<string>",
"sessionSettings": {
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"proxyCountryCode": "us",
"browserScreenWidth": 3232,
"browserScreenHeight": 1888,
"enableRecording": False
},
"highlightElements": False,
"flashMode": False,
"thinking": False,
"vision": True,
"systemPromptExtension": "",
"judge": False,
"judgeGroundTruth": "<string>",
"skillIds": ["<string>"]
}
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Browser session is stopped. Please start a new session and try again."
}{
"detail": "Session not found"
}{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}{
"detail": "Too many concurrent active sessions. Please wait for one to finish, kill one, or upgrade your plan."
}Body
application/json
Request model for creating a task
The LLM model to use for the agent.
Available options:
browser-use-llm, browser-use-2.0, bu-2-0-mini-preview, gpt-4.1, gpt-4.1-mini, o4-mini, o3, gpt-5.5, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gemini-2.5-flash, gemini-2.5-pro, gemini-3-pro-preview, gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-3.5-flash, gemini-flash-latest, gemini-flash-lite-latest, claude-sonnet-4-20250514, claude-sonnet-4-5-20250929, claude-sonnet-5, claude-opus-4-5-20251101, claude-opus-4-7, claude-opus-4-8, claude-opus-5, glm-5.2, minimax-m3, grok-4.6, glm-5.3-flash, deepseek-v4-flash-vision, llama-4-maverick-17b-128e-instruct, claude-3-7-sonnet-20250219 The LLM model to use for judging. If not provided, uses the default judge LLM.
Available options:
browser-use-llm, browser-use-2.0, bu-2-0-mini-preview, gpt-4.1, gpt-4.1-mini, o4-mini, o3, gpt-5.5, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gemini-2.5-flash, gemini-2.5-pro, gemini-3-pro-preview, gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-3.5-flash, gemini-flash-latest, gemini-flash-lite-latest, claude-sonnet-4-20250514, claude-sonnet-4-5-20250929, claude-sonnet-5, claude-opus-4-5-20251101, claude-opus-4-7, claude-opus-4-8, claude-opus-5, glm-5.2, minimax-m3, grok-4.6, glm-5.3-flash, deepseek-v4-flash-vision, llama-4-maverick-17b-128e-instruct, claude-3-7-sonnet-20250219 Was this page helpful?
⌘I
Create Task
const options = {
method: 'POST',
headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
task: '<string>',
llm: 'browser-use-2.0',
startUrl: '<string>',
maxSteps: 100,
structuredOutput: '<string>',
sessionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {},
secrets: {},
allowedDomains: ['<string>'],
opVaultId: '<string>',
sessionSettings: {
profileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
proxyCountryCode: 'us',
browserScreenWidth: 3232,
browserScreenHeight: 1888,
enableRecording: false
},
highlightElements: false,
flashMode: false,
thinking: false,
vision: true,
systemPromptExtension: '',
judge: false,
judgeGroundTruth: '<string>',
skillIds: ['<string>']
})
};
fetch('https://api.browser-use.com/api/v2/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.browser-use.com/api/v2/tasks \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"task": "<string>",
"llm": "browser-use-2.0",
"startUrl": "<string>",
"maxSteps": 100,
"structuredOutput": "<string>",
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"secrets": {},
"allowedDomains": [
"<string>"
],
"opVaultId": "<string>",
"sessionSettings": {
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"proxyCountryCode": "us",
"browserScreenWidth": 3232,
"browserScreenHeight": 1888,
"enableRecording": false
},
"highlightElements": false,
"flashMode": false,
"thinking": false,
"vision": true,
"systemPromptExtension": "",
"judge": false,
"judgeGroundTruth": "<string>",
"skillIds": [
"<string>"
]
}
'import requests
url = "https://api.browser-use.com/api/v2/tasks"
payload = {
"task": "<string>",
"llm": "browser-use-2.0",
"startUrl": "<string>",
"maxSteps": 100,
"structuredOutput": "<string>",
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"secrets": {},
"allowedDomains": ["<string>"],
"opVaultId": "<string>",
"sessionSettings": {
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"proxyCountryCode": "us",
"browserScreenWidth": 3232,
"browserScreenHeight": 1888,
"enableRecording": False
},
"highlightElements": False,
"flashMode": False,
"thinking": False,
"vision": True,
"systemPromptExtension": "",
"judge": False,
"judgeGroundTruth": "<string>",
"skillIds": ["<string>"]
}
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Browser session is stopped. Please start a new session and try again."
}{
"detail": "Session not found"
}{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}{
"detail": "Too many concurrent active sessions. Please wait for one to finish, kill one, or upgrade your plan."
}