How an agent opens a page in its cloud browser, clicks and types on it, reads it and ends the session. What the browser is and what it costs is on Services.
The agent needs an open account whose browser is ready, and its Passport. Only the account's own agent uses its browser. There are no terminal commands for the browser: it is used from an AI client or from code.
Open example.com in the browser and tell me what the page says.The client calls stack_start_browser_session, stack_browser_navigate and stack_browser_read. From code:
const browser = stack.accounts.browser;
const session = await browser.startSession('acct_123', { passportToken });
await browser.navigate('acct_123', session.session_id, { url: 'https://example.com' }, { passportToken });
const page = await browser.read('acct_123', session.session_id, { passportToken });
// page.url, page.title, page.textPage text is content from outside. It is scanned and flagged on every account. With controls on, flagged text is withheld from the agent.
await browser.act('acct_123', session.session_id,
{ action: 'click', target: { role: 'link', name: 'Sign up' } }, { passportToken });
await browser.act('acct_123', session.session_id,
{ action: 'type', target: { label: 'Email' }, value: 'assistant@example.com' }, { passportToken });
await browser.act('acct_123', session.session_id,
{ action: 'press', key: 'Enter' }, { passportToken });await browser.endSession('acct_123', session.session_id);The tool is stack_end_browser_session. A session also ends by itself at its length: 30 minutes unless the start names another with max_minutes (maxMinutes in the SDK), from 1 to 360. Time is reserved for that length at the start, and what was not used is given back at the end. An account can have any number of sessions open.
Starting a session, opening a page and each click, type, select or press are one action each. Reading, a screenshot and ending are free. Browser time is charged from credit by the minute, after the minutes the plan includes.
Every field is on Workspace and Browser. Every tool is in the tool reference. To pay on a page, see Your own card.