{
  "openapi": "3.1.0",
  "info": {
    "title": "AnonGTO 求解器 API",
    "version": "1.0.0",
    "summary": "1 秒内返回从翻前到河牌的无限注德州扑克（NLHE）GTO 策略。",
    "description": "POST /v1/solve 用于求解单个决策点：发送牌局状态（从翻前开始的 table + streets，或自定义翻后范围的 board + pot_bb + players），即可返回当前行动玩家的 GTO 策略与期望值（EV）。请求遵循严格契约：仅接受强类型动作，拒绝任何未知字段，所有错误均通过 error.path（JSON Pointer）精确指出问题字段。所有金额单位均为大盲（bb）。免费密钥：https://anongto.com/zh/api/#get-key；文档：https://anongto.com/zh/api/docs/（Markdown 版：https://anongto.com/zh/api/docs.md）。仅限学习与分析工具使用，严禁用于实时对局。",
    "contact": {
      "url": "https://anongto.com/zh/api/"
    }
  },
  "servers": [
    {
      "url": "https://api.anongto.com"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/v1/solve": {
      "post": {
        "operationId": "solve",
        "summary": "求解单个决策点（从翻前开始的完整手牌，或自定义翻后范围）",
        "description": "无状态接口：传入 table + streets 求解从翻前开始的手牌，或传入 board + pot_bb + players 求解自定义翻后范围（支持 2 人底池或 3 人底池）。服务端会自动缓存前序街道的求解结果；配合 POST /v1/warm 预热可实现 <10 ms 缓存命中。任何位置出现未知字段均返回 400。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SolveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "当前决策点的 GTO 策略与 EV",
            "headers": {
              "X-Quota-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "今日允许的求解请求上限"
              },
              "X-Quota-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "今日剩余的求解配额"
              },
              "X-Quota-Total-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "仅限总上限密钥：密钥生命周期总请求上限"
              },
              "X-Quota-Total-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "仅限总上限密钥：剩余总请求次数"
              },
              "Server-Timing": {
                "schema": {
                  "type": "string",
                  "examples": [
                    "server;dur=8, solve;dur=0"
                  ]
                },
                "description": "服务端总耗时与求解耗时（毫秒，与响应体 timing 字段一致）"
              },
              "X-Server-Region": {
                "schema": {
                  "type": "string"
                },
                "description": "处理本次请求的服务器区域"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/warm": {
      "post": {
        "operationId": "warm",
        "summary": "后台预热决策点或跨街范围转换（立即返回 202，不消耗求解配额）",
        "description": "鉴权方式、请求体结构（HandSolve / RangesSolve）与同步 400/422 校验均与 POST /v1/solve 完全一致。客户端最佳实践：每当牌桌状态发生变化且尚未轮到 Hero 行动时（包括发牌动画期间已关闭的街道，以及通过 MW3_MEMO 预热的 3 人底池），发后即忘地调用 POST /v1/warm 发送 { table, streets }。不消耗求解配额（需剩余求解配额 > 0；每日未命中缓存的预热上限为 max(20, 4 * 今日已用求解数)，缓存命中与去重合并不计上限；独立的 2 倍每分钟限流）。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SolveRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "预热请求已受理",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "id",
                        "status"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^slv_[a-f0-9]{20}$",
                          "description": "已入队的后台预热任务追踪 ID（支持 2 人及 3 人底池）"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "warming"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ready"
                          ],
                          "description": "已在缓存中就绪（含已关闭街道的范围转换或直接命中图表的翻前局面），无需额外计算"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "reason"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "skipped"
                          ]
                        },
                        "reason": {
                          "type": "string",
                          "enum": [
                            "quota",
                            "warm_cap",
                            "busy"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/solves/{id}/trace": {
      "get": {
        "operationId": "getSolveTrace",
        "summary": "查询某次求解的完整手牌与执行链路追踪（保留 24 小时，仅限本密钥，不消耗配额）",
        "description": "返回本 API 密钥在过去 24 小时内任意 POST /v1/solve 请求的完整执行追踪（含 request、actions[]、ev_bb、带 our_solve 与 warm.request/response 的 nodes[]、steps[]、input_ranges 与 timing）。不消耗求解配额（限流 120 次/分钟）。可在 https://anongto.com/zh/api/latency/ 的交互式牌桌上逐步回放。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^slv_[a-f0-9]{20}$"
            },
            "description": "POST /v1/solve 返回的求解 ID（slv_...）",
            "examples": {
              "default": {
                "value": "slv_dced614b1e934b91ba00"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "求解执行链路追踪对象",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolveTrace"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/solves/{id}/nodes/{index}": {
      "get": {
        "operationId": "getSolveTraceNode",
        "summary": "获取追踪中单个节点的 169 手牌类别策略与各方到达范围（保留 24 小时，不消耗配额）",
        "description": "返回本密钥 24 小时内求解追踪中按时间排序的第 index 个节点（0 .. nodes.length - 1）的 169 牌型类别 GTO 策略（当存在 to_act 时含 actions[] 与 hand_classes）及各存活位置的到达范围（player_ranges）。不消耗求解配额（限流 120 次/分钟）。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^slv_[a-f0-9]{20}$"
            },
            "description": "POST /v1/solve 返回的求解 ID（slv_...）",
            "examples": {
              "default": {
                "value": "slv_dced614b1e934b91ba00"
              }
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "trace.nodes[] 中从 0 开始的时间顺序节点索引",
            "examples": {
              "default": {
                "value": 8
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "该节点的 169 牌型类别策略与各方到达范围",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolveTraceNode"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "operationId": "getAccount",
        "summary": "查询当前密钥的套餐、限额与近 30 天用量",
        "responses": {
          "200": {
            "description": "账户与配额信息",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/account/rotate": {
      "post": {
        "operationId": "rotateKey",
        "summary": "轮换密钥（保持当前套餐；旧密钥在 24 小时内仍有效）",
        "responses": {
          "200": {
            "description": "新密钥（仅展示一次）",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "previous_key_stops_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/status": {
      "get": {
        "operationId": "getStatus",
        "summary": "查询各组件实时状态与近 90 天可用率（无需密钥）",
        "security": [],
        "responses": {
          "200": {
            "description": "服务状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "operational",
                        "degraded"
                      ]
                    },
                    "parts": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "boolean"
                      }
                    },
                    "checked_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "uptime_90d_pct": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "days": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day": {
                            "type": "string",
                            "format": "date"
                          },
                          "checks": {
                            "type": "integer"
                          },
                          "uptime_pct": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/demo": {
      "get": {
        "operationId": "demo",
        "summary": "获取预设局面的缓存示例结果（无需密钥）；不传 preset 时返回所有预设列表",
        "security": [],
        "parameters": [
          {
            "name": "preset",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "示例局面名（非牌桌预设），如 chart-flop-btn、chart-river-btn、flop-bb"
          },
          {
            "name": "detail",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "summary",
                "classes",
                "combos"
              ],
              "default": "classes",
              "description": "Demo query parameter only: summary (aggregate only), classes (hand_classes), combos (combos)."
            },
            "description": "仅限 Demo 查询参数：summary（仅汇总）、classes（169 牌型类别）、combos（1326 组合）"
          }
        ],
        "responses": {
          "200": {
            "description": "缓存的示例请求与响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用你的密钥（agto_…），通过 Authorization: Bearer <key> 或 X-API-Key: <key> 传递。"
      }
    },
    "responses": {
      "Error": {
        "description": "错误响应",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "SolveRequest": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/HandSolve"
          },
          {
            "$ref": "#/components/schemas/RangesSolve"
          }
        ],
        "description": "无需 mode 字段：发送 table + streets 表示从翻前开始的完整手牌，发送 board + pot_bb + players 表示自定义翻后范围。"
      },
      "HandSolve": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "table",
          "streets"
        ],
        "description": "从发牌开始的完整手牌。接口将求解所提供最后一条街的下一个待行动决策（未传 flop 时即求解翻前）。",
        "properties": {
          "table": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "seats",
                  "stack_bb",
                  "rake"
                ],
                "description": "简写牌桌：自动按标准翻前行动顺序展开 seats（2-9 人，开启 straddle 时 STR 在最后），所有座位默认使用 stack_bb，可通过 stacks_bb 覆写单个座位。",
                "properties": {
                  "seats": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 9
                  },
                  "stack_bb": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "所有座位的默认初始筹码（单位：bb）"
                  },
                  "stacks_bb": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "description": "可选的按座位筹码覆写，例如 {\"BTN\": 80}"
                  },
                  "rake": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": false,
                    "required": [
                      "pct"
                    ],
                    "properties": {
                      "pct": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 10
                      },
                      "cap_bb": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0
                      }
                    },
                    "description": "抽水设置；null 表示无抽水"
                  },
                  "ante_bb": {
                    "type": "number",
                    "minimum": 0,
                    "default": 0,
                    "description": "每人前注（单位：bb）"
                  },
                  "straddle": {
                    "type": "boolean",
                    "default": false,
                    "description": "STR 座位执行 2 bb 抓头（Straddle）"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "max_seats",
                  "seats",
                  "rake"
                ],
                "description": "详写牌桌：按翻前行动顺序列出每个座位及其初始筹码 stack_bb。",
                "properties": {
                  "max_seats": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 9
                  },
                  "seats": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 9,
                    "description": "必须恰好包含 max_seats 个元素，按翻前行动顺序排列（首位行动者在前，BB 在最后；开启 straddle 时 STR 在最后）；座位名唯一；单挑为 SB, BB。",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "seat",
                        "stack_bb"
                      ],
                      "properties": {
                        "seat": {
                          "type": "string",
                          "enum": [
                            "UTG",
                            "UTG1",
                            "UTG2",
                            "LJ",
                            "MP",
                            "HJ",
                            "CO",
                            "BTN",
                            "SB",
                            "BB",
                            "STR"
                          ]
                        },
                        "stack_bb": {
                          "type": "number",
                          "exclusiveMinimum": 0,
                          "description": "本手牌开始时（扣盲注与前注前）的初始筹码"
                        }
                      }
                    }
                  },
                  "rake": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": false,
                    "required": [
                      "pct"
                    ],
                    "properties": {
                      "pct": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 10
                      },
                      "cap_bb": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0
                      }
                    },
                    "description": "抽水设置；null 表示无抽水"
                  },
                  "ante_bb": {
                    "type": "number",
                    "minimum": 0,
                    "default": 0,
                    "description": "每人前注（单位：bb）"
                  },
                  "straddle": {
                    "type": "boolean",
                    "default": false,
                    "description": "STR 座位执行 2 bb 抓头（Straddle）"
                  }
                }
              }
            ],
            "description": "牌桌配置（简写或详写均可）。服务端会自动决定求解路径（近似匹配时使用图表，否则调用翻前求解器实时求解）。"
          },
          "streets": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "preflop"
            ],
            "properties": {
              "preflop": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "seat",
                        "type"
                      ],
                      "properties": {
                        "seat": {
                          "type": "string",
                          "enum": [
                            "UTG",
                            "UTG1",
                            "UTG2",
                            "LJ",
                            "MP",
                            "HJ",
                            "CO",
                            "BTN",
                            "SB",
                            "BB",
                            "STR"
                          ]
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "fold",
                            "check",
                            "call",
                            "all_in"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "seat",
                        "type",
                        "to_bb"
                      ],
                      "properties": {
                        "seat": {
                          "type": "string",
                          "enum": [
                            "UTG",
                            "UTG1",
                            "UTG2",
                            "LJ",
                            "MP",
                            "HJ",
                            "CO",
                            "BTN",
                            "SB",
                            "BB",
                            "STR"
                          ]
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "raise"
                          ]
                        },
                        "to_bb": {
                          "type": "number",
                          "exclusiveMinimum": 0,
                          "description": "The street total raised to, in bb"
                        }
                      }
                    }
                  ],
                  "examples": [
                    {
                      "seat": "UTG",
                      "type": "fold"
                    },
                    {
                      "seat": "BTN",
                      "type": "raise",
                      "to_bb": 2.5
                    },
                    {
                      "seat": "BB",
                      "type": "call"
                    }
                  ]
                },
                "maxItems": 40,
                "description": "按顺序列出翻前每一个动作（包含弃牌；空数组 [] 表示首个决策点）。越序行动将返回 400 invalid_poker_state 并标注字段路径。"
              },
              "flop": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cards",
                  "actions"
                ],
                "properties": {
                  "cards": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[2-9TJQKA][cdhs]$",
                      "examples": [
                        "Jh"
                      ]
                    },
                    "minItems": 3,
                    "maxItems": 3
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "fold",
                                "check",
                                "call",
                                "all_in"
                              ]
                            }
                          }
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "type",
                            "to_bb"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "bet",
                                "raise"
                              ]
                            },
                            "to_bb": {
                              "type": "number",
                              "exclusiveMinimum": 0,
                              "description": "The player's street total after the action, in bb"
                            }
                          }
                        }
                      ],
                      "examples": [
                        {
                          "type": "check"
                        },
                        {
                          "type": "bet",
                          "to_bb": 1.28
                        },
                        {
                          "type": "raise",
                          "to_bb": 6.5
                        },
                        {
                          "type": "call"
                        },
                        {
                          "type": "all_in"
                        }
                      ]
                    },
                    "maxItems": 12
                  }
                }
              },
              "turn": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "card",
                  "actions"
                ],
                "properties": {
                  "card": {
                    "type": "string",
                    "pattern": "^[2-9TJQKA][cdhs]$",
                    "examples": [
                      "Jh"
                    ]
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "fold",
                                "check",
                                "call",
                                "all_in"
                              ]
                            }
                          }
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "type",
                            "to_bb"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "bet",
                                "raise"
                              ]
                            },
                            "to_bb": {
                              "type": "number",
                              "exclusiveMinimum": 0,
                              "description": "The player's street total after the action, in bb"
                            }
                          }
                        }
                      ],
                      "examples": [
                        {
                          "type": "check"
                        },
                        {
                          "type": "bet",
                          "to_bb": 1.28
                        },
                        {
                          "type": "raise",
                          "to_bb": 6.5
                        },
                        {
                          "type": "call"
                        },
                        {
                          "type": "all_in"
                        }
                      ]
                    },
                    "maxItems": 12
                  }
                },
                "description": "需先提供 flop"
              },
              "river": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "card",
                  "actions"
                ],
                "properties": {
                  "card": {
                    "type": "string",
                    "pattern": "^[2-9TJQKA][cdhs]$",
                    "examples": [
                      "Jh"
                    ]
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "fold",
                                "check",
                                "call",
                                "all_in"
                              ]
                            }
                          }
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "type",
                            "to_bb"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "bet",
                                "raise"
                              ]
                            },
                            "to_bb": {
                              "type": "number",
                              "exclusiveMinimum": 0,
                              "description": "The player's street total after the action, in bb"
                            }
                          }
                        }
                      ],
                      "examples": [
                        {
                          "type": "check"
                        },
                        {
                          "type": "bet",
                          "to_bb": 1.28
                        },
                        {
                          "type": "raise",
                          "to_bb": 6.5
                        },
                        {
                          "type": "call"
                        },
                        {
                          "type": "all_in"
                        }
                      ]
                    },
                    "maxItems": 12
                  }
                },
                "description": "需先提供 turn"
              }
            },
            "description": "除最后一条街外，前面所有街道必须已闭合（否则返回 422 street_open）。"
          },
          "sizing": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto_simplified"
                ],
                "description": "省略时的默认值：自动尺度策略。当尺度选择网络认为单一尺度即可干净覆盖翻牌局面时优先采用单尺度（否则回退至多尺度菜单），转牌与河牌使用标准尺度菜单。"
              },
              {
                "type": "string",
                "enum": [
                  "auto_mixed"
                ],
                "description": "自动尺度策略：在翻牌圈使用尺度选择网络的完整多尺度 GTO 混合菜单（仅限 2 人翻后），转牌与河牌使用标准尺度菜单。"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bet": {
                    "type": "array",
                    "minItems": 0,
                    "maxItems": 3,
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "pct"
                          ],
                          "properties": {
                            "pct": {
                              "type": "number",
                              "exclusiveMinimum": 0,
                              "description": "底池百分比（% pot）"
                            }
                          }
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "bb"
                          ],
                          "properties": {
                            "bb": {
                              "type": "number",
                              "exclusiveMinimum": 0
                            }
                          }
                        }
                      ]
                    }
                  },
                  "raise": {
                    "type": "array",
                    "minItems": 0,
                    "maxItems": 3,
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "pct"
                          ],
                          "properties": {
                            "pct": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "description": "跟注后底池百分比（% pot）"
                            }
                          }
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "bb"
                          ],
                          "properties": {
                            "bb": {
                              "type": "number",
                              "exclusiveMinimum": 0
                            }
                          }
                        }
                      ]
                    }
                  },
                  "call": {
                    "type": "boolean",
                    "description": "在该节点的求解树中保留（true）或移除（false）跟注 / 跛入 / 冷跟动作。"
                  },
                  "all_in": {
                    "type": "boolean",
                    "description": "在该节点的求解树中保留（true）或移除（false）全下动作。"
                  }
                },
                "description": "应用于当前翻前或翻后决策节点的自定义动作与下注/加注 CRUD 菜单（翻前支持 raise/call/all_in；翻后单挑与 3 人底池均支持 bet/raise/call/all_in）。"
              }
            ],
            "default": "auto_simplified",
            "description": "可选的尺度与动作菜单覆写（适用于翻前、翻后完整手牌以及自定义范围请求）：\"auto_simplified\"（默认）、\"auto_mixed\"（仅限 2 人翻后），或自定义对象 {\"bet\"?, \"raise\"?, \"call\"?, \"all_in\"?}。",
            "examples": [
              "auto_simplified",
              "auto_mixed",
              {
                "bet": [
                  {
                    "pct": 33
                  },
                  {
                    "pct": 75
                  }
                ],
                "raise": [
                  {
                    "pct": 60
                  }
                ]
              },
              {
                "call": true,
                "raise": [
                  {
                    "bb": 7.5
                  }
                ],
                "all_in": false
              }
            ]
          },
          "include": {
            "type": "object",
            "additionalProperties": false,
            "description": "可选的组合式输出字段开关。省略时默认仅返回顶层聚合 actions[]（约 1.5 KB）。hand_classes 与 combos 作为独立顶层字段返回，可在同一请求中同时设为 true。",
            "properties": {
              "hand_classes": {
                "type": "boolean",
                "default": false,
                "description": "包含顶层 hand_classes（169 种手牌类别映射）"
              },
              "combos": {
                "type": "boolean",
                "default": false,
                "description": "包含顶层 combos（翻后为 1326 组合映射；翻前为 169 牌型类别映射）"
              },
              "hole_cards": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[2-9TJQKA][cdhs]$",
                  "examples": [
                    "Jh"
                  ]
                },
                "minItems": 2,
                "maxItems": 2,
                "uniqueItems": true,
                "description": "指定单个起手组合（2 张不重复且未出现在公共牌中的牌，顺序不限）：为当前行动玩家返回顶层 hole_cards。重复牌或公共牌冲突时返回 400（路径 /include/hole_cards/0 或 /1）。",
                "examples": [
                  [
                    "Ah",
                    "Kh"
                  ]
                ]
              }
            }
          }
        },
        "examples": [
          {
            "table": {
              "seats": 6,
              "stack_bb": 100,
              "rake": {
                "pct": 5,
                "cap_bb": 0.6
              }
            },
            "streets": {
              "preflop": [
                {
                  "seat": "UTG",
                  "type": "fold"
                },
                {
                  "seat": "HJ",
                  "type": "fold"
                },
                {
                  "seat": "CO",
                  "type": "fold"
                },
                {
                  "seat": "BTN",
                  "type": "raise",
                  "to_bb": 2.5
                },
                {
                  "seat": "SB",
                  "type": "fold"
                },
                {
                  "seat": "BB",
                  "type": "call"
                }
              ],
              "flop": {
                "cards": [
                  "Jh",
                  "9s",
                  "4d"
                ],
                "actions": [
                  {
                    "type": "check"
                  },
                  {
                    "type": "bet",
                    "to_bb": 1.28
                  },
                  {
                    "type": "call"
                  }
                ]
              },
              "turn": {
                "card": "2c",
                "actions": []
              }
            },
            "include": {
              "hand_classes": true
            }
          },
          {
            "table": {
              "seats": 2,
              "stack_bb": 40,
              "rake": null
            },
            "streets": {
              "preflop": [
                {
                  "seat": "SB",
                  "type": "raise",
                  "to_bb": 2
                }
              ]
            }
          },
          {
            "table": {
              "seats": 6,
              "stack_bb": 100,
              "rake": {
                "pct": 5,
                "cap_bb": 0.6
              }
            },
            "streets": {
              "preflop": [
                {
                  "seat": "UTG",
                  "type": "fold"
                },
                {
                  "seat": "HJ",
                  "type": "fold"
                },
                {
                  "seat": "CO",
                  "type": "fold"
                },
                {
                  "seat": "BTN",
                  "type": "raise",
                  "to_bb": 2.5
                },
                {
                  "seat": "SB",
                  "type": "fold"
                },
                {
                  "seat": "BB",
                  "type": "call"
                }
              ],
              "flop": {
                "cards": [
                  "Jh",
                  "9s",
                  "4d"
                ],
                "actions": [
                  {
                    "type": "check"
                  }
                ]
              }
            },
            "sizing": "auto_mixed",
            "include": {
              "hole_cards": [
                "Kh",
                "Ah"
              ]
            }
          }
        ]
      },
      "RangesSolve": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "board",
          "pot_bb",
          "players"
        ],
        "description": "从自定义双方/三方范围开始求解单条翻后街道。3 人底池由 3 人求解器处理（翻牌神经网络约 10 s，转牌神经网络约 3 s，河牌精确求解），不返回单动作 EV，全站同时仅运行 1 个 3 人实时求解（繁忙时返回 503 busy，请数秒后重试）。",
        "properties": {
          "board": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[2-9TJQKA][cdhs]$",
              "examples": [
                "Jh"
              ]
            },
            "minItems": 3,
            "maxItems": 5,
            "uniqueItems": true,
            "description": "3、4 或 5 张互不重复的公共牌；数组长度决定当前街道。",
            "examples": [
              [
                "Jh",
                "9s",
                "4d"
              ]
            ]
          },
          "pot_bb": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "本条街开始时的底池大小（单位：bb）"
          },
          "players": {
            "type": "array",
            "minItems": 2,
            "maxItems": 3,
            "description": "按翻后行动顺序排列：首位元素先行动",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "seat",
                "stack_bb",
                "range"
              ],
              "properties": {
                "seat": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9+]{1,8}$",
                  "description": "用于响应中标识座位的名称",
                  "examples": [
                    "BB",
                    "BTN"
                  ]
                },
                "stack_bb": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "description": "本条街开始时的后手筹码（单位：bb）"
                },
                "range": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "text"
                      ],
                      "properties": {
                        "text": {
                          "type": "string",
                          "maxLength": 5000,
                          "description": "文本格式范围，例如 \"AA, AKs, AQs:0.5, 22+, ATs+, 77-99, K9o-KQo, AhKh\"。后写条目覆盖先写条目。"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "weights"
                      ],
                      "properties": {
                        "weights": {
                          "type": "array",
                          "items": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 1
                          },
                          "minItems": 1326,
                          "maxItems": 1326,
                          "description": "长度为 1,326 的权重数组；牌 ID = rank*4+suit（2c=0 … As=51）；组合 (a<b) 的索引为 b*(b-1)/2+a。"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "actions": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "type"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "fold",
                        "check",
                        "call",
                        "all_in"
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "type",
                    "to_bb"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "bet",
                        "raise"
                      ]
                    },
                    "to_bb": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "description": "The player's street total after the action, in bb"
                    }
                  }
                }
              ],
              "examples": [
                {
                  "type": "check"
                },
                {
                  "type": "bet",
                  "to_bb": 1.28
                },
                {
                  "type": "raise",
                  "to_bb": 6.5
                },
                {
                  "type": "call"
                },
                {
                  "type": "all_in"
                }
              ]
            },
            "maxItems": 12,
            "default": [],
            "description": "本条街截至目前已发生的动作序列"
          },
          "sizing": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto_simplified"
                ],
                "description": "省略时的默认值：自动尺度策略。当尺度选择网络认为单一尺度即可干净覆盖翻牌局面时优先采用单尺度（否则回退至多尺度菜单），转牌与河牌使用标准尺度菜单。"
              },
              {
                "type": "string",
                "enum": [
                  "auto_mixed"
                ],
                "description": "自动尺度策略：在翻牌圈使用尺度选择网络的完整多尺度 GTO 混合菜单（仅限 2 人翻后），转牌与河牌使用标准尺度菜单。"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bet": {
                    "type": "array",
                    "minItems": 0,
                    "maxItems": 3,
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "pct"
                          ],
                          "properties": {
                            "pct": {
                              "type": "number",
                              "exclusiveMinimum": 0,
                              "description": "底池百分比（% pot）"
                            }
                          }
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "bb"
                          ],
                          "properties": {
                            "bb": {
                              "type": "number",
                              "exclusiveMinimum": 0
                            }
                          }
                        }
                      ]
                    }
                  },
                  "raise": {
                    "type": "array",
                    "minItems": 0,
                    "maxItems": 3,
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "pct"
                          ],
                          "properties": {
                            "pct": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "description": "跟注后底池百分比（% pot）"
                            }
                          }
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "bb"
                          ],
                          "properties": {
                            "bb": {
                              "type": "number",
                              "exclusiveMinimum": 0
                            }
                          }
                        }
                      ]
                    }
                  },
                  "call": {
                    "type": "boolean",
                    "description": "在该节点的求解树中保留（true）或移除（false）跟注 / 跛入 / 冷跟动作。"
                  },
                  "all_in": {
                    "type": "boolean",
                    "description": "在该节点的求解树中保留（true）或移除（false）全下动作。"
                  }
                },
                "description": "应用于当前翻前或翻后决策节点的自定义动作与下注/加注 CRUD 菜单（翻前支持 raise/call/all_in；翻后单挑与 3 人底池均支持 bet/raise/call/all_in）。"
              }
            ],
            "default": "auto_simplified",
            "description": "可选的尺度与动作菜单覆写（适用于翻前、翻后完整手牌以及自定义范围请求）：\"auto_simplified\"（默认）、\"auto_mixed\"（仅限 2 人翻后），或自定义对象 {\"bet\"?, \"raise\"?, \"call\"?, \"all_in\"?}。",
            "examples": [
              "auto_simplified",
              "auto_mixed",
              {
                "bet": [
                  {
                    "pct": 33
                  },
                  {
                    "pct": 75
                  }
                ],
                "raise": [
                  {
                    "pct": 60
                  }
                ]
              },
              {
                "call": true,
                "raise": [
                  {
                    "bb": 7.5
                  }
                ],
                "all_in": false
              }
            ]
          },
          "rake": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "required": [
              "pct"
            ],
            "properties": {
              "pct": {
                "type": "number",
                "minimum": 0,
                "maximum": 10
              },
              "cap_bb": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              }
            },
            "description": "抽水设置；null 表示无抽水"
          },
          "include": {
            "type": "object",
            "additionalProperties": false,
            "description": "可选的组合式输出字段开关。省略时默认仅返回顶层聚合 actions[]（约 1.5 KB）。hand_classes 与 combos 作为独立顶层字段返回，可在同一请求中同时设为 true。",
            "properties": {
              "hand_classes": {
                "type": "boolean",
                "default": false,
                "description": "包含顶层 hand_classes（169 种手牌类别映射）"
              },
              "combos": {
                "type": "boolean",
                "default": false,
                "description": "包含顶层 combos（翻后为 1326 组合映射；翻前为 169 牌型类别映射）"
              },
              "hole_cards": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[2-9TJQKA][cdhs]$",
                  "examples": [
                    "Jh"
                  ]
                },
                "minItems": 2,
                "maxItems": 2,
                "uniqueItems": true,
                "description": "指定单个起手组合（2 张不重复且未出现在公共牌中的牌，顺序不限）：为当前行动玩家返回顶层 hole_cards。重复牌或公共牌冲突时返回 400（路径 /include/hole_cards/0 或 /1）。",
                "examples": [
                  [
                    "Ah",
                    "Kh"
                  ]
                ]
              }
            }
          }
        },
        "examples": [
          {
            "board": [
              "Jh",
              "9s",
              "4d",
              "2c"
            ],
            "pot_bb": 10.5,
            "players": [
              {
                "seat": "BB",
                "stack_bb": 94.5,
                "range": {
                  "text": "AA,KK,AKs:0.5"
                }
              },
              {
                "seat": "BTN",
                "stack_bb": 94.5,
                "range": {
                  "text": "22+, A2s+, K2s+, ATo+"
                }
              }
            ],
            "actions": [
              {
                "type": "check"
              },
              {
                "type": "bet",
                "to_bb": 3.5
              }
            ],
            "sizing": {
              "bet": [
                {
                  "pct": 33
                },
                {
                  "pct": 75
                }
              ],
              "raise": [
                {
                  "pct": 60
                }
              ]
            },
            "rake": {
              "pct": 5,
              "cap_bb": 3
            },
            "include": {
              "combos": true
            }
          },
          {
            "board": [
              "Jh",
              "9s",
              "4d"
            ],
            "pot_bb": 9,
            "players": [
              {
                "seat": "SB",
                "stack_bb": 97,
                "range": {
                  "text": "22+, A2s+, K9s+, ATo+"
                }
              },
              {
                "seat": "BB",
                "stack_bb": 97,
                "range": {
                  "text": "22+, A2s+, K2s+, A2o+, K9o+"
                }
              },
              {
                "seat": "BTN",
                "stack_bb": 97,
                "range": {
                  "text": "22+, A2s+, K5s+, A7o+, KTo+"
                }
              }
            ],
            "actions": [
              {
                "type": "check"
              }
            ]
          }
        ]
      },
      "HoleCardsAnswer": {
        "type": "object",
        "required": [
          "cards",
          "combo",
          "class",
          "seat",
          "granularity",
          "in_range",
          "weight",
          "ev_bb",
          "actions"
        ],
        "description": "仅当请求传入 include.hole_cards 时返回：该组合在当前决策点（针对当前行动玩家）的专属策略。若不在范围中（权重为 0 或翻前实时求解未包含该牌型），则 in_range=false、reason=\"not_in_range\"、weight=0（未知权重时为 null）、ev_bb 与 actions 为 null。",
        "properties": {
          "cards": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[2-9TJQKA][cdhs]$",
              "examples": [
                "Jh"
              ]
            },
            "minItems": 2,
            "maxItems": 2,
            "description": "高牌在前，与 combos 键名格式一致",
            "examples": [
              [
                "Ah",
                "Kh"
              ]
            ]
          },
          "combo": {
            "type": "string",
            "examples": [
              "AhKh"
            ],
            "description": "对应 combos 映射中的组合键名"
          },
          "class": {
            "type": "string",
            "examples": [
              "AKs"
            ]
          },
          "seat": {
            "type": "string",
            "description": "当前行动玩家（等于 to_act）"
          },
          "granularity": {
            "type": "string",
            "enum": [
              "combo",
              "class"
            ],
            "description": "翻后为 combo 粒度；翻前为 class 粒度（图表与翻前求解器均按 169 牌型类别作答）"
          },
          "in_range": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "无法判断时为 null（例如翻前实时求解不提供范围权重）"
          },
          "weight": {
            "type": [
              "number",
              "null"
            ],
            "description": "该组合在行动玩家范围中的权重（保留 4 位小数）；翻前实时求解时为 null"
          },
          "ev_bb": {
            "type": [
              "number",
              "null"
            ],
            "description": "该组合的期望值（保留 2 位小数）；无 EV 的局面（3 人底池或翻前实时求解）或不在范围中时为 null"
          },
          "actions": {
            "type": [
              "array",
              "null"
            ],
            "description": "与顶层 actions 对应的该组合频率（4 位小数）与单动作 EV（2 位小数）；不在范围中时为 null",
            "items": {
              "type": "object",
              "required": [
                "label",
                "type",
                "frequency",
                "ev_bb"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "fold",
                    "check",
                    "call",
                    "bet",
                    "raise",
                    "all_in"
                  ]
                },
                "to_bb": {
                  "type": "number"
                },
                "frequency": {
                  "type": "number"
                },
                "ev_bb": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          },
          "reason": {
            "type": "string",
            "enum": [
              "not_in_range"
            ],
            "description": "仅在 in_range 为 false 时返回"
          }
        }
      },
      "Answer": {
        "type": "object",
        "required": [
          "id",
          "street",
          "to_act",
          "pot_bb",
          "to_call_bb",
          "actions"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "本次求解的追踪 ID（可用于 /v1/solves/{id}/trace 与问题排查）"
          },
          "street": {
            "type": "string",
            "enum": [
              "preflop",
              "flop",
              "turn",
              "river"
            ]
          },
          "board": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[2-9TJQKA][cdhs]$",
              "examples": [
                "Jh"
              ]
            },
            "description": "当前公共牌数组"
          },
          "positions": {
            "type": "object",
            "description": "单挑包含 oop 与 ip；3 人底池包含按行动排序的 order",
            "properties": {
              "oop": {
                "type": "string"
              },
              "ip": {
                "type": "string"
              },
              "order": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "players": {
            "type": "integer",
            "description": "本条街存活的玩家数量"
          },
          "folded": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "本条街已弃牌的座位列表（3 人底池）"
          },
          "to_act": {
            "type": "string",
            "description": "当前待行动座位名（与 table 或 players 中一致）"
          },
          "pot_bb": {
            "type": "number"
          },
          "to_call_bb": {
            "type": "number"
          },
          "ev_bb": {
            "type": [
              "number",
              "null"
            ],
            "description": "当前行动玩家整个范围的期望值（单位：bb）"
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "type",
                "frequency"
              ],
              "properties": {
                "label": {
                  "type": "string",
                  "examples": [
                    "check",
                    "bet 1.82",
                    "raise 7.3",
                    "allin 97.5"
                  ],
                  "description": "动作标签，亦作为 hand_classes[*].strategy 与 combos[*].strategy 的键名"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "fold",
                    "check",
                    "call",
                    "bet",
                    "raise",
                    "all_in"
                  ]
                },
                "to_bb": {
                  "type": "number",
                  "description": "仅限 bet / raise / all_in：执行该动作后本条街累计投入总额（bb）"
                },
                "frequency": {
                  "type": "number"
                },
                "ev_bb": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          },
          "hand_classes": {
            "type": "object",
            "description": "当 include.hand_classes=true 时返回：169 牌型类别映射（\"AKs\"、\"QQ\" 等），请按名称查表，不保证键顺序。",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "combos": {
                  "type": "integer"
                },
                "weight": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ev_bb": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "strategy": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "combos": {
            "type": "object",
            "description": "当 include.combos=true 时返回：翻后为 1326 组合映射（\"AhKh\" 等；翻前为 169 牌型类别映射），请按名称查表，不保证键顺序。",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "combos": {
                  "type": "integer"
                },
                "weight": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ev_bb": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "strategy": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "hole_cards": {
            "$ref": "#/components/schemas/HoleCardsAnswer"
          },
          "input_ranges": {
            "type": "object",
            "description": "仅翻后响应返回（2 人与 3 人底池）：各座位进入本条街时的初始范围来源，按座位名索引。",
            "additionalProperties": {
              "type": "object",
              "required": [
                "source",
                "warmed",
                "warm_id"
              ],
              "properties": {
                "source": {
                  "type": "string",
                  "enum": [
                    "preflop",
                    "flop",
                    "turn",
                    "custom"
                  ],
                  "description": "该座位初始范围的来源街道或 custom"
                },
                "warmed": {
                  "type": "boolean",
                  "description": "若该座位的输入范围或本街求解由 POST /v1/warm 预热填充则为 true"
                },
                "warm_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^slv_[a-f0-9]{20}$",
                  "description": "warmed 为 true 时对应 POST /v1/warm 的追踪 ID，否则为 null"
                }
              }
            }
          },
          "timing": {
            "type": "object",
            "description": "客户端总耗时减去 server_ms 即为网络往返耗时",
            "properties": {
              "server_ms": {
                "type": "integer",
                "description": "请求到达服务器后的服务端总耗时（ms）"
              },
              "solve_ms": {
                "type": "integer",
                "description": "其中用于求解计算的耗时（ms，缓存命中时为 0）"
              },
              "warm_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^slv_[a-f0-9]{20}$"
                },
                "description": "本次求解所命中的 POST /v1/warm 预热任务追踪 ID 列表（未命中时为空数组）"
              },
              "server": {
                "type": "string",
                "description": "处理本次请求的服务器节点标识"
              }
            }
          },
          "quota": {
            "type": "object",
            "properties": {
              "used": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "total_used": {
                "type": "integer"
              },
              "total_limit": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Table": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "seats",
              "stack_bb",
              "rake"
            ],
            "description": "简写牌桌：自动按标准翻前行动顺序展开 seats（2-9 人，开启 straddle 时 STR 在最后），所有座位默认使用 stack_bb，可通过 stacks_bb 覆写单个座位。",
            "properties": {
              "seats": {
                "type": "integer",
                "minimum": 2,
                "maximum": 9
              },
              "stack_bb": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "所有座位的默认初始筹码（单位：bb）"
              },
              "stacks_bb": {
                "type": "object",
                "additionalProperties": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "description": "可选的按座位筹码覆写，例如 {\"BTN\": 80}"
              },
              "rake": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "pct"
                ],
                "properties": {
                  "pct": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 10
                  },
                  "cap_bb": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0
                  }
                },
                "description": "抽水设置；null 表示无抽水"
              },
              "ante_bb": {
                "type": "number",
                "minimum": 0,
                "default": 0,
                "description": "每人前注（单位：bb）"
              },
              "straddle": {
                "type": "boolean",
                "default": false,
                "description": "STR 座位执行 2 bb 抓头（Straddle）"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "max_seats",
              "seats",
              "rake"
            ],
            "description": "详写牌桌：按翻前行动顺序列出每个座位及其初始筹码 stack_bb。",
            "properties": {
              "max_seats": {
                "type": "integer",
                "minimum": 2,
                "maximum": 9
              },
              "seats": {
                "type": "array",
                "minItems": 2,
                "maxItems": 9,
                "description": "必须恰好包含 max_seats 个元素，按翻前行动顺序排列（首位行动者在前，BB 在最后；开启 straddle 时 STR 在最后）；座位名唯一；单挑为 SB, BB。",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "seat",
                    "stack_bb"
                  ],
                  "properties": {
                    "seat": {
                      "type": "string",
                      "enum": [
                        "UTG",
                        "UTG1",
                        "UTG2",
                        "LJ",
                        "MP",
                        "HJ",
                        "CO",
                        "BTN",
                        "SB",
                        "BB",
                        "STR"
                      ]
                    },
                    "stack_bb": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "description": "本手牌开始时（扣盲注与前注前）的初始筹码"
                    }
                  }
                }
              },
              "rake": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "pct"
                ],
                "properties": {
                  "pct": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 10
                  },
                  "cap_bb": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0
                  }
                },
                "description": "抽水设置；null 表示无抽水"
              },
              "ante_bb": {
                "type": "number",
                "minimum": 0,
                "default": 0,
                "description": "每人前注（单位：bb）"
              },
              "straddle": {
                "type": "boolean",
                "default": false,
                "description": "STR 座位执行 2 bb 抓头（Straddle）"
              }
            }
          }
        ],
        "description": "牌桌配置（简写或详写均可）。服务端会自动决定求解路径（近似匹配时使用图表，否则调用翻前求解器实时求解）。"
      },
      "TraceStep": {
        "type": "object",
        "required": [
          "street",
          "status",
          "ms",
          "warm_id",
          "actions_count"
        ],
        "description": "求解执行追踪中的单条街道执行步骤。",
        "properties": {
          "street": {
            "type": "string",
            "enum": [
              "preflop",
              "flop",
              "turn",
              "river"
            ]
          },
          "board": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[2-9TJQKA][cdhs]$",
              "examples": [
                "Jh"
              ]
            },
            "description": "本条街发出或截至本条街的公共牌（翻前省略）"
          },
          "status": {
            "type": "string",
            "enum": [
              "instant",
              "warmed",
              "cached",
              "solved"
            ],
            "description": "instant（翻前图表直出）、warmed（命中 POST /v1/warm 预热）、cached（命中前序求解缓存）或 solved（实时求解）"
          },
          "ms": {
            "type": "integer",
            "minimum": 0,
            "description": "本条街步骤的服务端实测耗时（ms）"
          },
          "warm_id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^slv_[a-f0-9]{20}$",
            "description": "status 为 warmed 时对应的 POST /v1/warm 追踪 ID，否则为 null"
          },
          "actions_count": {
            "type": "integer",
            "minimum": 0,
            "description": "本条街回放的动作数量"
          }
        }
      },
      "TraceNode": {
        "type": "object",
        "required": [
          "index",
          "street",
          "board",
          "pot_bb",
          "to_act",
          "closed_street",
          "trigger",
          "is_target",
          "warm"
        ],
        "description": "求解追踪中按时间顺序排列的单个游戏状态节点（发牌、玩家动作或目标决策点）。",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0
          },
          "street": {
            "type": "string",
            "enum": [
              "preflop",
              "flop",
              "turn",
              "river"
            ]
          },
          "board": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[2-9TJQKA][cdhs]$",
              "examples": [
                "Jh"
              ]
            }
          },
          "pot_bb": {
            "type": "number"
          },
          "to_act": {
            "type": [
              "string",
              "null"
            ],
            "description": "该状态下的下一个行动座位；街道已闭合（closed_street=true）时为 null"
          },
          "closed_street": {
            "type": "boolean"
          },
          "trigger": {
            "type": "string",
            "description": "可读状态转换标签，例如 \"Deal flop Jh 9s 4d\" 或 \"BB check\""
          },
          "is_target": {
            "type": "boolean",
            "description": "若为 POST /v1/solve 所回答的目标决策点则为 true"
          },
          "our_solve": {
            "type": [
              "object",
              "boolean",
              "null"
            ],
            "description": "当本密钥曾在此状态节点调用过 POST /v1/solve 时返回（用于标注手牌路径上的历史与目标求解）。",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^slv_[a-f0-9]{20}$"
              },
              "server_ms": {
                "type": "integer",
                "minimum": 0
              },
              "solve_ms": {
                "type": "integer",
                "minimum": 0
              },
              "step_status": {
                "type": "string",
                "enum": [
                  "instant",
                  "warmed",
                  "cached",
                  "solved"
                ]
              },
              "warm_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^slv_[a-f0-9]{20}$"
                }
              }
            }
          },
          "warm": {
            "type": "object",
            "required": [
              "sent",
              "id",
              "status"
            ],
            "properties": {
              "sent": {
                "type": "boolean",
                "description": "本密钥是否在此精确状态前缀发送过 POST /v1/warm"
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^slv_[a-f0-9]{20}$"
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "warming",
                  "ready",
                  "skipped",
                  null
                ]
              },
              "reason": {
                "type": "string",
                "enum": [
                  "quota",
                  "warm_cap",
                  "busy"
                ]
              },
              "ms": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "request": {
                "$ref": "#/components/schemas/SolveRequest"
              },
              "response": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "sent 为 true 时记录的 POST /v1/warm 202 Accepted 响应体"
              }
            }
          },
          "solve": {
            "type": "object",
            "required": [
              "step_status",
              "ms",
              "warm_id"
            ],
            "properties": {
              "step_status": {
                "type": "string",
                "enum": [
                  "instant",
                  "warmed",
                  "cached",
                  "solved"
                ]
              },
              "ms": {
                "type": "integer",
                "minimum": 0
              },
              "warm_id": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^slv_[a-f0-9]{20}$"
              }
            }
          }
        }
      },
      "SolveTraceNode": {
        "type": "object",
        "required": [
          "id",
          "index",
          "street",
          "board",
          "pot_bb",
          "to_act",
          "player_ranges"
        ],
        "description": "GET /v1/solves/{id}/nodes/{index} 返回的 169 牌型类别策略与各座位到达范围（保留 24 小时，仅限本密钥，不消耗配额）。",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^slv_[a-f0-9]{20}$"
          },
          "index": {
            "type": "integer",
            "minimum": 0
          },
          "street": {
            "type": "string",
            "enum": [
              "preflop",
              "flop",
              "turn",
              "river"
            ]
          },
          "board": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[2-9TJQKA][cdhs]$",
              "examples": [
                "Jh"
              ]
            }
          },
          "pot_bb": {
            "type": "number"
          },
          "to_act": {
            "type": [
              "string",
              "null"
            ]
          },
          "closed_street": {
            "type": "boolean"
          },
          "ev_bb": {
            "type": [
              "number",
              "null"
            ]
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "type",
                "frequency"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "fold",
                    "check",
                    "call",
                    "bet",
                    "raise",
                    "all_in"
                  ]
                },
                "to_bb": {
                  "type": "number"
                },
                "frequency": {
                  "type": "number"
                },
                "ev_bb": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          },
          "hand_classes": {
            "type": [
              "object",
              "null"
            ],
            "description": "当前行动玩家（to_act）的 169 牌型类别策略映射（已闭合街道为 null）",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "combos": {
                  "type": "integer"
                },
                "weight": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ev_bb": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "strategy": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "player_ranges": {
            "type": "object",
            "description": "各存活座位的 169 牌型类别到达范围，按座位名索引（如 BB、BTN 或 SB/BB/BTN）。",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "oneOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "object",
                    "properties": {
                      "combos": {
                        "type": "integer"
                      },
                      "weight": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      },
      "SolveTrace": {
        "type": "object",
        "required": [
          "id",
          "created_at",
          "mode",
          "street",
          "players",
          "to_act",
          "pot_bb",
          "to_call_bb",
          "steps",
          "timing"
        ],
        "description": "GET /v1/solves/{id}/trace 返回的完整执行链路追踪（保留 24 小时，仅限本密钥）。",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^slv_[a-f0-9]{20}$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "mode": {
            "type": "string",
            "enum": [
              "hand",
              "ranges"
            ]
          },
          "street": {
            "type": "string",
            "enum": [
              "preflop",
              "flop",
              "turn",
              "river"
            ]
          },
          "board": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[2-9TJQKA][cdhs]$",
              "examples": [
                "Jh"
              ]
            }
          },
          "positions": {
            "type": "object",
            "properties": {
              "oop": {
                "type": "string"
              },
              "ip": {
                "type": "string"
              },
              "order": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "players": {
            "type": "integer",
            "minimum": 2
          },
          "to_act": {
            "type": "string"
          },
          "pot_bb": {
            "type": "number"
          },
          "to_call_bb": {
            "type": "number"
          },
          "ev_bb": {
            "type": [
              "number",
              "null"
            ],
            "description": "目标决策点行动玩家的范围期望值（bb；3 人底池为 null）"
          },
          "request": {
            "$ref": "#/components/schemas/SolveRequest"
          },
          "actions": {
            "type": "array",
            "description": "目标决策点求解得到的 GTO 动作列表",
            "items": {
              "type": "object",
              "required": [
                "label",
                "type",
                "frequency"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "fold",
                    "check",
                    "call",
                    "bet",
                    "raise",
                    "all_in"
                  ]
                },
                "to_bb": {
                  "type": "number"
                },
                "frequency": {
                  "type": "number"
                },
                "ev_bb": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          },
          "hole_cards": {
            "$ref": "#/components/schemas/HoleCardsAnswer"
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceNode"
            },
            "description": "从发牌到目标决策点的完整时间序状态节点，附带逐节点 POST /v1/warm 遥测信息"
          },
          "input_ranges": {
            "type": "object",
            "description": "仅翻后追踪返回（2 人与 3 人底池）：各座位初始范围来源。",
            "additionalProperties": {
              "type": "object",
              "required": [
                "source",
                "warmed",
                "warm_id"
              ],
              "properties": {
                "source": {
                  "type": "string",
                  "enum": [
                    "preflop",
                    "flop",
                    "turn",
                    "custom"
                  ]
                },
                "warmed": {
                  "type": "boolean"
                },
                "warm_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^slv_[a-f0-9]{20}$"
                }
              }
            }
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceStep"
            },
            "description": "按街道顺序排列的执行步骤（1 至 4 步）"
          },
          "timing": {
            "type": "object",
            "properties": {
              "server_ms": {
                "type": "integer"
              },
              "solve_ms": {
                "type": "integer"
              },
              "warm_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^slv_[a-f0-9]{20}$"
                }
              },
              "server": {
                "type": "string"
              }
            }
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "key": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "prefix": {
                "type": "string"
              },
              "tier": {
                "type": "string",
                "enum": [
                  "free",
                  "trial",
                  "builder",
                  "pro",
                  "business"
                ]
              },
              "tier_label": {
                "type": "string"
              },
              "source": {
                "type": "string"
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "per_day": {
                "type": "integer"
              },
              "per_min": {
                "type": "integer"
              },
              "concurrency": {
                "type": "integer"
              },
              "batch_max_items": {
                "type": "integer"
              },
              "webhooks": {
                "type": "boolean"
              },
              "total_cap": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "today": {
                "type": "object",
                "properties": {
                  "used": {
                    "type": "integer"
                  },
                  "limit": {
                    "type": "integer"
                  },
                  "resets_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "total": {
                "type": "object",
                "properties": {
                  "used": {
                    "type": "integer"
                  },
                  "limit": {
                    "type": "integer"
                  }
                }
              },
              "days": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "day": {
                      "type": "string",
                      "format": "date"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "by_street": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "billing": {
            "type": "object",
            "properties": {
              "managed": {
                "type": "boolean"
              }
            }
          },
          "webhook_secret": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "path"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "invalid_range",
                  "unknown_field",
                  "invalid_json",
                  "invalid_poker_state",
                  "unauthorized",
                  "body_too_large",
                  "line_not_in_tree",
                  "line_over",
                  "unsolvable",
                  "preflop_open",
                  "street_open",
                  "unsupported_table",
                  "multiway",
                  "rate_limited",
                  "quota_exceeded",
                  "busy",
                  "timeout",
                  "not_ready",
                  "method_not_allowed",
                  "internal",
                  "forbidden",
                  "not_found"
                ]
              },
              "message": {
                "type": "string",
                "description": "错误原因说明与修复建议"
              },
              "path": {
                "type": "string",
                "description": "指向出错字段的 JSON Pointer（例如 \"/streets/preflop/2/to_bb\"），整体请求体错误时为 \"\"",
                "examples": [
                  "/streets/preflop/2/to_bb"
                ]
              }
            }
          }
        }
      }
    }
  }
}