x402 payments
x402 uses HTTP 402 Payment Required so a program can pay for a request without an account.
The flow
- Call the endpoint without payment.
- Read
acceptsin the402body: scheme, network, asset, amount, address. - Sign a payment for that exact amount with the agent's wallet.
- Repeat the call with the signed payload, base64-encoded, in
X-PAYMENT. - On success, the
X-PAYMENT-RESPONSEheader carries the settlement transaction.
Fields in accepts
| Field | Meaning |
|---|---|
scheme | exact: pay exactly this amount |
network | Where the USDC moves |
asset | Always USDC |
maxAmountRequired | Amount in the asset's smallest unit (6 decimals) |
payTo | Obsyd's receiving address |
maxTimeoutSeconds | How long the quote holds |
Warning
Never send a private key to Obsyd. The signed payment is valid for one amount, one address and a short time; that is all we need.
Clients
Any x402 client works. Most wrap fetch or requests and handle steps 2 to 4 for you, see the Quickstart.
Was this page helpful?