Overview
The x402 protocol turns HTTP 402 (Payment Required) into a machine-readable payment flow. Every protected MemoClaw endpoint requires a signed payment proof in the request header. The payment amount depends on the endpoint, and the payer’s wallet address automatically becomes their user identity.The flow
Request without payment
Client sends a request to a protected endpoint (e.g.,
POST /v1/store) without any payment header.Server returns 402
Server responds with HTTP 402 and a JSON body containing payment requirements: the exact USDC amount, the receiving wallet address, the network (Base, chain ID 8453), and the payment scheme (
exact).Client signs payment
The client signs a USDC transfer using either EIP-3009 (
transferWithAuthorization) or Permit2, then base64-encodes the signed payload.Retry with payment header
Client retries the original request with the payment proof in the
X-PAYMENT or payment-signature header.Wallet identity extraction
The payer’s EVM address is extracted from the signed payment payload. For EIP-3009 transfers, it comes from
payload.authorization.from. For Permit2, from payload.permit2Authorization.from. This address becomes the user’s identity — all memories are scoped to it.Per-route pricing
| Endpoint | Price (USDC) |
|---|---|
POST /v1/store | $0.001 |
POST /v1/store/batch | $0.01 |
POST /v1/recall | $0.001 |
GET /v1/memories | $0.0005 |
DELETE /v1/memories/:id | $0.0001 |
GET /health | Free |