Create Browsercode Run
Start a new browsercode conversation, or continue one (session_id).
Async: accepts the task and returns a slim RunAccepted handle (202). Poll
GET /runs//status or GET /runs/ for progress + result.
MOCKED dispatch; real v4 dispatch is a follow-up. The continuation-config 400 rule below is REAL (validation).
Authorizations
Body
Start a new browsercode conversation OR continue an existing one.
ONE door. Omit session_id to start a new conversation (full config body).
Pass session_id to continue a thread (MINIMAL body — config is inherited).
Continuation never 409s on a busy session: the turn comes back queued and
starts automatically when the current run finishes.
CONTINUATION RULE (enforced): passing session_id together with ANY config
field (model / workspaceId / browser / judge / maxCostUsd) → 400. Config is
inherited on a follow-up; start a new session to change it.
What you want the agent to do.
1Model to run. New-conversation only — inherited on a continuation. Omit for the server default.
Continue this conversation. Files and config carry over; send a MINIMAL body (task + attachedFileIds). Omit to start a new conversation.
ADVANCED + new-conversation only. Run in an explicit workspace to share files across sessions. Omit on the normal path.
Browser/proxy/screen settings. New-conversation only (inherited on a follow-up).
Upload ids (from POST /agents/browsercode/files) to give THIS run. Allowed on both new and continuation runs.
20USD cap for this run. New-conversation only; null → server default.
x > 0Opt-in post-run LLM judge. New-conversation only.
Response
Successful Response
Async run accepted. Poll GET /runs/{id}/status or GET /runs/{id} for progress + result.
Run id, e.g. "run_...".
Which agent is running it.
browser-use, browsercode The conversation this run belongs to (new or continued).
Initial state — 'queued' or 'running'.
queued, running, completed, failed, stopped The run's workspace, if the agent has one (browsercode). Its files live here.
Attached upload ids that could not be confirmed in storage at creation. The run still starts.