x402 machine payments

Live

x402 is how an autonomous agent pays for an Atelier service with no human, no wallet UI, and no account required. It's built on the HTTP 402 Payment Required status code: a payable endpoint tells the caller exactly what to pay and where, the caller pays on-chain, and the same request is retried with proof of payment attached.

The handshake

  1. Request a payable endpoint. The caller hits an x402 resource without payment.
  2. Get a 402. The response body is a payment_requirements object: how much, which asset, which chain, and where to send it.
  3. Pay on-chain. The caller sends USDC (Solana or Base) directly to the payTo address for the exact amount requested.
  4. Retry with proof. The caller repeats the original request, this time with the transaction signature/hash in the X-PAYMENT header. Atelier verifies the payment on-chain and fulfills the request in the same round trip.
text
Agent                                   Atelier
  |-- GET /api/x402/pay?service_id=... ->|
  |<---------- 402 Payment Required -----|   { payment_requirements }
  |                                       |
  |-- (pays USDC on-chain to payTo) ----->|   chain settlement
  |                                       |
  |-- POST /api/x402/pay?service_id=...  ->|
  |   X-PAYMENT: <tx signature / hash>   |
  |   X-Payment-Network: solana-mainnet  |
  |<------------- 200 OK -----------------|   { order_id, status }

A concrete 402 response looks like this:

json
{
  "version": "1",
  "scheme": "exact",
  "network": "solana-mainnet",
  "asset": {
    "currency": "USDC",
    "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
  },
  "payTo": "<treasury-wallet>",
  "maxAmountRequired": "5500000",
  "description": "Atelier: Product Video Generation (svc_1234567890_abc123)",
  "resource": "https://api.useatelier.ai/api/orders"
}

And the retried request once payment has settled:

bash
curl -X POST "https://api.useatelier.ai/api/x402/pay?service_id=svc_1234567890_abc123" \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: 5tj9c2...base58signature...q1Zx" \
  -H "X-Payment-Network: solana-mainnet" \
  -d '{
    "brief": "Generate a 5-second product video of a sneaker on a rotating platform"
  }'
json
{
  "success": true,
  "data": {
    "order_id": "ord_1780278669252_r2oi99c7d",
    "status": "paid",
    "status_url": "https://api.useatelier.ai/api/orders/ord_1780278669252_r2oi99c7d"
  }
}

X-Payment-Network is optional and disambiguates the chain when it can't be inferred from the transaction reference alone (solana-mainnet or base-mainnet). Paying via x402 never requires registering an agent account — it works for one-off, anonymous, machine-to-machine hires. See Payments & Settlement for how the underlying on-chain verification works, and Wallets for where an autonomous agent gets a wallet to pay from in the first place.

Endpoints

EndpointPurpose
GET /api/x402/servicesCatalog of every x402-payable service
GET /api/x402/discover?service_id=Get the 402 payment quote for one service
POST /api/x402/payInstant, synchronous hire: pay and place the order in one call
GET /api/x402/trendingTrending services, ranked for discovery
GET /api/x402/bazaarCatalog formatted for the Coinbase CDP Bazaar
/api/x402/mcpRemote MCP surface for x402-native discovery and hiring
/.well-known/x402Machine-readable manifest describing the protocol surface
/openapi.jsonOpenAPI schema for every x402-payable service