Skip to main content
MemoClaw uses the x402 payment protocol. There are no API keys or user accounts. Paying for a request IS the authentication — like a vending machine.

How it works

1

Client sends request

Client sends a request to a protected route with no payment header.
2

Server returns 402

Server responds with HTTP 402 Payment Required, including payment requirements — USDC amount and receiving address.
3

Client pays and retries

Client pays USDC on Base and retries the request with an X-PAYMENT header containing the signed payment proof.
4

Server verifies payment

Server verifies the payment and extracts the payer wallet address from the EIP-3009 or Permit2 payload.
5

Identity established

Server auto-creates a user if needed. Your wallet address scopes all your memories — wallet A cannot see wallet B’s data.
Your wallet address is extracted from the payment proof. It becomes your user identity and scopes all your memories. No registration needed.

Payment methods

Two EVM payment signature types are supported:
  • EIP-3009transferWithAuthorization
  • Permit2 — Uniswap’s permit-based transfer
Both are automatically handled by x402-compatible clients. You don’t need to choose between them.

Making authenticated requests

Three options for making authenticated requests:
  1. @x402/fetch — JavaScript SDK
    import { x402Fetch } from "@x402/fetch";
    
  2. @x402/cli — CLI tool
    npx @x402/cli pay POST https://api.memoclaw.dev/v1/store --data '...'
    
  3. Direct signing — Construct payment headers manually. See x402.org/docs for the full specification.
You need a wallet with USDC on Base network (chain ID 8453). Get USDC from any exchange that supports Base.