Create a session with X402 payment

Changed on

Purchase one browser session at 0.10 USDC per hour, paid upfront for timeoutMinutes (5–60, default 30). No Hyperbrowser account or API key is required. A valid unpaid request returns 402 with payment requirements. Retry with a signed PAYMENT-SIGNATURE authorization. Payment is settled before connection credentials and a managementToken are returned. One authorization can create only one session. Invalid options are rejected before payment verification. See /integrations/x402/sessions for connection examples and lifetime behavior.

post/x402/session

Request

Headers

PAYMENT-SIGNATUREstring

Base64-encoded payment authorization generated by an X402 client from the advertised PAYMENT-REQUIRED requirements. Omit on the initial request to obtain a quote.

Request body

viewOnlyLiveViewboolean

Make the live-view link read-only. CDP, WebDriver, and the computer action endpoint still allow browser control.

timeoutMinutesinteger

Maximum session lifetime in minutes, from 5 through 60. Defaults to 30. Determines the session duration and upfront price at 0.10 USDC per hour. Connection token lifetimes and expiresAt follow this value.

Response

Browser created and payment settled. Use the returned connection details to control it without further X402 payments.

idstring uuid required

Purchased session ID.

wsEndpointstring uri required

CDP WebSocket URL for Playwright, Puppeteer, or another CDP client. Includes its authentication token.

webdriverEndpointstring uri required

Selenium/WebDriver endpoint. Send token in the x-hyperbrowser-token header.

liveUrlstring uri required

Authenticated live-view URL. Interaction is disabled when viewOnlyLiveView is true.

computerActionEndpointstring uri required

Endpoint for mouse, keyboard, and screenshot actions. Includes its authentication token.

tokenstring required

Credential scoped to this browser session. Use it for WebDriver authentication, not the regular get/list/stop/update/extend session APIs.

expiresAtstring date-time required

Returned session expiry timestamp based on timeoutMinutes. The browser can stop earlier if closed or disconnected.

managementTokenstring required

Bearer token for GET /x402/session/{id} and PUT /x402/session/{id}/stop only. Valid for 24 hours from purchase, including after browser expiry. Does not authenticate browser connections or regular account APIs.

Changes

    • breaking

      the request property's min was increased to 5.00

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      the request property's max was increased from 30.00 to 60.00

    • info

      added the required property to the response with the status

    • info

      endpoint added