
I built an API that roasts your code for $0.02
I wanted to show that API monetization for AI agents actually works. Not in theory — with a live endpoint that takes money and returns results. So I built Roast my Code : an API that accepts a code snippet, charges $0.02 in USDC, and returns a brutal but technically accurate code review powered by an LLM. It's live right now: roast.monapi.dev How it works Send code to the API without paying: curl -X POST https://roast.monapi.dev/api/roast \ -H "Content-Type: application/json" \ -d '{"code": "function add(a,b) { return a - b; }", "language": "javascript"}' You get back: HTTP 402 Payment Required The response body contains everything an x402-compatible agent needs: price ($0.02), token (USDC), network, wallet address. The agent pays, retries, and gets the roast. What a roast looks like I fed it this classic: function isEven ( n ) { if ( n === 0 ) return true ; if ( n === 1 ) return false ; return isEven ( n - 2 ); } The response: "Recursion: because why use modulo when you can make the c
Continue reading on Dev.to Webdev
Opens in a new tab




