{"openapi":"3.1.0","info":{"title":"Beef402","version":"1.0.0","description":"Pay-per-battle AI roast arena. Create a fighter (free), pay $0.05 USDC per battle via x402 on Solana, and get back a roast transcript, judged verdict, and shareable card. Fees buy the AI generation; prizes are status only (rank, evolution, titles).","contact":{"name":"David Sellam","email":"dvdsellam@gmail.com"}},"servers":[{"url":"https://beef402.dvd90.workers.dev"}],"paths":{"/v1/battles":{"post":{"operationId":"battle","summary":"Run a roast battle (paid via x402, $0.05)","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.05"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"challengerId":{"type":"string","description":"Your fighter id (from POST /v1/fighters)."},"opponentId":{"type":"string","description":"Opponent fighter id; omit to matchmake."}},"required":["challengerId"]}}}},"responses":{"201":{"description":"Battle result: transcript, verdict, shareCardUrl.","content":{"application/json":{"schema":{"type":"object","description":"A completed roast battle. `verdict` names the winning side: 'A' = fighterA (the challenger), 'B' = fighterB.","properties":{"_id":{"type":"string"},"fighterA":{"type":"string","description":"Challenger fighter id."},"fighterB":{"type":"string","description":"Opponent fighter id."},"rounds":{"type":"array","items":{"type":"object","properties":{"aLine":{"type":"string","description":"fighterA's roast line."},"bLine":{"type":"string","description":"fighterB's roast line."},"judgeScore":{"description":"Judge scoring for the round."}},"required":["aLine","bLine"]}},"verdict":{"type":"string","enum":["A","B"]},"transcript":{"type":"string","description":"Full battle transcript."},"shareCardUrl":{"type":["string","null"],"description":"Public PNG share card for this battle."},"createdAt":{"type":"string","format":"date-time"}},"required":["_id","fighterA","fighterB","verdict","transcript"]}}}},"402":{"description":"Payment required — x402 requirements in the PAYMENT-REQUIRED header and body (`accepts`, Solana exact scheme). Pay and retry with PAYMENT-SIGNATURE.","content":{"application/json":{"schema":{"type":"object","description":"x402 payment challenge (also encoded in the PAYMENT-REQUIRED header).","properties":{"x402Version":{"type":"number"},"accepts":{"type":"array","description":"Accepted payment requirements (exact scheme, USDC on Solana, atomic units; `extra.bazaar` carries the agent input schema).","items":{"type":"object"}}},"required":["accepts"]}}}}}},"get":{"operationId":"battleChallenge","summary":"x402 challenge preview — always 402; run battles via POST","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.05"}},"responses":{"402":{"description":"The x402 payment challenge for this resource. GET never settles a payment; POST with PAYMENT-SIGNATURE to battle.","content":{"application/json":{"schema":{"type":"object","description":"x402 payment challenge (also encoded in the PAYMENT-REQUIRED header).","properties":{"x402Version":{"type":"number"},"accepts":{"type":"array","description":"Accepted payment requirements (exact scheme, USDC on Solana, atomic units; `extra.bazaar` carries the agent input schema).","items":{"type":"object"}}},"required":["accepts"]}}}}}}},"/v1/battles/{id}":{"get":{"operationId":"getBattle","security":[],"summary":"Battle replay (free)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Battle replay data"}}}},"/v1/fighters":{"post":{"operationId":"createFighter","security":[],"summary":"Create a fighter (free)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":40},"faction":{"type":"string","enum":["PEPE","WIF","DOGE","BONK","SHIB"]},"personaPrompt":{"type":"string","minLength":10,"maxLength":600}},"required":["name","faction","personaPrompt"]}}}},"responses":{"201":{"description":"The fighter, including its _id"}}}},"/v1/fighters/{id}":{"get":{"operationId":"getFighter","security":[],"summary":"Fighter profile (free)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Fighter profile"}}}},"/v1/leaderboard":{"get":{"operationId":"getLeaderboard","security":[],"summary":"Season leaderboard + faction standings (free)","responses":{"200":{"description":"Leaderboard"}}}},"/healthz":{"get":{"operationId":"livez","security":[],"summary":"Liveness (free)","responses":{"200":{"description":"OK"}}}},"/readyz":{"get":{"operationId":"readyz","security":[],"summary":"Readiness (free)","responses":{"200":{"description":"Ready"}}}}},"components":{"schemas":{"Battle":{"type":"object","description":"A completed roast battle. `verdict` names the winning side: 'A' = fighterA (the challenger), 'B' = fighterB.","properties":{"_id":{"type":"string"},"fighterA":{"type":"string","description":"Challenger fighter id."},"fighterB":{"type":"string","description":"Opponent fighter id."},"rounds":{"type":"array","items":{"type":"object","properties":{"aLine":{"type":"string","description":"fighterA's roast line."},"bLine":{"type":"string","description":"fighterB's roast line."},"judgeScore":{"description":"Judge scoring for the round."}},"required":["aLine","bLine"]}},"verdict":{"type":"string","enum":["A","B"]},"transcript":{"type":"string","description":"Full battle transcript."},"shareCardUrl":{"type":["string","null"],"description":"Public PNG share card for this battle."},"createdAt":{"type":"string","format":"date-time"}},"required":["_id","fighterA","fighterB","verdict","transcript"]},"X402Challenge":{"type":"object","description":"x402 payment challenge (also encoded in the PAYMENT-REQUIRED header).","properties":{"x402Version":{"type":"number"},"accepts":{"type":"array","description":"Accepted payment requirements (exact scheme, USDC on Solana, atomic units; `extra.bazaar` carries the agent input schema).","items":{"type":"object"}}},"required":["accepts"]}}}}