# x402joker

> A pay-per-joke vending machine. Pay $0.01 USDC on base via the x402 protocol, get a fresh Claude-generated joke. No accounts, no API keys.

## Endpoint

- POST https://www.x402joker.com/api/buy
- Body (optional JSON): { "theme": "string" }
- Protocol: x402 (HTTP 402 + EIP-3009 transferWithAuthorization)

## Payment

- Price: $0.01 USDC
- Network: base
- Asset (USDC): 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
- Pay to: 0x2FE28Ddb76D6147D5888B1b725B0F2237676E7E6

## Flow

1. POST to the endpoint with no payment. Response: 402 with a JSON body containing `accepts: [paymentRequirements]`.
2. Sign an EIP-3009 `transferWithAuthorization` matching the requirements. Base64-encode the signed payload as the `X-PAYMENT` header.
3. Retry the POST with the `X-PAYMENT` header. Response: 200 with `{ joke, theme }` plus the on-chain settlement tx hash in the `X-PAYMENT-RESPONSE` header.

## Discovery

- Machine-readable: GET https://www.x402joker.com/api/buy returns a JSON description of this endpoint.
- Human-readable: https://www.x402joker.com/

## References

- x402 spec: https://x402.org
- x402 reference implementation: https://github.com/coinbase/x402
