Skip to content
中文

Cloud Browser

Cloud Browser is Chrome running in the cloud: connect directly with Playwright or Puppeteer, or watch and take over in Console.

When to use it

Cloud Chrome you script; people watch and take over in Console.

Use it when

  • A page must be rendered, clicked, filled or used logged in; handoff.create asks a person.

Not for, use instead

  • Text of a public page → search
  • Passwords → vault

How it behaves

  • Use praxis.browser.connect(), never a local install; reuse one named session per task.

Combines with

  • Login state lives in a browser context.

Entry: praxis.browser.* · docs developers/browser/index

Three ways to connect

Run these examples with Node.js. Set PRAXIS_API_KEY, save the code as an .mjs file, then run it with node. Install the client packages; no local Chrome download is needed.

终端窗口
export PRAXIS_API_KEY="your API Key"
npm install playwright @browserbasehq/sdk

One-step connection

Connect to wss://api.deepraxis.com/browser/v1/connect to create a browser. Use ?session=<id> to attach to an existing session, or ?name=<name> to attach if that name exists and create otherwise. Names accept 1–128 letters, digits, or . _ : -. Do not send both session and name.

import { chromium } from "playwright";
const headers = { Authorization: `Bearer ${process.env.PRAXIS_API_KEY}` };
const browser = await chromium.connectOverCDP(
"wss://api.deepraxis.com/browser/v1/connect",
{ headers },
);
const cdp = await browser.newBrowserCDPSession();
const session = await cdp.send("Praxis.getSession");
console.log(session.sessionId, session.liveViewUrl, session.consoleUrl);
try {
const page = await browser.contexts()[0].newPage();
await page.goto("https://api.deepraxis.com/meta/v1/health");
console.log(await page.textContent("body"));
} finally {
await browser.close();
// Release immediately when finished to stop billing.
const closed = await fetch(
`https://api.deepraxis.com/browser/v1/sessions/${session.sessionId}`,
{ method: "POST", headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ status: "REQUEST_RELEASE" }) },
);
if (!closed.ok) throw new Error(await closed.text());
}

When creating a session, you may also pass context, persist, timeout (seconds), idle (milliseconds), labels and viewport. Encode the last two with JSON.stringify and URLSearchParams. Creation options are ignored when attaching to an existing session. A returned connectUrl carries credentials, so connecting needs no extra API key. Keep this URL private.

Official Browserbase SDK

Use your Praxis API key and set the official SDK’s baseURL to https://api.deepraxis.com/browserbase. The SDK sends X-BB-API-Key automatically. You do not need a Browserbase project; projectId can be omitted.

import Browserbase from "@browserbasehq/sdk";
import { chromium } from "playwright";
const bb = new Browserbase({
apiKey: process.env.PRAXIS_API_KEY,
baseURL: "https://api.deepraxis.com/browserbase",
});
const session = await bb.sessions.create({ timeout: 300, keepAlive: true });
try {
const browser = await chromium.connectOverCDP(session.connectUrl);
try {
const page = await browser.contexts()[0].newPage();
await page.goto("https://api.deepraxis.com/meta/v1/health");
console.log(await page.textContent("body"));
} finally {
await browser.close();
}
} finally {
await bb.sessions.update(session.id, { status: "REQUEST_RELEASE" });
}

See the Browserbase-compatible API for available endpoints. Stealth options, extensions and Selenium are unavailable, and proxies accept only the fixed-egress external type (see Fixed-exit proxy). region and solveCaptchas are currently accepted but ignored: they do not select a region or solve CAPTCHAs.

Create with REST, then connect

POST /browser/v1/sessions returns a connectUrl with credentials valid for the session’s lifetime. Pass it directly to Playwright or Puppeteer without an additional API key.

import { chromium } from "playwright";
const base = "https://api.deepraxis.com/browser/v1";
const headers = {
Authorization: `Bearer ${process.env.PRAXIS_API_KEY}`,
"Content-Type": "application/json",
};
const response = await fetch(`${base}/sessions`, {
method: "POST", headers, body: JSON.stringify({ timeout: 300, keepAlive: true }),
});
if (!response.ok) throw new Error(await response.text());
console.log("X-Request-Id:", response.headers.get("X-Request-Id"));
const session = await response.json();
try {
const browser = await chromium.connectOverCDP(session.connectUrl);
try {
const page = await browser.contexts()[0].newPage();
await page.goto("https://api.deepraxis.com/meta/v1/health");
console.log(await page.textContent("body"));
} finally {
await browser.close();
}
} finally {
const closed = await fetch(`${base}/sessions/${session.id}`, {
method: "POST", headers, body: JSON.stringify({ status: "REQUEST_RELEASE" }),
});
if (!closed.ok) throw new Error(await closed.text());
}

