Turn Website Network Traffic into an API Spec with OpenCode Browse

OpenCode Browse lets your coding agent capture the API calls a site makes while you're signed in. Here's how to turn that traffic into an OpenAPI spec and test it with Apidog CLI, using one agent prompt.

Ashley Innocent

Ashley Innocent

17 November 2026

Turn Website Network Traffic into an API Spec with OpenCode Browse

Apidog for Enterprise

On-Premises Deploy

SSO & RBAC

SOC 2 Compliant

Explore Apidog Enterprise

To turn website network traffic into an API spec, let a coding agent drive your real browser with OpenCode Browse: it starts a network capture on a tab, you click through the site while signed in, and it stops the capture to get every request with credentials redacted. The agent then writes an OpenAPI file from those exchanges, and Apidog CLI imports it and runs a test against it.

This guide walks through that loop with one agent prompt: what Browse captures, what it hides, and the apidog commands that finish the job.

What is OpenCode Browse?

OpenCode Browse is an MCP server plus a Chromium extension that lets your coding agent use your real browser, with your tabs, logins and extensions. Agents open background tabs, read pages, click, type, take screenshots, record tabs and capture network traffic. When a step needs you (a login, a 2FA prompt, a payment), the agent hands the tab back and waits until you click Continue.

Item What the source says
Licence MIT (the repository’s LICENSE file)
First public code Repository created October 27, 2026
Current release v0.1.0, published November 16, 2026 (a rewrite as one Rust binary)
Browsers Chrome, Edge, Brave, Arc, Helium, Vivaldi, Opera, Chromium
Agents OpenCode, Claude Code, Codex, Cursor, Zed and about 30 more MCP clients
Pricing Not stated on the product page

The product page lists no price or launch date, so treat the MIT licence as the only cost signal you can confirm today. If you’re comparing it with the DevTools route, our guide to Chrome DevTools MCP with Claude covers the alternative.

Why capture traffic from your real browser?

Most undocumented APIs sit behind a login. A headless browser starts with no cookies, so your agent hits a sign-in wall. Browse works inside the profile you already use, so the agent sees the same authenticated requests you do. That helps with three jobs:

The manual version is a HAR export from DevTools; see our guide to reverse engineering APIs. The agent version writes the spec for you.

Pipeline diagram: a signed-in browser tab feeds a Browse network capture with credentials redacted, a coding agent writes openapi.json from it, and Apidog CLI imports the file, creates a test case and runs it

How to turn website network traffic into an API spec: 5 steps

  1. Install Browse and pair the extension with your browser.
  2. Ask your agent to open the site in a Browse tab and start a network capture filtered to XHR and Fetch.
  3. Click through the features you want documented, then tell the agent to stop the capture.
  4. Have the agent group the exchanges into paths and write openapi.json.
  5. Import the spec with Apidog CLI, create a test case and run it.

Step 1: Install Browse and connect your agent

Browse installs with one script on macOS and Linux:

curl -fsSL https://opencode.ai/browse/install | bash

On Windows, run irm https://opencode.ai/browse/install.ps1 | iex in PowerShell. You can also use npm i -g @opencode/browse and then browse install.

browse install puts the binary in place, adds the Browse MCP server to the agents it finds, and pairs the Chrome Web Store extension. To skip the interactive picker:

browse install -a claude codex   # Claude Code and Codex only
browse install -y                # every agent found on this computer

Restart your agent afterwards. browse status reports whether the relay, extension and pairing are healthy.

One detail changes how your agent works. OpenCode gets plain tools (navigate, snapshot, click, network and the rest). Claude Code, Codex, Cursor and other clients get execute, status and tabs, where execute runs JavaScript that can call every Browse tool. Either way, the agent reaches the same network capture.

Step 2: Start a filtered network capture

The network tool takes an action of start, status, stop or cancel, one capture per tab. On start you can narrow what it records:

Option What it does Default
urlFilter Capture only URLs containing this text None
resourceTypes Capture only these types, such as ["XHR", "Fetch"] All types
methods Capture only these HTTP methods All methods
bodies Capture request and response bodies true
maxDurationMs End and discard the capture after this long 1,800,000 (30 minutes)

Filter to XHR and Fetch, and add a urlFilter such as /api/ to skip analytics beacons. The call looks like this:

{
  "action": "start",
  "tab": "<tabId>",
  "resourceTypes": ["XHR", "Fetch"],
  "urlFilter": "/api/"
}

To keep the agent on one site, open the tab with allowedOrigins. Browse’s README is clear that this limits navigation, not the requests a page makes itself, so it’s a guardrail, not a data boundary.

Step 3: Click through the site, then stop the capture

Now use the site in the agent’s tab: open a list, filter it, view a detail page, create and delete a test record. If the site asks you to sign in mid-session, the agent calls handoff, you finish the login, and you click Continue.

When you’re done, the agent sends {"action": "stop"}. That returns every exchange: method, URL, headers, status and bodies. The limits are worth knowing:

Credentials are always replaced with [redacted]: authorization and API-key headers, every cookie value, secret-named query, JSON and form fields, and token-like path segments. The README warns that a secret under an ordinary field name can still slip through, so read the spec before you share it.

One change to plan around: version 0.0.17 (November 14, 2026) removed HAR export, and captures now return redacted traffic directly. If you need a HAR file, export it from DevTools and use our guide on importing a HAR file into Apidog.

