💳 X402 Payment Protocol

Pay-per-use APIs with crypto.

X402 enables HTTP 402 Payment Required with Solana USDC. Pay directly for each API request — no subscriptions, no API keys, just instant micropayments.

How it works

The facilitator verifies and settles Solana USDC payments for X402-enabled APIs.

Verify Payments

Validate payment transactions on Solana blockchain before processing API requests.

Settle Instantly

Process and settle USDC payments to recipients in seconds on Solana.

Dynamic Recipients

Support custom payTo addresses per request for flexible payment routing.

Simple as 1-2-3

Make a request, pay if needed, get your result. That's it.

// 1. Make request
const response = await fetch('https://agents.infraxa.ai/research', {
  method: 'POST',
  body: JSON.stringify({ query: 'What is DeFi?' })
});

// 2. If 402, create payment
if (response.status === 402) {
  const paymentReq = await response.json();
  const payment = await createPaymentHeader(
    signer, 1, paymentReq.accepts[0],
    { svmConfig: { rpcUrl: RPC_URL } }
  );
  
  // 3. Retry with payment
  const result = await fetch('https://agents.infraxa.ai/research', {
    method: 'POST',
    headers: { 'X-PAYMENT': payment },
    body: JSON.stringify({ query: 'What is DeFi?' })
  });
}

// Done! 🎉

That's literally it. No OAuth, no API keys, no subscriptions.

Just pay $0.50 in USDC and get your result. ⚡

API Endpoints

RESTful API for payment verification and settlement

POST/verify
POST/settle
POST/verify-public
POST/test
GET/health

How to Use the Facilitator

Accept crypto payments for any API by sending payments to any wallet

Pay Any Wallet Address

The facilitator verifies and settles USDC payments to any Solana wallet you specify

1Return 402 with your wallet address

// Your API returns 402 Payment Required
{
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact",
    "network": "solana",
    "maxAmountRequired": "500000",  // $0.50 USDC
    "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "payTo": "YOUR_WALLET_ADDRESS_HERE",  // 👈 Your wallet!
    "resource": "https://your-api.com/endpoint"
  }]
}

2Client creates payment

// Client uses x402 SDK
const payment = await createPaymentHeader(
  signer, 1, paymentReq.accepts[0],
  { svmConfig: { rpcUrl: RPC_URL } }
);

3Verify payment with facilitator

// Your API verifies payment
const verified = await fetch('https://facilitator.infraxa.ai/verify', {
  method: 'POST',
  body: JSON.stringify({
    transactionHash: payment.txHash,
    expectedAmount: "500000",
    expectedRecipient: "YOUR_WALLET_ADDRESS"
  })
});

// Payment goes directly to YOUR wallet! 💰

💡 That's it! The facilitator verifies the payment on-chain and the USDC goes straight to your wallet. No middleman, no fees, instant settlement.

Live Example

Real production agent using X402 payments

Sentinel

Live Now

Infraxa's X402-powered deep-research agent that synthesizes intelligence from the open web

Quick Research$0.50 per task

Fast research with 3-5 sources, perfect for quick questions and overviews

POST https://agents.infraxa.ai/research
Payment: 500000 USDC (atomic units)
Sentinel Deep Research$1.30 per task

Comprehensive research with 10+ sources, detailed analysis, and citations

POST https://agents.infraxa.ai/research
Payment: 1300000 USDC (atomic units)

Ready to integrate X402?

Read the complete integration guide and start accepting crypto payments for your APIs.

View Documentation