Execute JavaScript in the persistent Browser REPL
Execute JavaScript in a persistent Node.js runtime inside the browser VM.
Top-level bindings, closures, mutations, and dynamically imported modules persist
across calls until the REPL is reset or replaced. Start with repl.help() to list
available methods, or call repl.help("click") for detailed help.
Expression values are ignored. Emit ordered text or image output with
repl.write(...), console methods, or repl.emitImage(...). The runtime also
exposes browser-control helpers, WebMCP, Patchright, Playwright, and raw CDP.
Executions are serialized. A timeout, crash, OOM, or protocol failure terminates
the REPL and changes its repl_id. This is unrestricted code execution inside the
browser VM and is not sandboxed.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Browser session ID or name
Body
Request to execute code in the persistent Browser REPL.
JavaScript evaluated in a persistent Node.js runtime. Top-level bindings
persist until the browser VM's API process exits, the REPL is reset, or
the REPL is terminated after a crash or timeout. Static top-level imports
are unsupported; use dynamic import(). Expression values are ignored;
emit output with repl.write(...), console methods, or
repl.emitImage(...). May be empty only when reset is true.
Terminate the current REPL, start a fresh one, and then evaluate code.
Maximum execution time in seconds. Default is 60.
1 <= x <= 300Response
Code executed with either a successful result or a structured JavaScript failure.
Result of Browser REPL code execution.
CUID2 identifying the exact state-holding REPL process used for this execution. Stable across calls and Chromium reconnects; changes after an API restart, explicit reset, execution timeout, or REPL crash.
Whether the code executed successfully.
Optional ordered text/image output produced by the execution.
Ordered discriminated union of Browser REPL output items.
- Option 1
- Option 2
True if text or image output was dropped or truncated due to response limits.
Wall-clock execution time in milliseconds.
Error message if execution failed.
True if the REPL identified by repl_id was terminated by this request.
The next request lazily starts a fresh REPL with a new repl_id.
Stack trace if execution failed.