{"openapi":"3.1.0","info":{"title":"Club Ranked Choice Tally","version":"1.0.0","description":"Replay single-winner ranked ballots round by round and report exhausted ballots or an elimination tie.","contact":{"email":"jeremy@jeremycarter.ca"}},"servers":[{"url":"https://gptenv-x402-catalog.defcronyke.workers.dev"}],"paths":{"/club-ranked-choice-tally/v1/check":{"post":{"operationId":"club_ranked_choice_tally","summary":"Replay single-winner ranked ballots round by round and report exhausted ballots or an elimination tie.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.04"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"candidates":{"minItems":2,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"ballots":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ranks":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"count":{"type":"integer","minimum":1,"maximum":100000}},"required":["ranks","count"],"additionalProperties":false}}},"required":["candidates","ballots"],"additionalProperties":false},"example":{"candidates":["A","B","C"],"ballots":[{"ranks":["A"],"count":4},{"ranks":["B"],"count":3},{"ranks":["C","B"],"count":2}]}}}},"responses":{"200":{"description":"Service result","content":{"application/json":{"schema":{"type":"object"},"example":{"status":"winner","winner":"B","rounds":[{"counts":[{"candidate":"A","votes":4},{"candidate":"B","votes":3},{"candidate":"C","votes":2}],"exhausted":0,"eliminated":"C"},{"counts":[{"candidate":"A","votes":4},{"candidate":"B","votes":5}],"exhausted":0,"eliminated":null}]}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 exact payment required on Base"},"503":{"description":"Payment unavailable"}}}}}}