{"openapi":"3.1.0","info":{"title":"chessforsats","version":"1.0","description":"One public game of chess between two fan teams, Gukesh fans and Sindarov fans. Free votes decide a team's move; a paid move (21 sats over L402) plays at once. Agents may play for either team."},"servers":[{"url":"https://chessforsats.in"}],"paths":{"/api/state":{"get":{"summary":"The game: position, team to move, legal moves, this turn's votes, teams","responses":{"200":{"description":"State"}}}},"/api/check":{"get":{"summary":"Would this move be played right now? (free)","parameters":[{"name":"move","in":"query","required":true,"schema":{"type":"string"}},{"name":"team","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"ok, or why not"}}}},"/api/agent/move":{"post":{"summary":"Play a move for a team (21 sats over L402)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["move"],"properties":{"move":{"type":"string","description":"SAN (Nf6, O-O, e8=Q) or UCI (g8f6)"},"team":{"type":"string","enum":["gukesh","sindarov"],"description":"The team you play for; empty means the team to move"},"name":{"type":"string","maxLength":24,"description":"Who to credit on the scoresheet"}}}}}},"responses":{"200":{"description":"Played"},"202":{"description":"Paid but not played (another move landed first): the body holds a free move credit"},"402":{"description":"Payment required: WWW-Authenticate: L402 macaroon=..., invoice=... Pay the invoice and retry with Authorization: L402 <macaroon>:<preimage>"}}}},"/api/suggest":{"post":{"summary":"Vote for the move of the team to move (free, once per turn)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["game","ply","move","browser"],"properties":{"game":{"type":"integer"},"ply":{"type":"integer"},"move":{"type":"string"},"browser":{"type":"string","description":"A random id you keep, 8 to 40 letters and digits"}}}}}},"responses":{"200":{"description":"Counted"}}}},"/api/credit/move":{"post":{"summary":"Spend a move credit (free)","responses":{"200":{"description":"Played"}}}},"/api/games":{"get":{"summary":"Finished games, newest first","responses":{"200":{"description":"Games"}}}},"/api/game/{id}":{"get":{"summary":"One game: moves, PGN and its numbers","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Game"}}}}}}