What is x402Direct?
Internet-Native Micropayments for the Agentic Economy
x402 is an open payments protocol that activates the HTTP 402 "Payment Required" status code to enable instant, blockchain-based payments for web resources and APIs. Our implementation uses the x402Direct schema, which requires no separate payment processor or third-party intermediaries.
Built on permissionless blockchain infrastructure, x402Direct eliminates traditional payment inefficiencies by enabling direct buyer-to-vendor transfers via smart contracts. Payments settle instantly using stablecoins like USDC on Layer-2 networks like Base with minimal transaction fees.
How x402Direct Works
Request & Nonce Generation
A buyer (AI agent or user) wants to make a payment to a vendor. The vendor provides a unique nonce (a one-time-use identifier) to the buyer along with payment details including amount, currency (typically USDC), and the smart contract address.
Direct Payment via Smart Contract
The buyer sends a message to the x402Direct smart contract with the nonce, requesting payment be made to the vendor. The smart contract moves funds directly from buyer to vendor on-chain and emits a transaction event with a unique transaction ID.
Payment Proof Submission
The buyer requests access again, this time providing both the nonce and the transaction ID received from the smart contract. The vendor receives this proof of payment via query parameter or HTTP header.
Verification & Access Granted
The vendor checks the smart contract event to confirm that the transaction ID corresponds to the provided nonce and that payment was successfully received. Upon verification, the vendor grants access to the requested resource or service.
Why x402 Matters for AI Agents
Autonomous Commerce
AI agents can discover payment requirements, execute blockchain transactions, and complete purchases without human intervention. No API keys, accounts, or pre-existing relationships required.
Global & Permissionless
Available worldwide without costly currency conversions or access to traditional financial rails. Any agent, anywhere, can transact instantly using cryptocurrency.
Micropayment Economics
Payments made via x402Direct are very inexpensive. True pay-per-use pricing becomes practical without the burden of traditional payment processing fees.
Direct Settlement
Payments move directly from buyer to vendor via smart contract in seconds on Layer-2 networks like Base. No third-party payment processors, no chargebacks, no delays. Vendors receive funds immediately in their wallet.
Real-World Use Cases
Premium Content & News
Publishers can gate articles behind micropayments. AI agents and readers pay per article rather than committing to full subscriptions, creating flexible monetization for quality journalism.
API Access & Data Feeds
Services charge per API call instead of monthly subscriptions. An AI agent needing real-time stock data or weather information pays only for the specific requests it makes, with instant payment verification.
Cloud Computing Resources
AI agents can autonomously purchase compute time, storage, or GPU cycles on demand. Pay-per-second pricing becomes practical with micropayment infrastructure.
E-Commerce & Tool Discovery
An AI shopping assistant can browse multiple merchants, compare prices, and complete purchases across platforms without requiring pre-configured accounts or payment methods at each vendor.
Research & Academic Papers
Researchers and AI systems can pay per paper access instead of expensive journal subscriptions, democratizing access to scientific knowledge.
Why x402Direct?
The x402Direct schema eliminates intermediaries and provides true peer-to-peer payment capabilities on the blockchain. By using smart contract events and nonce-based verification, the system ensures:
- No third-party dependencies - Payments flow directly from buyer to vendor without payment processors or escrow services
- Cryptographically verifiable payments - Smart contract events provide immutable proof of payment tied to unique nonces
- Minimal trust requirements - The blockchain acts as the source of truth, eliminating the need for trusted intermediaries
- Cost efficiency - No middleman fees beyond minimal gas costs on Layer-2 networks like Base
Industry analysts predict that autonomous agent commerce could exceed$50 billion annually by 2027, with protocols like x402Direct enabling seamless machine-to-machine transactions in USDC on Layer-2 networks.
Payment Processing Fee Comparison
See how x402Direct compares to traditional payment processing solutions:
| Payment Method | Fee Structure | Cost on $10 | Cost on $100 |
|---|---|---|---|
| Credit Card (US) | 2.9% + $0.30 | $0.59 | $3.20 |
| Credit Card (International) | 4.5% + $0.30 | $0.75 | $4.80 |
x402Direct Stablecoin Payments (US & International) | ...* | ... | ... |
Why x402Direct is cheaper: By eliminating payment processors and using direct smart contract transfers on Layer-2 networks like Base, x402Direct provides significantly lower fees than traditional payment methods. The same low rate applies to both US and international transactions.
* Current x402 rates: Loading... per transaction
Technical Specifications
HTTP Status Code
402 Payment Required
Currency Standard
USDC (USD Coin) Stablecoin
Primary Network
Base (Layer-2, ~2 second blocks)
Typical Confirmation Time
~6 seconds (3 blocks on Base)
Transaction Fees
~$0.01 gas fee (flat, regardless of amount)
Response Format
JSON (agents) or HTML (browsers)
x402Direct on AgentPMT
AgentPMT has implemented the x402Direct schema to enable direct, peer-to-peer payments for premium content and services. Our implementation includes:
- Smart contract integration for direct buyer-to-vendor USDC transfers on the Base network
- Nonce-based payment verification that ties each payment request to a unique identifier
- Blockchain event monitoring to verify transaction IDs against nonces in real-time
- No intermediary fees - Payments flow directly from buyer wallets to vendor wallets
- Hybrid response system serving JSON to AI agents and styled HTML to browsers
- Support for multiple proof methods via query parameters or HTTP headers
This infrastructure enables AI agents to discover our premium content, receive payment nonces from vendors, execute smart contract transactions, and gain access autonomously without any third-party involvement.