{"openapi":"3.1.0","info":{"title":"Kriegspiel Chess API","description":"Public API for Kriegspiel.org. External clients should use https://api.kriegspiel.org with prefix-free paths. Authenticated bot calls use the bearer token returned by POST /auth/bots/register.","version":"1.3.50"},"paths":{"/auth/register":{"post":{"tags":["auth"],"summary":"Register","operationId":"register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/bots/register":{"post":{"tags":["auth"],"summary":"Register Bot","operationId":"register_bot_auth_bots_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotRegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotRegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/guest":{"post":{"tags":["auth"],"summary":"Login As Guest","operationId":"login_as_guest_auth_guest_post","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuestLoginResponse"}}}}}}},"/auth/guest/convert":{"post":{"tags":["auth"],"summary":"Convert Guest","operationId":"convert_guest_auth_guest_convert_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertGuestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertGuestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Logout Auth Logout Post"}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Me","operationId":"me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Me Auth Me Get"}}}}},"security":[{"BearerAuth":[]}]}},"/auth/session":{"get":{"tags":["auth"],"summary":"Session Status","operationId":"session_status_auth_session_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Session Status Auth Session Get"}}}}},"security":[{"BearerAuth":[]}]}},"/bots":{"get":{"tags":["bots"],"summary":"List Bots","operationId":"list_bots_bots_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotListResponse"}}}}},"security":[{"BearerAuth":[]}]}},"/bots/availability":{"post":{"tags":["bots"],"summary":"Report Bot Availability","operationId":"report_bot_availability_bots_availability_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotAvailabilityReportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotAvailabilityReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/bots/profile":{"post":{"tags":["bots"],"summary":"Sync Bot Profile","operationId":"sync_bot_profile_bots_profile_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotProfileSyncRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotProfileSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/create":{"post":{"tags":["game"],"summary":"Create Game","operationId":"create_game_game_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGameRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGameResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/join/{game_code}":{"post":{"tags":["game"],"summary":"Join Game","operationId":"join_game_game_join__game_code__post","parameters":[{"name":"game_code","in":"path","required":true,"schema":{"type":"string","title":"Game Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinGameResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/{game_id}/move":{"post":{"tags":["game"],"summary":"Move Game","operationId":"move_game_game__game_id__move_post","parameters":[{"name":"game_id","in":"path","required":true,"schema":{"type":"string","title":"Game Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/{game_id}/state":{"get":{"tags":["game"],"summary":"Get Game State","operationId":"get_game_state_game__game_id__state_get","parameters":[{"name":"game_id","in":"path","required":true,"schema":{"type":"string","title":"Game Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GameStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/{game_id}/ask-any":{"post":{"tags":["game"],"summary":"Ask Any Game","operationId":"ask_any_game_game__game_id__ask_any_post","parameters":[{"name":"game_id","in":"path","required":true,"schema":{"type":"string","title":"Game Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskAnyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/{game_id}/events":{"get":{"tags":["game"],"summary":"Game Events","operationId":"game_events_game__game_id__events_get","parameters":[{"name":"game_id","in":"path","required":true,"schema":{"type":"string","title":"Game Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Game Events Game  Game Id  Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/open":{"get":{"tags":["game"],"summary":"Get Open Games","operationId":"get_open_games_game_open_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenGamesResponse"}}}}},"security":[{"BearerAuth":[]}]}},"/game/stats":{"get":{"tags":["game"],"summary":"Get Lobby Stats","operationId":"get_lobby_stats_game_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LobbyStatsResponse"}}}}},"security":[{"BearerAuth":[]}]}},"/game/mine/active":{"get":{"tags":["game"],"summary":"Get My Active Games","operationId":"get_my_active_games_game_mine_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyGamesResponse"}}}}},"security":[{"BearerAuth":[]}]}},"/game/mine/archived":{"get":{"tags":["game"],"summary":"Get My Archived Games","operationId":"get_my_archived_games_game_mine_archived_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyGamesResponse"}}}}},"security":[{"BearerAuth":[]}]}},"/game/mine":{"get":{"tags":["game"],"summary":"Get My Games","operationId":"get_my_games_game_mine_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyGamesResponse"}}}}},"security":[{"BearerAuth":[]}]}},"/game/{game_id}/moves":{"get":{"tags":["game"],"summary":"Get Game Transcript","operationId":"get_game_transcript_game__game_id__moves_get","parameters":[{"name":"game_id","in":"path","required":true,"schema":{"type":"string","title":"Game Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GameTranscriptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/recent":{"get":{"tags":["game"],"summary":"Get Recent Games","operationId":"get_recent_games_game_recent_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecentGamesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/{game_id}":{"get":{"tags":["game"],"summary":"Get Game","operationId":"get_game_game__game_id__get","parameters":[{"name":"game_id","in":"path","required":true,"schema":{"type":"string","title":"Game Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GameMetadataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]},"delete":{"tags":["game"],"summary":"Delete Waiting Game","operationId":"delete_waiting_game_game__game_id__delete","parameters":[{"name":"game_id","in":"path","required":true,"schema":{"type":"string","title":"Game Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Delete Waiting Game Game  Game Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/game/{game_id}/resign":{"post":{"tags":["game"],"summary":"Resign Game","operationId":"resign_game_game__game_id__resign_post","parameters":[{"name":"game_id","in":"path","required":true,"schema":{"type":"string","title":"Game Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Resign Game Game  Game Id  Resign Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/user/{username}":{"get":{"tags":["user"],"summary":"Get Public Profile","operationId":"get_public_profile_user__username__get","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Public Profile User  Username  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/{username}/games":{"get":{"tags":["user"],"summary":"Get User Games","operationId":"get_user_games_user__username__games_get","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":100,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get User Games User  Username  Games Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/{username}/rating-history":{"get":{"tags":["user"],"summary":"Get User Rating History","operationId":"get_user_rating_history_user__username__rating_history_get","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}},{"name":"track","in":"query","required":false,"schema":{"type":"string","pattern":"^(overall|vs_humans|vs_bots)$","default":"overall","title":"Track"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":10,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get User Rating History User  Username  Rating History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/settings":{"patch":{"tags":["user"],"summary":"Patch User Settings","operationId":"patch_user_settings_user_settings_patch","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Patch User Settings User Settings Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/leaderboard":{"get":{"tags":["user"],"summary":"Get Leaderboard","operationId":"get_leaderboard_leaderboard_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Leaderboard Leaderboard Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tech/bots-report":{"get":{"tags":["user"],"summary":"Get Bots Report","operationId":"get_bots_report_tech_bots_report_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":31,"minimum":1,"default":10,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Bots Report Tech Bots Report Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tech/guests-report":{"get":{"tags":["user"],"summary":"Get Guests Report","operationId":"get_guests_report_tech_guests_report_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Guests Report Tech Guests Report Get"}}}}}}},"/tech/users-report":{"get":{"tags":["user"],"summary":"Get Users Report","operationId":"get_users_report_tech_users_report_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Users Report Tech Users Report Get"}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}}},"components":{"schemas":{"AnnouncementEntry":{"properties":{"kind":{"type":"string","enum":["move","ask_any","illegal_move","capture","status"],"title":"Kind"},"actor":{"anyOf":[{"type":"string","enum":["self","opponent"]},{"type":"null"}],"title":"Actor"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"message":{"type":"string","title":"Message"},"messages":{"items":{"type":"string"},"type":"array","title":"Messages"},"move_uci":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Move Uci"},"question_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question Type"}},"additionalProperties":false,"type":"object","required":["kind","message"],"title":"AnnouncementEntry"},"AskAnyResponse":{"properties":{"move_done":{"type":"boolean","title":"Move Done"},"announcement":{"type":"string","title":"Announcement"},"special_announcement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Special Announcement"},"checks":{"items":{"type":"string"},"type":"array","title":"Checks"},"capture_square":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capture Square"},"captured_piece_announcement":{"anyOf":[{"type":"string","enum":["PAWN","PIECE","KNIGHT","BISHOP","ROOK","QUEEN"]},{"type":"null"}],"title":"Captured Piece Announcement"},"dropped_piece_announcement":{"anyOf":[{"type":"string","enum":["PAWN","PIECE","KNIGHT","BISHOP","ROOK","QUEEN"]},{"type":"null"}],"title":"Dropped Piece Announcement"},"en_passant_announced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"En Passant Announced"},"promotion_announced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Promotion Announced"},"next_turn_pawn_tries":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Next Turn Pawn Tries"},"next_turn_has_pawn_capture":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Next Turn Has Pawn Capture"},"next_turn_pawn_try_squares":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Next Turn Pawn Try Squares"},"turn":{"anyOf":[{"type":"string","enum":["white","black"]},{"type":"null"}],"title":"Turn"},"game_over":{"type":"boolean","title":"Game Over"},"clock":{"$ref":"#/components/schemas/ClockState"},"has_any":{"type":"boolean","title":"Has Any"}},"additionalProperties":false,"type":"object","required":["move_done","announcement","game_over","clock","has_any"],"title":"AskAnyResponse"},"BotAvailabilityReportRequest":{"properties":{"provider":{"type":"string","enum":["openai","anthropic"],"title":"Provider"},"ready":{"type":"boolean","title":"Ready"},"reason":{"type":"string","maxLength":500,"title":"Reason","default":""}},"additionalProperties":false,"type":"object","required":["provider","ready"],"title":"BotAvailabilityReportRequest"},"BotAvailabilityReportResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"additionalProperties":false,"type":"object","title":"BotAvailabilityReportResponse"},"BotListItem":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"username":{"type":"string","title":"Username"},"display_name":{"type":"string","title":"Display Name"},"description":{"type":"string","title":"Description","default":""},"elo":{"type":"integer","title":"Elo","default":1200},"ratings":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"Ratings"},"supported_rule_variants":{"items":{"type":"string"},"type":"array","title":"Supported Rule Variants"}},"additionalProperties":false,"type":"object","required":["bot_id","username","display_name"],"title":"BotListItem"},"BotListResponse":{"properties":{"bots":{"items":{"$ref":"#/components/schemas/BotListItem"},"type":"array","title":"Bots"}},"additionalProperties":false,"type":"object","required":["bots"],"title":"BotListResponse"},"BotProfileSyncRequest":{"properties":{"supported_rule_variants":{"items":{"type":"string"},"type":"array","title":"Supported Rule Variants"}},"additionalProperties":false,"type":"object","required":["supported_rule_variants"],"title":"BotProfileSyncRequest"},"BotProfileSyncResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"supported_rule_variants":{"items":{"type":"string"},"type":"array","title":"Supported Rule Variants"}},"additionalProperties":false,"type":"object","required":["supported_rule_variants"],"title":"BotProfileSyncResponse"},"BotRegisterRequest":{"properties":{"username":{"type":"string","maxLength":33,"minLength":1,"pattern":"^[a-zA-Z0-9_]+$","title":"Username"},"display_name":{"type":"string","maxLength":40,"minLength":3,"title":"Display Name"},"owner_email":{"type":"string","maxLength":320,"minLength":3,"title":"Owner Email"},"description":{"type":"string","maxLength":280,"title":"Description","default":""},"listed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Listed"},"supported_rule_variants":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Supported Rule Variants"}},"type":"object","required":["username","display_name","owner_email"],"title":"BotRegisterRequest"},"BotRegisterResponse":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"username":{"type":"string","title":"Username"},"display_name":{"type":"string","title":"Display Name"},"owner_email":{"type":"string","title":"Owner Email"},"api_token":{"type":"string","title":"Api Token"},"message":{"type":"string","title":"Message","default":"Bot registered. Save this token now; it will not be shown again."}},"type":"object","required":["bot_id","username","display_name","owner_email","api_token"],"title":"BotRegisterResponse"},"ClockState":{"properties":{"white_remaining":{"type":"number","minimum":0.0,"title":"White Remaining"},"black_remaining":{"type":"number","minimum":0.0,"title":"Black Remaining"},"active_color":{"anyOf":[{"type":"string","enum":["white","black"]},{"type":"null"}],"title":"Active Color"}},"additionalProperties":false,"type":"object","required":["white_remaining","black_remaining"],"title":"ClockState"},"ConvertGuestRequest":{"properties":{"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email"},"password":{"type":"string","maxLength":512,"minLength":1,"title":"Password"}},"type":"object","required":["email","password"],"title":"ConvertGuestRequest"},"ConvertGuestResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"username":{"type":"string","title":"Username"},"message":{"type":"string","title":"Message","default":"Guest account converted. You can now log in with your email and password."}},"type":"object","required":["user_id","username"],"title":"ConvertGuestResponse"},"CreateGameRequest":{"properties":{"rule_variant":{"type":"string","enum":["berkeley","berkeley_any","cincinnati","wild16","rand","english","crazykrieg"],"title":"Rule Variant","default":"berkeley_any"},"play_as":{"type":"string","enum":["white","black","random"],"title":"Play As","default":"random"},"time_control":{"type":"string","const":"rapid","title":"Time Control","default":"rapid"},"opponent_type":{"type":"string","enum":["human","bot"],"title":"Opponent Type","default":"human"},"bot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}},"additionalProperties":false,"type":"object","title":"CreateGameRequest"},"CreateGameResponse":{"properties":{"game_id":{"type":"string","title":"Game Id"},"game_code":{"type":"string","maxLength":6,"minLength":6,"pattern":"^[2-9A-HJ-KM-NP-Z]{6}$","title":"Game Code"},"play_as":{"type":"string","enum":["white","black"],"title":"Play As"},"rule_variant":{"type":"string","enum":["berkeley","berkeley_any","cincinnati","wild16","rand","english","crazykrieg"],"title":"Rule Variant"},"state":{"type":"string","enum":["waiting","active"],"title":"State"},"join_url":{"type":"string","title":"Join Url"},"game_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Game Url"},"opponent_type":{"type":"string","enum":["human","bot"],"title":"Opponent Type","default":"human"},"bot":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Bot"}},"additionalProperties":false,"type":"object","required":["game_id","game_code","play_as","rule_variant","state","join_url"],"title":"CreateGameResponse"},"GameMetadataResponse":{"properties":{"game_id":{"type":"string","title":"Game Id"},"game_code":{"type":"string","maxLength":6,"minLength":6,"pattern":"^[2-9A-HJ-KM-NP-Z]{6}$","title":"Game Code"},"rule_variant":{"type":"string","enum":["berkeley","berkeley_any","cincinnati","wild16","rand","english","crazykrieg"],"title":"Rule Variant"},"state":{"type":"string","enum":["waiting","active","completed"],"title":"State"},"opponent_type":{"type":"string","enum":["human","bot"],"title":"Opponent Type","default":"human"},"white":{"anyOf":[{"$ref":"#/components/schemas/PublicPlayer"},{"type":"null"}]},"black":{"anyOf":[{"$ref":"#/components/schemas/PublicPlayer"},{"type":"null"}]},"turn":{"anyOf":[{"type":"string","enum":["white","black"]},{"type":"null"}],"title":"Turn"},"move_number":{"type":"integer","minimum":1.0,"title":"Move Number"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"rating_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rating Snapshot"}},"additionalProperties":false,"type":"object","required":["game_id","game_code","rule_variant","state","move_number","created_at","updated_at"],"title":"GameMetadataResponse"},"GameStateResponse":{"properties":{"game_id":{"type":"string","title":"Game Id"},"state":{"type":"string","enum":["waiting","active","completed"],"title":"State"},"turn":{"anyOf":[{"type":"string","enum":["white","black"]},{"type":"null"}],"title":"Turn"},"move_number":{"type":"integer","minimum":1.0,"title":"Move Number"},"your_color":{"type":"string","enum":["white","black"],"title":"Your Color"},"your_fen":{"type":"string","title":"Your Fen"},"allowed_moves":{"items":{"type":"string"},"type":"array","title":"Allowed Moves"},"material_summary":{"$ref":"#/components/schemas/MaterialSummary"},"reserve_summary":{"$ref":"#/components/schemas/ReserveSummary"},"scoresheet":{"$ref":"#/components/schemas/ViewerScoresheet"},"referee_log":{"items":{"$ref":"#/components/schemas/RefereeLogItem"},"type":"array","title":"Referee Log"},"referee_turns":{"items":{"$ref":"#/components/schemas/RefereeTurnEntry"},"type":"array","title":"Referee Turns"},"possible_actions":{"items":{"type":"string","enum":["move","ask_any"]},"type":"array","title":"Possible Actions"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"clock":{"$ref":"#/components/schemas/ClockState"}},"additionalProperties":false,"type":"object","required":["game_id","state","move_number","your_color","your_fen","material_summary","reserve_summary","scoresheet","referee_log","possible_actions","clock"],"title":"GameStateResponse"},"GameTranscriptResponse":{"properties":{"game_id":{"type":"string","title":"Game Id"},"rule_variant":{"type":"string","enum":["berkeley","berkeley_any","cincinnati","wild16","rand","english","crazykrieg"],"title":"Rule Variant"},"viewer_color":{"anyOf":[{"type":"string","enum":["white","black"]},{"type":"null"}],"title":"Viewer Color"},"moves":{"items":{"$ref":"#/components/schemas/TranscriptMoveItem"},"type":"array","title":"Moves"}},"additionalProperties":false,"type":"object","required":["game_id","rule_variant","moves"],"title":"GameTranscriptResponse"},"GuestLoginResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"username":{"type":"string","title":"Username"},"message":{"type":"string","title":"Message","default":"Guest account created. You are now logged in."}},"type":"object","required":["user_id","username"],"title":"GuestLoginResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JoinGameResponse":{"properties":{"game_id":{"type":"string","title":"Game Id"},"game_code":{"type":"string","maxLength":6,"minLength":6,"pattern":"^[2-9A-HJ-KM-NP-Z]{6}$","title":"Game Code"},"play_as":{"type":"string","enum":["white","black"],"title":"Play As"},"rule_variant":{"type":"string","enum":["berkeley","berkeley_any","cincinnati","wild16","rand","english","crazykrieg"],"title":"Rule Variant"},"state":{"type":"string","const":"active","title":"State","default":"active"},"game_url":{"type":"string","title":"Game Url"}},"additionalProperties":false,"type":"object","required":["game_id","game_code","play_as","rule_variant","game_url"],"title":"JoinGameResponse"},"LobbyStatsResponse":{"properties":{"active_games_now":{"type":"integer","title":"Active Games Now","default":0},"completed_last_hour":{"type":"integer","title":"Completed Last Hour","default":0},"completed_last_24_hours":{"type":"integer","title":"Completed Last 24 Hours","default":0},"completed_total":{"type":"integer","title":"Completed Total","default":0}},"additionalProperties":false,"type":"object","title":"LobbyStatsResponse"},"LoginRequest":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"LoginRequest"},"LoginResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"username":{"type":"string","title":"Username"}},"type":"object","required":["user_id","username"],"title":"LoginResponse"},"MaterialSideSummary":{"properties":{"pieces_remaining":{"type":"integer","minimum":0.0,"title":"Pieces Remaining"},"pawns_captured":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Pawns Captured"}},"additionalProperties":false,"type":"object","required":["pieces_remaining"],"title":"MaterialSideSummary"},"MaterialSummary":{"properties":{"white":{"$ref":"#/components/schemas/MaterialSideSummary"},"black":{"$ref":"#/components/schemas/MaterialSideSummary"}},"additionalProperties":false,"type":"object","required":["white","black"],"title":"MaterialSummary"},"MoveRequest":{"properties":{"uci":{"type":"string","maxLength":5,"minLength":4,"title":"Uci"}},"additionalProperties":false,"type":"object","required":["uci"],"title":"MoveRequest"},"MoveResponse":{"properties":{"move_done":{"type":"boolean","title":"Move Done"},"announcement":{"type":"string","title":"Announcement"},"special_announcement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Special Announcement"},"checks":{"items":{"type":"string"},"type":"array","title":"Checks"},"capture_square":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capture Square"},"captured_piece_announcement":{"anyOf":[{"type":"string","enum":["PAWN","PIECE","KNIGHT","BISHOP","ROOK","QUEEN"]},{"type":"null"}],"title":"Captured Piece Announcement"},"dropped_piece_announcement":{"anyOf":[{"type":"string","enum":["PAWN","PIECE","KNIGHT","BISHOP","ROOK","QUEEN"]},{"type":"null"}],"title":"Dropped Piece Announcement"},"en_passant_announced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"En Passant Announced"},"promotion_announced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Promotion Announced"},"next_turn_pawn_tries":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Next Turn Pawn Tries"},"next_turn_has_pawn_capture":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Next Turn Has Pawn Capture"},"next_turn_pawn_try_squares":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Next Turn Pawn Try Squares"},"turn":{"anyOf":[{"type":"string","enum":["white","black"]},{"type":"null"}],"title":"Turn"},"game_over":{"type":"boolean","title":"Game Over"},"clock":{"$ref":"#/components/schemas/ClockState"}},"additionalProperties":false,"type":"object","required":["move_done","announcement","game_over","clock"],"title":"MoveResponse"},"MyGamesResponse":{"properties":{"games":{"items":{"$ref":"#/components/schemas/GameMetadataResponse"},"type":"array","title":"Games"}},"additionalProperties":false,"type":"object","required":["games"],"title":"MyGamesResponse"},"OpenGameItem":{"properties":{"game_code":{"type":"string","maxLength":6,"minLength":6,"pattern":"^[2-9A-HJ-KM-NP-Z]{6}$","title":"Game Code"},"rule_variant":{"type":"string","enum":["berkeley","berkeley_any","cincinnati","wild16","rand","english","crazykrieg"],"title":"Rule Variant"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"available_color":{"type":"string","enum":["white","black"],"title":"Available Color"}},"additionalProperties":false,"type":"object","required":["game_code","rule_variant","created_by","created_at","available_color"],"title":"OpenGameItem"},"OpenGamesResponse":{"properties":{"games":{"items":{"$ref":"#/components/schemas/OpenGameItem"},"type":"array","title":"Games"}},"additionalProperties":false,"type":"object","required":["games"],"title":"OpenGamesResponse"},"PublicPlayer":{"properties":{"username":{"type":"string","title":"Username"},"connected":{"type":"boolean","title":"Connected"},"role":{"type":"string","enum":["user","guest","bot"],"title":"Role","default":"user"},"elo":{"type":"integer","title":"Elo","default":1200},"ratings":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"Ratings"}},"additionalProperties":false,"type":"object","required":["username","connected"],"title":"PublicPlayer"},"RecentGameItem":{"properties":{"game_id":{"type":"string","title":"Game Id"},"game_code":{"type":"string","maxLength":6,"minLength":6,"pattern":"^[2-9A-HJ-KM-NP-Z]{6}$","title":"Game Code"},"rule_variant":{"type":"string","enum":["berkeley","berkeley_any","cincinnati","wild16","rand","english","crazykrieg"],"title":"Rule Variant"},"white":{"$ref":"#/components/schemas/PublicPlayer"},"black":{"$ref":"#/components/schemas/PublicPlayer"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"completed_at":{"type":"string","format":"date-time","title":"Completed At"}},"additionalProperties":false,"type":"object","required":["game_id","game_code","rule_variant","white","black","completed_at"],"title":"RecentGameItem"},"RecentGamesResponse":{"properties":{"games":{"items":{"$ref":"#/components/schemas/RecentGameItem"},"type":"array","title":"Games"}},"additionalProperties":false,"type":"object","required":["games"],"title":"RecentGamesResponse"},"RefereeLogItem":{"properties":{"ply":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ply"},"announcement":{"type":"string","title":"Announcement"},"special_announcement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Special Announcement"},"capture_square":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capture Square"},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timestamp"},"replay_fen":{"anyOf":[{"$ref":"#/components/schemas/ReplayFen"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["announcement"],"title":"RefereeLogItem"},"RefereeTurnEntry":{"properties":{"turn":{"type":"integer","minimum":1.0,"title":"Turn"},"white":{"items":{"anyOf":[{"$ref":"#/components/schemas/AnnouncementEntry"},{"type":"string"}]},"type":"array","title":"White"},"black":{"items":{"anyOf":[{"$ref":"#/components/schemas/AnnouncementEntry"},{"type":"string"}]},"type":"array","title":"Black"}},"additionalProperties":false,"type":"object","required":["turn"],"title":"RefereeTurnEntry"},"RegisterRequest":{"properties":{"username":{"type":"string","maxLength":33,"minLength":1,"pattern":"^[a-zA-Z0-9_]+$","title":"Username"},"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email"},"password":{"type":"string","maxLength":512,"minLength":1,"title":"Password"}},"type":"object","required":["username","email","password"],"title":"RegisterRequest"},"RegisterResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"username":{"type":"string","title":"Username"},"message":{"type":"string","title":"Message","default":"Account created. You are now logged in."}},"type":"object","required":["user_id","username"],"title":"RegisterResponse"},"ReplayFen":{"properties":{"full":{"type":"string","title":"Full"},"white":{"type":"string","title":"White"},"black":{"type":"string","title":"Black"}},"additionalProperties":false,"type":"object","required":["full","white","black"],"title":"ReplayFen"},"ReserveSideSummary":{"properties":{"pawns":{"type":"integer","minimum":0.0,"title":"Pawns","default":0},"knights":{"type":"integer","minimum":0.0,"title":"Knights","default":0},"bishops":{"type":"integer","minimum":0.0,"title":"Bishops","default":0},"rooks":{"type":"integer","minimum":0.0,"title":"Rooks","default":0},"queens":{"type":"integer","minimum":0.0,"title":"Queens","default":0}},"additionalProperties":false,"type":"object","title":"ReserveSideSummary"},"ReserveSummary":{"properties":{"white":{"$ref":"#/components/schemas/ReserveSideSummary"},"black":{"$ref":"#/components/schemas/ReserveSideSummary"}},"additionalProperties":false,"type":"object","required":["white","black"],"title":"ReserveSummary"},"ScoresheetTurn":{"properties":{"turn":{"type":"integer","minimum":1.0,"title":"Turn"},"white":{"items":{"anyOf":[{"$ref":"#/components/schemas/AnnouncementEntry"},{"type":"string"}]},"type":"array","title":"White"},"black":{"items":{"anyOf":[{"$ref":"#/components/schemas/AnnouncementEntry"},{"type":"string"}]},"type":"array","title":"Black"}},"additionalProperties":false,"type":"object","required":["turn"],"title":"ScoresheetTurn"},"TranscriptAnswer":{"properties":{"main":{"type":"string","title":"Main"},"capture_square":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capture Square"},"captured_piece_announcement":{"anyOf":[{"type":"string","enum":["PAWN","PIECE","KNIGHT","BISHOP","ROOK","QUEEN"]},{"type":"null"}],"title":"Captured Piece Announcement"},"dropped_piece_announcement":{"anyOf":[{"type":"string","enum":["PAWN","PIECE","KNIGHT","BISHOP","ROOK","QUEEN"]},{"type":"null"}],"title":"Dropped Piece Announcement"},"en_passant_announced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"En Passant Announced"},"promotion_announced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Promotion Announced"},"special":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Special"},"checks":{"items":{"type":"string"},"type":"array","title":"Checks"},"next_turn_pawn_tries":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Next Turn Pawn Tries"},"next_turn_has_pawn_capture":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Next Turn Has Pawn Capture"},"next_turn_pawn_try_squares":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Next Turn Pawn Try Squares"}},"additionalProperties":false,"type":"object","required":["main"],"title":"TranscriptAnswer"},"TranscriptMoveItem":{"properties":{"ply":{"type":"integer","minimum":1.0,"title":"Ply"},"color":{"type":"string","enum":["white","black"],"title":"Color"},"question_type":{"type":"string","title":"Question Type"},"uci":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uci"},"answer":{"$ref":"#/components/schemas/TranscriptAnswer"},"move_done":{"type":"boolean","title":"Move Done"},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timestamp"},"replay_fen":{"anyOf":[{"$ref":"#/components/schemas/ReplayFen"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["ply","color","question_type","answer","move_done"],"title":"TranscriptMoveItem"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ViewerScoresheet":{"properties":{"viewer_color":{"type":"string","enum":["white","black"],"title":"Viewer Color"},"last_move_number":{"type":"integer","minimum":0.0,"title":"Last Move Number"},"turns":{"items":{"$ref":"#/components/schemas/ScoresheetTurn"},"type":"array","title":"Turns"}},"additionalProperties":false,"type":"object","required":["viewer_color","last_move_number"],"title":"ViewerScoresheet"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"ksbot_<token-id>.<token-secret>","description":"Use the bot bearer token returned by POST /auth/bots/register."}}}}