GET
/v1/sessions/{session_id}查询会话状态
查询牌局进度、机器人列表与情绪上下文、胜率观测值及本会话用量。
/v1/sessions/{session_id}查询牌局进度、机器人列表与情绪上下文、胜率观测值及本会话用量。
返回单个会话的完整运行时状态:牌局进度(当前局数与阶段)、座位填充状态、机器人列表(含人格与情绪快照)、胜率策略与观测值、本会话用量统计。适用于断线恢复时重建界面、运营看板巡检与对账。
会话保留 72 小时:结束后仍可查询,超时自动归档,归档后本接口返回 404 session_not_found。高频轮询建议改用 WebSocket 流的状态帧或 Webhook 回调,避免占用限流窗口。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| session_id | string | 是 | 创建会话时返回的会话 id,如 sess_9f2ek4m1 |
| fields | string | 否 | 逗号分隔的字段过滤:robots|usage|win_rate|emotion,缺省返回全部 |
| Include-RateLimit | header | 否 | true 时响应头额外携带该 Key 的实时限流三件套 |
curl "https://api.zhenren.com.cn/v1/sessions/sess_9f2ek4m1?fields=robots,usage" \
-H "Authorization: Bearer sk_live_xxxxxxxx"{
"session_id": "sess_9f2ek4m1",
"game": "scmj",
"status": "running", // running|yielding|ended|archived
"hand_no": 7, // 当前局数
"phase": "playing", // dealing|playing|settling
"fill_mode": "dynamic",
"seats": [
{ "seat": 0, "type": "human" },
{ "seat": 1, "type": "robot" },
{ "seat": 2, "type": "human_joining" } // 真人进房中,对应机器人进入让位流程
],
"robots": [
{ "id": "bot_a7c3", "seat": 1, "persona": "steady", "difficulty": "human-like",
"emotion": { "mood": "neutral", "tilt_score": 0.12 } },
{ "id": "bot_b1d9", "seat": 2, "persona": "aggressive", "difficulty": "human-like",
"emotion": { "mood": "tilted", "tilt_score": 0.61 }, "status": "yielding" }
],
"win_rate": { "target_range": [0.45, 0.55], "hard_cap": 0.58, "observed": 0.51 },
"usage": { "hands": 6, "events_pushed": 483, "decisions_returned": 461, "robot_yields": 1 },
"created_at": "2026-10-02T09:30:12Z",
"expires_at": "2026-10-05T09:30:12Z" // 保留 72 小时,超时归档
}30 天全功能免费试用,5 分钟接入首个AI牌局。开通试用请添加商务微信 kxlin0101 或发送邮件至 skyin.lewis@gmail.com。