Step 4: Let the agent write the OpenAPI spec

Raw traffic isn’t a spec. Calls to /api/orders/1042, /api/orders/877 and /api/orders/15 should become one path, /api/orders/{orderId}, with one response schema. A coding agent is good at exactly this: spotting the pattern and inferring types from real responses.

Diagram showing three captured GET requests to /api/orders/1042, /api/orders/877 and /api/orders/15 with JSON bodies, grouped by pattern into one OpenAPI path GET /api/orders/{orderId} with an integer orderId parameter and an Order response schema, with the Authorization header shown as redacted

Ask the agent to follow a few rules so the output imports cleanly:

Step 5: Import the spec and test it with Apidog CLI

Once openapi.json exists, hand the rest to the same agent. Apidog CLI gives it commands for importing specs, creating test cases and running them, and every command prints structured JSON your agent can read.

Set it up once:

npm install -g apidog-cli@latest
apidog auth login --with-token <YOUR_TOKEN>
apidog skill install

Then give your agent one prompt that covers the whole job:

Open https://app.example.com in a Browse tab limited to app.example.com.
Start a network capture for XHR and Fetch requests whose URL contains /api/.
Hand the tab to me, wait while I use the orders pages, then stop the capture.
Write openapi.json (OpenAPI 3.1, info.title "Example Orders API") with path
parameters for IDs and schemas from the real responses. Create an AI branch in
Apidog project <projectId>, import the spec there, create a test case for
GET /api/orders/{orderId} that asserts status 200 and a numeric id, run it
against environment <envId> and summarize any failures.

The agent runs the commands below. Every flag here comes from apidog <cmd> --help on Apidog CLI 2.2.12:

apidog branch create --project <projectId> --type ai \
  --name "ai/20261117-from-main-orders-capture" --from main
apidog import --project <projectId> --branch "ai/20261117-from-main-orders-capture" \
  --format openapi --file ./openapi.json
apidog endpoint list --project <projectId> --branch "ai/20261117-from-main-orders-capture" \
  --path-contains /api/orders
apidog test-case category --project <projectId> --branch "ai/20261117-from-main-orders-capture"
apidog cli-schema get test-case-create
apidog cli-schema validate test-case-create --file case.json
apidog test-case create --project <projectId> --branch "ai/20261117-from-main-orders-capture" \
  --file case.json
apidog run --test-case <caseId> --project <projectId> --branch "ai/20261117-from-main-orders-capture" \
  -e <envId> -r cli,json

Importing into an AI branch keeps a captured spec away from your main design until you’ve reviewed it. If you re-capture later and import again, keep info.title unchanged or pass --module-map "<info.title>=<moduleId>", so Apidog updates endpoints in place instead of creating a second copy of each one.

Once the test passes, the same apidog run ... -r junit command goes straight into CI. Our Apidog CLI CI/CD guide shows the pipeline setup, and Apidog CLI in Claude Code covers the agent side in more depth.

Tips for a cleaner captured spec

FAQ

Is OpenCode Browse free? The repository is MIT licensed, and the product page lists no price. That’s all the source confirms as of November 17, 2026, so check the page again before you plan around cost.

Does OpenCode Browse work with Claude Code, or only OpenCode? It works with Claude Code, Codex, Cursor, Zed and about 30 other MCP clients. browse install -a claude sets up Claude Code. OpenCode gets plain tools, and other clients get an execute tool that calls the same tools from JavaScript.

Can Browse export a HAR file? Not anymore. Version 0.0.17 removed HAR export, and network now returns redacted traffic directly as structured data. For a HAR file, save one from Chrome DevTools and import it with apidog import --format har.

Will my session cookies or tokens end up in the spec? Browse redacts authorization and API-key headers, all cookie values, secret-named fields and token-like path segments. A secret stored under an ordinary field name can still appear, so review the file before you share it.

Which Apidog import format should I use for the agent’s output? Use --format openapi for the spec the agent writes. Apidog CLI also accepts Postman, HAR, Insomnia, Swagger 2.0 and more than 20 other formats through the same apidog import command.

Explore more

OpenCode Browse vs Playwright MCP vs Chrome DevTools MCP: Which Browser MCP Should You Use?

OpenCode Browse vs Playwright MCP vs Chrome DevTools MCP: Which Browser MCP Should You Use?

OpenCode Browse drives your signed-in browser, Playwright MCP runs its own for repeatable automation, and Chrome DevTools MCP is built for debugging. A side-by-side table, setup, login handling, safety and when to pick each.

17 November 2026

How to Normalize Data From 84 APIs Into One Schema (And Contract-Test It)

How to Normalize Data From 84 APIs Into One Schema (And Contract-Test It)

Normalizing reviews from 84 platforms, 59 with an official API and 25 without: one schema, stable IDs, deduplication and contract tests against an OpenAPI spec.

16 November 2026

How to Use Qwen4-Max for Free: 1M API Tokens and 3 Other Routes

How to Use Qwen4-Max for Free: 1M API Tokens and 3 Other Routes

Qwen4-Max has a 1M-token free quota on QwenCloud's Singapore API. Here's how to claim it without surprise charges, how far it goes, the softer free routes (Qoder, QwenWork, QwenStudio) and when the paid API is cheaper.

16 November 2026

Practice API Design-first in Apidog

Discover an easier way to build and use APIs

Turn Website Network Traffic into an API Spec with OpenCode Browse