DexterDexter

DexterWhat is x402?

The HTTP payment protocol that enables machine-to-machine commerce.

What is x402?

x402 is an HTTP payment protocol that enables any client to pay any server for access to resources - no API keys, no subscriptions, no signup required.

The name comes from HTTP 402 Payment Required - a status code that was reserved in HTTP/1.1 but never standardized. x402 finally gives it meaning.

How It Works

1. Client Requests a Resource

GET /api/some-paid-endpoint HTTP/1.1
Host: x402.dexter.cash

2. Server Responds with Payment Requirements

HTTP/1.1 402 Payment Required
Content-Type: application/json
 
{
  "x402Version": 2,
  "accepts": [{
    "scheme": "exact",
    "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
    "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "amount": "10000",
    "payTo": "SELLER_WALLET_ADDRESS",
    "maxTimeoutSeconds": 60,
    "extra": {
      "feePayer": "FACILITATOR_FEE_PAYER_ADDRESS"
    }
  }]
}

3. Client Creates and Signs Payment

The client builds a transaction that transfers USDC to the seller, then signs it.

4. Client Sends Payment Header

GET /api/some-paid-endpoint HTTP/1.1
Host: x402.dexter.cash
X-PAYMENT: <base64-encoded-payment-payload>

5. Server Verifies, Settles, and Responds

The server calls the facilitator to verify and settle the payment, then returns the data.

Why x402?

vs. API Keys

FeatureAPI Keysx402
Signup requiredYesNo
Email verificationYesNo
Rate limitsComplex tiersPay for what you use
BillingMonthly invoicesInstant, per-request
AI agent friendlyNoYes

vs. Traditional Payments

FeatureStripe/PayPalx402
Minimum transaction~$0.30 fee floorFractions of a cent
Settlement time2-7 daysSeconds
ChargebacksRiskImpossible
Global accessVaries by countryPermissionless

The Role of the Facilitator

The Facilitator is the middleware that makes x402 practical:

  1. Verifies payments - Checks transaction validity and policy compliance
  2. Sponsors fees - Pays transaction fees so buyers don't need native tokens
  3. Settles on-chain - Signs and broadcasts transactions to the blockchain

The Dexter Facilitator supports Solana and Base, with cross-chain bridging between them. Without a facilitator, every API would need to implement its own blockchain integration.

Learn more about the Facilitator →

Resources

On this page