Skip to main content

Quick start

1

Install dependencies

2

Create a session

Run the following with your wallet’s private key (requires USDC on Base):

API reference

Create session

Creates a new browser session with prepaid time.
Request Body:
When you first make a request, you’ll receive a 402 Payment Required response with payment details:

Get session status

Check the status of an active session.
Response:

Extend session

Add more time to an active session.
Request Body:
Extending a session requires another x402 payment for the additional time.

Terminate session

End a session early. Unused time may be eligible for refund.
Response:

Making x402 payments

Using your session

Once you have a connectUrl, connect with Playwright or Puppeteer:

Expected output

The paid create-session request returns session details including connectUrl. Connecting through Playwright or Puppeteer opens that browser. Keep the connection URL private because it provides access to the session.

Cleanup

Close the browser connection and call POST /browser/session/:id/terminate for the session you created. Check that the response reports finalStatus: "terminated". Review the termination response for usage and any refund information rather than assuming an early exit refunds the payment.

Further reading

x402 Protocol

Learn about the x402 payment protocol

Get USDC on Base

Bridge or swap tokens to get USDC on Base