跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.mirobody.ai/llms.txt

Use this file to discover all available pages before exploring further.

/api/chat 在不传 session_id 时会自动建会话。如果客户端需要先拿到 id(如先展示对话草稿卡片),可调本接口。

端点

POST /api/session
Authorization: Bearer <access_token>
Content-Type: application/json
{ "session_id": "<可选,客户端自定>", "query_user_id": "<可选>" }

响应

{
  "code": 0, "msg": "ok",
  "data": {
    "session_id":  "91695b3e-6249-...",
    "created_at": "2026-05-22T06:23:00"
  }
}

命名惯例

  • 普通对话:客户端自生 UUID,或从 /api/chat 首条 id 事件取 web_<uuid>
  • 日记:服务端自动生成 today_<uid>_<yyyy>_<mm>_<dd>_<ts>
  • 多面板对比(CDM):cdm_p<pane>_<uid>_<agent>_<random>
session_id 完全由客户端控制,没有全局命名空间限制。