All articles
ProductOctober 6, 2026 · 5 min read

Browser sessions with x402: Let agents buy their own browser

Any agent with a USDC wallet can now pay for a Hyperbrowser session over HTTP and start using it right away, with no account or API key.

To give an agent a cloud browser today, a person has to sign up first. They create an account, add a payment method, generate an API key, and hand the key to the agent. That works when the agent is yours. It doesn't work for an agent acting for someone who has no account, a tool that needs a browser for five minutes, or an agent that finds out halfway through a task that it needs one.

Hyperbrowser browser sessions now accept x402 payments. An agent with a USDC wallet asks for a session, pays for it in the same HTTP exchange, and gets back a browser it can connect to straight away. There is no account to create and no API key to manage.

What x402 is

x402 is an open payment standard built on HTTP's long-reserved 402 Payment Required status code. When a client asks for something that costs money, the server answers 402 with the price, the networks and tokens it accepts, and where to send payment. The client signs a payment authorization with its wallet and sends the same request again with the authorization attached. The server verifies it, does the work, settles the payment, and returns the result.

Because the price and the payment travel with the request, there is nothing to sign up for. Client libraries handle the exchange, so in your code it looks like an ordinary fetch. Hyperbrowser's fetch and search endpoints already accept x402. Now browser sessions do too.

What a session costs and what you get

A session costs $0.10 an hour, paid upfront in USDC on Base or Solana. You choose how long it lasts, from 5 to 60 minutes (30 by default), and the price is rounded up to the whole cent: five minutes costs one cent and an hour costs ten. Once it's paid for, everything you do in the browser is included, with no further payments.

The response carries everything needed to use the browser:

  • A CDP endpoint for Playwright, Puppeteer, or any other CDP client, with authentication already in the URL.
  • A WebDriver endpoint and token for Selenium.
  • A computer action endpoint for agents that work from screenshots, the mouse, and the keyboard instead of the page's code.
  • A Live View link to watch the browser or hand it to a person. You can make it view-only.
  • A management token that can check on or stop this one session for the next 24 hours.

x402 sessions are standard browsers for short jobs. Beyond the timeout, you can set the screen size and make the Live View link read-only. Proxies, CAPTCHA solving, profiles, extensions, recording, and the other session options need a regular session created with an API key.

Try it

You need a wallet holding a little USDC on Base; a dime covers an hour. Install the x402 client packages, viem, and playwright-core, then put the wallet's private key in a .env file as EVM_PRIVATE_KEY:

npm install @x402/fetch @x402/core @x402/evm viem playwright-core

Save this as browse.mjs:

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
import { chromium } from "playwright-core";

// The agent's wallet: it signs each payment.
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const fetchWithPayment = wrapFetchWithPayment(fetch, client);

// Buy a five-minute browser. The wrapper reads the 402, pays, and retries.
const response = await fetchWithPayment("https://api.hyperbrowser.ai/x402/session", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ timeoutMinutes: 5 }),
});
if (!response.ok) throw new Error("Purchase failed: HTTP " + response.status);
const session = await response.json();

// It's an ordinary remote browser now.
const browser = await chromium.connectOverCDP(session.wsEndpoint);
const page = browser.contexts()[0].pages()[0];
await page.goto("https://example.com");
console.log(await page.title());

// Disconnecting ends the session.
await browser.close();

Run it with node --env-file=.env browse.mjs. It buys a five-minute browser for one cent, opens example.com, and prints the page title.

Under the hood, the first request comes back 402 with the price. The wrapper signs a one-cent payment and sends the request again, and the second response carries the session. If the purchase fails with a 402, the wallet most likely doesn't hold enough USDC on Base. The guide has a TypeScript version that also accepts a Solana wallet.

Check on a session or stop it

Closing the connection ends the session by default. To come back to it later, add keepAlive=true to the WebSocket URL before you connect. Either way, the management token lets any process check the session's status or stop it, and neither call costs anything:

const auth = { Authorization: "Bearer " + session.managementToken };
const url = "https://api.hyperbrowser.ai/x402/session/" + session.id;

const status = await (await fetch(url, { headers: auth })).json();
console.log(status.status);

await fetch(url + "/stop", { method: "PUT", headers: auth });

The payment covers the time you chose, and stopping early doesn't refund the rest, so pick the shortest timeout that fits the job. Sessions can't be extended; if a task runs long, buy another one.

Keep spending in check

With x402, the wallet is the budget. Give an agent its own wallet with a small balance, and it can't spend more than you put in. Each payment authorization buys at most one session, so replaying a request can't buy a second browser. If Hyperbrowser can't create the session, the payment isn't settled.

Get started

x402 sessions are live now at POST https://api.hyperbrowser.ai/x402/session. The guide covers the full TypeScript example for EVM and Solana wallets, the cURL flow, every response field, and the session options. If you're building agents that pay for their own tools, a browser is now one of them.

Read the x402 sessions guide →

x402AI AgentsProduct Launch