Runtimes

View as Markdown

A runtime is the running environment inside a space. Browser runtimes are the stable runtime type today.

Runtime = control
Run = observability

Use runtime APIs to launch, connect, invoke, move files, and stop. Use the current run to inspect what happened.

Create a browser runtime

1const runtime = await space.runtimes.browser.launch({
2 name: "quickbooks",
3 profile: "quickbooks-bot",
4 metadata: {
5 customerJobId: "job_123",
6 },
7});

The runtime name is first-class. Use names like crm, quickbooks, or research so scripts and agents can reason about the environment.

Runtime metadata

1console.log(runtime.id);
2console.log(runtime.status);
3console.log(runtime.activeRunId);

activeRunId is always present and nullable. Prefer runtime.currentRun() when you need the active run and its helpers.

1const run = await runtime.currentRun();
2
3await run.events.list();
4await run.artifacts.list();

Control the runtime through a connection

1const connection = await runtime.connections.create({
2 protocol: "cdp",
3});

Then pass connection.endpoint.url to your native browser framework.

1import { chromium } from "playwright";
2
3const browser = await chromium.connectOverCDP(connection.endpoint.url);

Stop a runtime

1await runtime.stop();

Stopping a runtime tears down its active browser process and prevents new connection attaches.

Runtime types

TypeStatusPrimary control path
BrowserCurrentCDP connection
DesktopPlannedCUA or RDP connection
SpreadsheetPlannedMCP or provider API connection

Only browser CDP connections are requestable today.