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

# x402 Introduction

> Learn about the x402 protocol

<img src="https://mintcdn.com/payai/mg1pvJPl2NNq9wNO/images/x402/x402-1.webp?fit=max&auto=format&n=mg1pvJPl2NNq9wNO&q=85&s=3adb59297326a36c2422e271a45c4ade" alt="x402" width="1829" height="1418" data-path="images/x402/x402-1.webp" />

## What is x402?

x402 is an open payment protocol that brings stablecoin payments to plain HTTP.

It revives the `HTTP 402 Payment Required` status so that servers can charge for APIs and digital content seamlessly.

Clients (human users or AI agents) can pay programmatically to access resources
without creating a separate account with every service. Merchant facilitator
credentials are a separate layer: ordinary exact payments and the public shared
[Solana batch settlement](/x402/servers/batch-settlement) lane can start without
an API key, while paid facilitator usage and assigned lanes require one.
Autonomous merchants can [buy credits and receive a key over x402](/x402/facilitators/agent-api-keys)
without portal signup; vending creates a wallet-owned agent account. The
[merchant dashboard](https://merchant.payai.network) is the optional human-managed route.

<Note>Learn more about the x402 project at [x402.org](https://x402.org).</Note>

## Why x402?

Legacy payment rails weren’t built for the web’s speed or for machine-to-machine use.

They are slow, costly, and require sign-ups and keys.

x402 embeds payment into the web’s native request–response flow, enabling instant, global, usage-based payments with minimal integration—ideal for humans and autonomous agents alike.

## Benefits

* Simple HTTP integration using status code 402
* Pay-per-request and other usage-based pricing
* Micropayments with stablecoins (e.g., USDC on Solana)
* Agent-native: AI agents can discover and pay automatically
* Payment-based access without a separate customer subscription; applications
  may still require identity or other access controls

## How it works (high level)

1. A buyer (client) requests a resource from a seller (server).
2. If payment is required, the seller responds with 402 and payment instructions.
3. The buyer constructs and sends a payment payload.
4. The seller verifies and settles the payment (often via a facilitator) and then returns the resource.

<img src="https://mintcdn.com/payai/2DGsVUJGFkMxMKTt/images/x402-sequence-diagram.svg?fit=max&auto=format&n=2DGsVUJGFkMxMKTt&q=85&s=750a29402143e49980393d116826ef2d" alt="x402 sequence diagram" width="1992" height="1570" data-path="images/x402-sequence-diagram.svg" />

## Getting started

<Card title="Quickstart" icon="rocket" horizontal href="/x402/quickstart">
  Quickly get started buying/selling your first service!
</Card>

## Need help?

<Card title="Join our Community" icon="discord" href="https://discord.gg/eWJRwMpebQ">
  Have questions or want to connect with other developers? Join our Discord server.
</Card>


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