POST https://api.hyperbrowser.ai/x402/web/fetch. No Hyperbrowser account or API key is required. The price is calculated from your request options and returned in the payment requirements.
Fetch a page with TypeScript
The X402 SDKs handle the payment challenge, wallet signature, and retry automatically. This example supports both EVM and Solana wallets.1. Install dependencies
2. Configure your wallet
Set either or both keys in a.env file. Use a 0x-prefixed EVM private key or a base58-encoded Solana 64-byte secret key, and fund the wallet with USDC on the network you intend to use.
3. Fetch a page
Save this asfetch.ts. If your keys are in .env.agent, replace dotenv.config() with dotenv.config({ path: ".env.agent" }).
Payment flow with cURL
Payment flow with cURL
Request payment requirements
Send a fetch request to receive a402 Payment Required response:PAYMENT-REQUIRED header contains base64-encoded JSON with the accepted networks, assets, amount, and recipient.Sign and retry
Use your X402 client and wallet to generate a signed payment authorization from those requirements. SetPAYMENT_SIGNATURE to the encoded authorization returned by your client, then retry with the same request body:data. The PAYMENT-RESPONSE header contains settlement information. See the X402 overview for the shared payment flow.