https://api.browser-use.com/api/v2
to https://api.browser-use.com/api/v4.
Sessions and tasks
- V2: a session is a browser. You create it (or let a task create it), then run tasks in it.
- V4: a session is a conversation. Every run
creates one unless you pass
sessionId, and it starts the browser for you. There is noPOST /sessions. Browser options go in the run’sbrowserSettingsand apply when the run starts a new browser. A follow-up run can reuse the session’s live browser, which keeps its settings.
POST /browsers, as in V2.
Endpoints
Create-request fields
Response fields
Models
Some V2 model names, such asbrowser-use-2.0, don’t exist in V4. V2 bills
the agent per step, while V4 bills the model per token. In V4, browser time is
billed separately and is not in totalCostUsd (Billing). Omit model to use your project’s default, or pick one
from Models.
SDK
Thebrowser-use-sdk package holds both versions. Change the import and the
call: