{"openapi":"3.1.0","info":{"title":"dota2.ai Review API","version":"1.0.0"},"paths":{"/api/v1/review/{matchId}":{"get":{"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":1099511627776}},{"name":"hero","in":"query","schema":{"type":"string"},"description":"Whitelisted hero slug or numeric ID"},{"name":"lang","in":"query","schema":{"enum":["en","zh"],"default":"en"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"./schema/review.v1.json"}}}},"400":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Unified error; streams emit a terminal error event","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds until retry"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/review/{matchId}/stream":{"get":{"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":1099511627776}},{"name":"hero","in":"query","schema":{"type":"string"},"description":"Whitelisted hero slug or numeric ID"},{"name":"lang","in":"query","schema":{"enum":["en","zh"],"default":"en"}},{"name":"Last-Event-ID","in":"header","schema":{"type":"integer","minimum":0}}],"description":"Ordered progress, hero_pick, card, token, done/error events. IDs increase; heartbeat every 15 seconds. Cached replay resumes after Last-Event-ID. done.review is the complete JSON review.","responses":{"200":{"description":"Success","content":{"text/event-stream":{"schema":{"type":"string"},"example":"retry: 3000\n\nid: 1\nevent: done\ndata: {\"state\":\"parsed\"}\n\n"}}},"400":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Unified error; streams emit a terminal error event","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds until retry"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/review/{matchId}/ask":{"post":{"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":1099511627776}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hero"],"properties":{"hero":{"type":["string","integer"]},"lang":{"enum":["en","zh"]},"followup_id":{"type":"string"},"question":{"type":"string","maxLength":300}},"anyOf":[{"required":["followup_id"]},{"required":["question"]}]}}}},"responses":{"200":{"description":"Success","content":{"text/event-stream":{"schema":{"type":"string"},"example":"retry: 3000\n\nid: 1\nevent: done\ndata: {\"state\":\"parsed\"}\n\n"}}},"400":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Unified error; streams emit a terminal error event","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds until retry"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp":{"post":{"description":"Stateless Streamable HTTP MCP. Tools: review_match({match_id,hero?,lang?}), get_evidence({match_id,hero,insight_id}), replay_review({match_id,hero?,lang?,retry?}) — the deep replay review: never blocks; while status is parsing or reviewing call again after poll_after_sec (2–4 minutes in all), recent_matches({account}), coach_report({match_id,hero?,section?,lang?}), coach_cases({match_id,hero,lang?}), coach_ask({match_id,hero,question,lang?}), goal_check({match_id,hero,goal}), hero_matchup({hero,vs,rank?}). Coach tools share the per-caller rate limit of the web coach; a rate-limited call returns isError with the wait. Send Accept: application/json, text/event-stream.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}}}},"responses":{"200":{"description":"MCP JSON-RPC response","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Notification accepted"}}},"get":{"description":"Stateless transport has no SSE subscription","responses":{"405":{"description":"Use POST"}}}},"/api/v1/config":{"get":{"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Unified error; streams emit a terminal error event","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds until retry"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/llms.txt":{"get":{"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Unified error; streams emit a terminal error event","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds until retry"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Unified error; streams emit a terminal error event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["code","retryable","message_key"],"properties":{"code":{"enum":["MATCH_NOT_FOUND","UPSTREAM_TIMEOUT","RATE_LIMITED","INVALID_INPUT","INTERNAL"]},"retryable":{"type":"boolean"},"message_key":{"type":"string"}}}}}}