See Cloud Browser API for the full parameter reference. With Puppeteer, connect to the same URL using puppeteer.connect({ browserWSEndpoint: session.connectUrl }).

Page actions and real pointer events

The server-side page actions (POST /browser/v1/sessions/{sessionId}/actions) are semantic: click, fill and select address a ref from the latest snapshot, and scroll sends wheel events. Touch, drag and a click at a point are not actions; to make the page see a real finger or pointer event, send CDP commands over a CDP connection (the connectUrl session creation returns, or /browser/v1/connect):

const page = browser.contexts()[0].pages()[0];
const cdp = await page.context().newCDPSession(page);
await cdp.send("Emulation.setTouchEmulationEnabled", { enabled: true, maxTouchPoints: 1 });
await cdp.send("Input.dispatchTouchEvent", { type: "touchStart", touchPoints: [{ x: 100, y: 200 }] });
await cdp.send("Input.dispatchTouchEvent", { type: "touchMove", touchPoints: [{ x: 110, y: 260 }] });
await cdp.send("Input.dispatchTouchEvent", { type: "touchEnd", touchPoints: [] });

After Emulation.setTouchEmulationEnabled the page receives touch events, but navigator.maxTouchPoints can still be 0: judge by the events themselves, not by that property.

Watch and take over

Open Browser › Sessions in Console, then choose a session to watch or take over: after 接管 (take over) you click, drag (slider checks included) and type in the picture itself, with a finger on a phone too; 观看 (watch) hands control back. A program gets the session page’s address from the CDP command Praxis.getSession or from the session’s debug URLs: liveViewUrl, consoleUrl and debuggerUrl all point to that Console session page. Whoever opens it signs in to Console and must belong to the session’s organization; the session’s creator can take over and other members watch read-only. To have someone else sign in, pass a slider check or pay, first request human takeover, which lets any member of the organization take over while it is open, send them the session page (its org= parameter switches them into the session’s organization). A takeover request lasts 30 minutes by default and at most one hour; the expiresAt it returns is the real end, and you ask again to wait longer. The session itself ends at its own expiresAt: one hour for an API-created session unless you pass timeout, up to 6 hours. Then complete it when finished.

Session statuses are PENDING, RUNNING, ERROR, TIMED_OUT and COMPLETED. API sessions created with keepAlive=false end after clients disconnect and no viewer remains. Sessions opened through one-step connection or Console are released by default after five minutes without a client or viewer. The maximum lifetime is six hours. There is no pause or hibernation; use a Context to retain login state for next time.

Login state

Create a Context, then pass browserSettings.context when creating a session. persist: true saves cookies and localStorage when the session closes; IndexedDB is not saved. A concurrent writer using the same context may receive 409 CONTEXT_LOCKED.

// Reuse the REST setup above; contextId is the id returned by context creation.
const response = await fetch(`${base}/sessions`, {
method: "POST", headers,
body: JSON.stringify({
timeout: 300,
browserSettings: { context: { id: contextId, persist: true } },
}),
});

Drive the user’s own browser (BYOB)

An agent can also drive a user’s own Chrome or Edge: pages load from the user’s own network and sign-ins, and the platform neither stores nor injects login state. Install the extension first, then read pairing, grants, choosing it and error codes.

Pricing and limits

  • Billed by browser time: Billed per millisecond(See the live price), with a one-minute minimum per session. Failures caused by the platform are billed only for actual usage. Billing stops after release.
  • By default, each account can run 10 concurrent sessions, with a maximum of six hours per session.
  • CAPTCHA solving, stealth options, region selection and extensions are unavailable. Unsupported stealth and extension settings return 501; region and solveCaptchas are currently accepted but ignored. For a fixed egress IP through a proxy, see Fixed-exit proxy.
  • Some websites, including Google and Baidu, may identify cloud browsers as bots.
  • Keep the X-Request-Id response header when troubleshooting a request.

Next steps