> ## Documentation Index
> Fetch the complete documentation index at: https://hyperbrowser.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# X402

> Enable autonomous agent payments with X402 protocol

Hyperbrowser supports the X402 payment protocol, enabling AI agents to programmatically pay for web powered APIs at request time using cryptocurrency. Payment is handled inline via HTTP 402 responses, allowing truly autonomous agentic workflows.

## What is X402?

X402 is an open payment standard built around the HTTP `402 Payment Required` status code. It enables services to charge for access to their APIs and content directly over HTTP, allowing clients to programmatically pay for resources without accounts, sessions, or credential management. When an agent makes a request to an X402 endpoint, if payment is required, the server responds with `402 Payment Required` along with payment instructions. The agent can then sign a payment authorization and retry the request with that authorization. Hyperbrowser verifies it, runs the operation, and settles payment before returning the successful response.

To learn more about X402 and get started, check out the [X402 Documentation](https://x402.gitbook.io/x402).

***

## Supported Endpoints

Hyperbrowser provides X402-enabled versions of these API endpoints:

All endpoints use `POST` on `https://api.hyperbrowser.ai`.

| Endpoint | What you receive | Price |
| - | - | - |
| [`/x402/session`](/docs/integrations/x402/sessions) | Connection credentials for one browser session, with a lifetime of 5–60 minutes | \$0.10/hour, paid upfront for `timeoutMinutes` |
| [`/x402/web/fetch`](/docs/integrations/x402/fetch) | The result of a page fetch | Calculated from the request options |
| [`/x402/web/search`](/docs/integrations/x402/search) | Web search results | Calculated from the request options |

The [browser session guide](/docs/integrations/x402/sessions) also covers getting session status and stopping a purchased browser without another payment.

***

## How It Works

1. **Agent makes request**: Your AI agent sends a request to an X402 endpoint (e.g., `https://api.hyperbrowser.ai/x402/web/fetch`)

2. **Payment required response**: If payment is needed, Hyperbrowser responds with `402 Payment Required` and payment instructions in the `PAYMENT-REQUIRED` header. Its base64-encoded JSON describes the accepted networks, assets, amount, and recipient.

3. **Agent authorizes payment**: The agent uses its X402 client and wallet to generate a signed payment authorization from those requirements

4. **Request retry**: The agent retries the original request with the authorization in the `PAYMENT-SIGNATURE` header

5. **Service delivered**: Hyperbrowser verifies the authorization, processes the request, and settles payment before returning the results. The `PAYMENT-RESPONSE` header contains settlement information.

Use the requirements returned by the endpoint rather than hardcoding a network, token address, or recipient. HTTP error responses from the resource handler are not settled.

***

## Benefits for Agentic Workflows

* **Autonomous operation**: Agents can pay for services without human intervention
* **No accounts or credentials**: Access paid services without account creation or API key management
* **Cost transparency**: Agents know the exact cost before committing
* **Programmable budgets**: Agents can be configured with spending limits

***

## Getting Started

To integrate X402 into your agentic workflows:

1. Review the [X402 protocol documentation](https://x402.gitbook.io/x402)
2. Implement X402 client functionality in your agent
3. Use Hyperbrowser's X402 endpoints instead of standard API endpoints
4. Configure your agent with a crypto wallet and spending parameters


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.