π Step 9: AI/LLM#368 / 498
x402
x402
πOne-line summary
A protocol that uses the HTTP 402 status code to let agents make instant stablecoin micropayments for APIs and content.
β¨Example
π€
x402
x402
β‘Vibe coding prompt examples
>_
Write an example Express middleware that adds x402 to our paid API to collect a micropayment per request.
>_
Design a setup for selling content to AI agents per item via x402, including pricing and how to respond when payment fails.
>_
Implement in TypeScript the client flow where an agent receives an HTTP 402 response, pays, and retries the request.
Try these prompts in your AI coding assistant!