• English
  • Browser API

    aiod attaches to an existing Chromium; it does not launch the browser. Two environment variables decide where it attaches:

    VariableDefaultMeaning
    BROWSER_REMOTE_DEBUGGING_HOST127.0.0.1Host carrying Chromium's debugging port
    BROWSER_REMOTE_DEBUGGING_PORT9222Chromium's debugging port

    Use a CDP client such as Playwright or Puppeteer, or call the REST API directly. /v1/browser/* and /v2/browser/* use the same request bodies. The exception is desktop input: v1 uses POST /v1/browser/actions, while v2 uses /v2/computer. See Computer Use.

    What it needs

    GET /v2/sandbox reports the browser capability in capabilities.browser:

    GET /v1/capabilities reports it in browser.status:

    StatusWhenWhat still answers
    readyCDP answers on the debugging portEvery route
    degradedA browser executable was found, CDP is unreachableinfo, network/requests
    absentNeither is thereinfo, network/requests

    Below ready, the other tools are unavailable. See Sandbox.

    CDP

    Get the CDP URL

    aiod asks the Chromium at BROWSER_REMOTE_DEBUGGING_HOST:PORT for /json/version, takes its webSocketDebuggerUrl, and rewrites it from the request headers:

    PartTaken from
    HostX-Forwarded-Host, or Host when absent
    Schemewss when X-Forwarded-Proto is https, otherwise ws
    Path prefixX-Forwarded-Prefix, empty when absent
    # BASE_URL=https://sandbox.example.com
    curl "$BASE_URL/v2/browser/info"
    # BASE_URL=https://sandbox.example.com
    curl "$BASE_URL/v1/browser/info"
    {
      "data": {
        "cdp_url": "wss://sandbox.example.com/cdp/devtools/browser/46164812-5f92-4ec5-891a-8c138aeb93a4",
        "cdp_ui_url": null
      }
    }

    When Chromium does not answer, cdp_url still comes back in the same shape as a placeholder; call again once it recovers.

    Playwright and Puppeteer connect to cdp_url directly; see Browser (CDP). Reverse proxies, path prefixes, and key parameters are covered on CDP Access.

    Send a raw CDP command

    RoutePurposeNotes
    POST /cdpSend one raw CDP commandThe result lands in data

    Use it for what REST does not cover. For a sequence of commands, connect over cdp_url instead.

    REST tools

    For actions that don't need a full CDP client, aiod serves a small REST set. Every route returns the standard {success, message, data} envelope; full schemas are in the API Reference.

    The routes sit under /v2/browser:

    The routes sit under /v1/browser:

    navigate, evaluate, snapshot, click, fill, upload, and cdp accept tab_id and use the first tab without it. screenshot does not accept tab_id and always captures the first tab.

    RoutePurposeNotes
    POST /navigateLoad a URL, or move through historyTakes url or history; url wins if both arrive
    POST /evaluateRun JavaScript in the page's main worldReturns the value; await_promise waits for a Promise
    {
      "url": "https://example.com",
      "wait_until": "load"
    }
    • wait_until is load, domcontentloaded, networkidle, or commit; the default is load.
    • timeout defaults to 30 seconds; a timeout answers 503, and the tab remains usable.
    • history accepts back, forward, or reload.
    • evaluate puts the result in data.value and JavaScript exceptions in data.exception; the HTTP status stays 200.

    Take a screenshot

    RoutePurposeNotes
    GET /screenshotCapture the current pageThe response body is the image

    format is png (default), jpeg, or jpg; quality is 0–100 for jpeg and defaults to 85. full_page=true captures the whole scrollable page. PNG responses carry x-image-width and x-image-height.

    Page snapshots

    RoutePurposeNotes
    POST /snapshotReturn the page structureinteractive_only keeps actionable elements
    POST /clickClick an elementBy ref or CSS selector
    POST /fillFill an inputBy ref or CSS selector
    POST /uploadUpload a fileBy ref or CSS selector

    A ref comes from snapshot. Take a new snapshot after each navigation; refs from the old document are no longer valid.

    Tabs

    RoutePurposeNotes
    GET /tabsList tabsEach entry has id, title, url, type
    POST /tabsOpen a taburl is optional and defaults to about:blank
    POST /tabs/{tab_id}/activateBring a tab to the frontMoves it to the head of the list; an unknown id is a 404
    DELETE /tabs/{tab_id}Close a tabAn unknown id is a 404

    A new tab goes to the head of the list and becomes the default target.

    Cookies

    RoutePurposeNotes
    POST /cookiesSet cookiesBody is cookies, a list; the reply counts them
    GET /cookiesRead them backNarrows by url or domain
    DELETE /cookiesDelete one, or all of themname plus url or domain, or all=true

    The shape is CDP's own. A cookie needs a name and either a url or a domain with a path; the other fields are optional.

    The request log

    RoutePurposeNotes
    GET /network/requestsRead-only log of page requestslimit caps the result, clear=true empties the buffer after reading

    Collection starts on the first call and keeps the latest 300 requests. Interception and header rewriting are not supported.

    Window size

    RoutePurposeNotes
    POST /configResize the browser window over CDPresolution must be a supported size; other values answer 422

    Omitting resolution leaves the window unchanged.

    Error semantics

    StatusMeaning
    400A required parameter is missing or the body is not JSON
    404An element or tab does not exist
    422A parameter value is unsupported
    503CDP is unreachable, navigation timed out, or CDP execution failed

    JavaScript exceptions are not HTTP errors: evaluate answers 200 with data.exception.

    Desktop actions

    Real mouse and keyboard events run on the computer-use worker rather than on the page, and answer 503 when it is not running.

    Call POST /v2/computer/actions; see Computer Use.

    Call POST /v1/browser/actions; see Computer Use.

    MCP tools

    An MCP-capable agent calls browser tools through /mcp. The daemon itself carries browser_get_info, plus browser_gui_screenshot and browser_gui_execute_action when computer-use is available.

    The AIO image runs @agent-infra/mcp-server-browser on loopback and registers it as an upstream of /mcp, which is where the image's page-level browser_* navigation tools come from. See MCP for how registration works.

    CDP, REST tools, or MCP

    All three operate on the same Chromium:

    Way inGivesCosts
    CDP clientFull page automationA CDP client and WebSocket
    REST APICommon browser operationsOne operation per request
    MCPBrowser operations as toolsAn MCP client

    Use CDP for full page automation, REST for common operations, and MCP when the agent already speaks MCP.

    Human in the loop

    A person can watch or take over the Chromium the agent is driving. Both viewers attach to the same browser environment:

    ViewerPathShows
    noVNC/vnc/index.html?autoconnect=trueThe whole desktop: Chromium, dialogs, other windows
    DevTools/browser-ui, /cdp/devtools/*The current Chromium page

    noVNC attaches to the desktop, not to one browser window, so the file dialog, the address bar and other application windows are all reachable, and the desktop survives a Chromium restart. The noVNC page embeds in an iframe.

    Person and agent share one browser state: after a login completed in noVNC, the agent's next snapshot reads the logged-in page.

    The daemon serves the API only; the image's gateway serves the noVNC and DevTools pages. Deployment and access are described on Computer Use.