The one noun: a run
A run is one task an agent does. You start a run, watch it finish, and optionally continue it. You never create sessions or browsers — a run gives you asessionId, and files live on that conversation automatically (no workspace to manage — see Files).
The three verbs
1
Start a run
sessionId (to continue) — immediately. Files live on the conversation automatically; there’s no workspace to handle.2
Watch it finish
status is completed, then read result (the answer string; output is only set for structured output). The SDK’s run() waits for you.3
Continue (optional)
session_id back to keep the same thread of context.The ids you get back (never create)
A run hands you ids. They aren’t things you build — they’re names for what the run already made:
Files live on the conversation automatically — you never handle a
workspace_id. (A named workspace exists only for sharing files across different conversations — advanced.)
There is no “create a session” or “create a workspace” step. The first run makes them and returns their ids. You only ever create runs.
Choosing an agent
Two agents. Omit it and you getbrowser-use (the common case).
browser-use— browser tasks: navigate, click, extract. Fast, OSS.browsercode— code + browser: data processing, multi-step work.
GET /agents if you (or your LLM) want to pick programmatically. That’s the only “which agent” you ever need.
Optional: setting things up first
You never need these on the hot path — a run makes what it needs. They exist only if you want to prepare something before running:- Pre-load files before the first run → create a workspace and upload into it.
- Save a login to reuse → create a browser profile.
- Drive a browser yourself over CDP (no agent) → create a standalone browser.
That’s the whole model
You run tasks. A run gives you back ids (session, workspace). Reuse the ids to continue or add files. The browser is handled for you. Optional setup exists only for preparing something before you run.Start with the Quickstart.