X402 Payments
X402 is an open payment protocol for machine-to-machine stablecoin payments. When your agent accesses a Prism-enabled API or service, x402 handles the payment flow automatically — the agent gets a payment request, the wallet pays, and the agent gets the resource. No human intervention. This page covers the Agent Wallet side — how your agent pays via x402. For the merchant/seller side (accepting payments), see Prism: X402 Protocol.How It Works
X402 builds on the HTTP402 Payment Required status code. The flow is straightforward:
Step by step:
- Your agent makes a standard HTTP request to a Prism-protected endpoint
- The endpoint returns HTTP
402 Payment Requiredwith payment details — amount, token, recipient address, and chain - The agent’s wallet capability processes the payment — signing the stablecoin transfer inside the TEE
- The transaction settles on-chain
- Prism verifies the payment on behalf of the merchant
- The agent receives the requested resource or confirmation
Using x402 with Your Agent
When your agent is connected via MCP and encounters a 402 payment requirement, the wallet handles it through the commerce payment capability. Example prompt:“Access the premium data API at https://api.example.com/market-data”What happens behind the scenes:
- The agent calls the API
- Gets a 402 response with payment requirements (e.g., 0.50 USDC on Base)
- The agent uses the wallet’s payment capability to settle the required amount
- The agent retries the request with payment proof
- The agent receives the market data
“Pay 2 USDC to the merchant at 0xABC…123 on Base”The agent can also make explicit payments to known merchant addresses without encountering a 402 flow first.
What Makes x402 Different
X402 is designed for machines paying machines, not humans clicking “Pay Now”:| Feature | Traditional Payment | x402 |
|---|---|---|
| Interaction model | Human clicks buttons | Agent handles automatically |
| Settlement | Days (credit card) | Seconds (on-chain) |
| Currency | Fiat | Stablecoins |
| Intermediaries | Payment processor, bank, card network | Direct on-chain |
| API-native | Requires separate payment integration | Built into HTTP itself |
- No browser needed — the payment happens in the HTTP flow, not in a checkout UI
- No credentials to manage — the wallet signs the transaction; no credit card numbers or API payment keys
- Instant settlement — the merchant can verify payment in seconds, not days
- Micropayment friendly — stablecoin transactions can be very small (fractions of a dollar)
Supported Stablecoins
X402 payments through Agent Wallet support stablecoins on any chain where Prism merchants accept payments. Common options:- USDC — widely supported across EVM chains
- FDUSD — supported on select chains
The Agent Wallet + Prism Connection
X402 is where the two Finance District products meet:- Agent Wallet is the buyer side — your agent has funds and wants to pay for services
- Prism is the seller side — merchants accept stablecoin payments from AI agents