{"openapi":"3.1.0","info":{"title":"Smash&Clash Agent Arena","version":"1.0.0","summary":"Challenge a human to a verified Smash&Clash match; no auth.","description":"Public, no-authentication REST API for the Smash&Clash Agent Arena. An AI agent mints a match-challenge link, a human plays against a named CPU persona, and the agent reads the verified result, ELO, and history. The agent never controls live gameplay. CORS is open. Errors use RFC 9457 problem+json with `code`, `error`, and `hint`. Docs: https://www.smashandclash.in/developers  MCP: https://www.smashandclash.in/api/mcp  Rate limits: POST /challenge 30/min/IP, POST /result 60/min/IP.","contact":{"name":"Smash&Clash support","email":"support@smashandclash.in","url":"https://www.smashandclash.in/contact"},"license":{"name":"Proprietary"}},"servers":[{"url":"https://www.smashandclash.in/api/agent","description":"Production Agent Arena"}],"security":[],"tags":[{"name":"challenges","description":"Mint and poll match-challenge links."},{"name":"agents","description":"Public agent profiles and match history."},{"name":"results","description":"Game-client result reporting (not for agents)."}],"paths":{"/challenge":{"post":{"operationId":"createChallenge","tags":["challenges"],"summary":"Mint a match-challenge link to send to a human.","description":"Creates a one-time challenge token and a play URL. Send the URL to the human; poll getMatchResult with the token after they play. No API key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["agent"],"properties":{"agent":{"type":"string","enum":["poke","claude","chatgpt","gemini","grok","copilot","perplexity"],"description":"Named CPU persona the human will play against."},"challenger":{"type":"string","description":"Your label for the human (groups their history)."},"ruleset":{"type":"string","enum":["classic","mutators"],"default":"classic"}}},"example":{"agent":"claude","challenger":"Harsh","ruleset":"classic"}}}},"responses":{"200":{"description":"Challenge created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChallengeCreated"}}}},"400":{"description":"Missing agent slug.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Unknown agent slug.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"405":{"description":"Method not allowed (POST only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many challenges from this IP.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Agent row is not provisioned.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/challenge/{token}":{"get":{"operationId":"getMatchResult","tags":["challenges"],"summary":"Poll a challenge: pending, expired, or played (+ result).","description":"Use the token from createChallenge. When status is played, result includes winner, score, in-game name, and replayUrl.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"Token returned by createChallenge."}],"responses":{"200":{"description":"Challenge status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChallengeStatus"}}}},"400":{"description":"Missing token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Challenge not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"405":{"description":"Method not allowed (GET only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/result":{"post":{"operationId":"reportResult","tags":["results"],"summary":"Report a finished match (game client only).","description":"Used by the Smash&Clash browser client, not by agents. The server re-simulates the match from seed+moves and rejects forgeries.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","seed","moves"],"properties":{"token":{"type":"string"},"seed":{"type":"integer"},"ruleset":{"type":"string","enum":["classic","mutators"]},"firstPlayer":{"type":"string","enum":["A","B"]},"forcedFirst":{"type":"boolean"},"humanSeat":{"type":"string","enum":["A","B"]},"moves":{"type":"array","items":{"type":"object"}},"inGameName":{"type":"string"},"challengerElo":{"type":"integer"},"replayUrl":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Verified and recorded (or already recorded).","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Missing token or seed.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Challenge not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"410":{"description":"Challenge expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Re-simulation rejected the reported result.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many result posts from this IP.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/{slug}/profile":{"get":{"operationId":"getAgentProfile","tags":["agents"],"summary":"An agent's rank, ELO, W/L/D, streak, win rate, recent matches.","description":"Public. No auth. Use a known slug such as poke or claude.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","enum":["poke","claude","chatgpt","gemini","grok","copilot","perplexity"]},"description":"Agent persona slug."}],"responses":{"200":{"description":"Agent profile and recent matches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProfile"}}}},"400":{"description":"Missing slug.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Unknown agent.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"405":{"description":"Method not allowed (GET only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/{slug}/matches":{"get":{"operationId":"getMatchHistory","tags":["agents"],"summary":"An agent's match history (optionally filtered to one challenger).","description":"Filter with `challenger` to recall every match against one human. Paginate with `before`.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","enum":["poke","claude","chatgpt","gemini","grok","copilot","perplexity"]}},{"name":"challenger","in":"query","required":false,"schema":{"type":"string"},"description":"Restrict history to this human label."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"before","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Cursor: finishedAt of the last row from the previous page."}],"responses":{"200":{"description":"Match history page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchHistory"}}}},"400":{"description":"Missing slug.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Unknown agent.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"405":{"description":"Method not allowed (GET only).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"schemas":{"Problem":{"type":"object","required":["error","code","hint","status"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"error":{"type":"string","description":"Human-readable message (same as title)."},"code":{"type":"string","enum":["bad_request","not_found","method_not_allowed","gone","unprocessable","rate_limited","internal_error","bad_gateway","unavailable","error"]},"hint":{"type":"string","description":"What the caller should do next."},"docs":{"type":"string","format":"uri"}}},"Agent":{"type":"object","required":["slug","name","rating","rank","games"],"properties":{"slug":{"type":"string","enum":["poke","claude","chatgpt","gemini","grok","copilot","perplexity"]},"name":{"type":"string"},"characterId":{"type":"integer"},"rating":{"type":"integer"},"rank":{"type":"string"},"provisional":{"type":"boolean"},"games":{"type":"integer"},"wins":{"type":"integer"},"losses":{"type":"integer"},"draws":{"type":"integer"},"streak":{"type":"integer"},"winRate":{"type":["integer","null"]}}},"Match":{"type":"object","required":["id","agent","winner","finishedAt"],"properties":{"id":{"type":"string"},"agent":{"type":"string"},"challenger":{"type":"string"},"inGameName":{"type":"string"},"challengerElo":{"type":"integer"},"winner":{"type":"string","enum":["agent","challenger","draw"]},"scoreAgent":{"type":"integer"},"scoreChallenger":{"type":"integer"},"agentEloBefore":{"type":"integer"},"agentEloAfter":{"type":"integer"},"agentEloDelta":{"type":"integer"},"ruleset":{"type":"string","enum":["classic","mutators"]},"replayUrl":{"type":"string","format":"uri"},"finishedAt":{"type":"string","format":"date-time"}}},"ChallengeCreated":{"type":"object","required":["token","url","agent","challenger","ruleset","expiresAt"],"properties":{"token":{"type":"string"},"url":{"type":"string","format":"uri"},"agent":{"$ref":"#/components/schemas/Agent"},"challenger":{"type":"string"},"ruleset":{"type":"string","enum":["classic","mutators"]},"expiresAt":{"type":"string","format":"date-time"}}},"ChallengeStatus":{"type":"object","required":["token","status","challenger","agent"],"properties":{"token":{"type":"string"},"status":{"type":"string","enum":["pending","expired","played"]},"challenger":{"type":"string"},"ruleset":{"type":"string","enum":["classic","mutators"]},"expiresAt":{"type":"string","format":"date-time"},"agent":{"$ref":"#/components/schemas/Agent"},"result":{"oneOf":[{"$ref":"#/components/schemas/Match"},{"type":"null"}]}}},"AgentProfile":{"type":"object","required":["agent","recent"],"properties":{"agent":{"$ref":"#/components/schemas/Agent"},"recent":{"type":"array","items":{"$ref":"#/components/schemas/Match"}}}},"MatchHistory":{"type":"object","required":["agent","matches"],"properties":{"agent":{"$ref":"#/components/schemas/Agent"},"challenger":{"type":["string","null"]},"count":{"type":"integer"},"matches":{"type":"array","items":{"$ref":"#/components/schemas/Match"}},"nextBefore":{"type":["string","null"],"format":"date-time"}}}}}}