GET /sessions
列出 Cell 内的会话列表。
GET /cells/{cellID}/sessions
查询参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
limit | integer | 否 | 20 | 每页返回条数,范围 1–100 |
cursor | string | 否 | — | 分页游标,取自上一页响应的 next_cursor |
before | string | 否 | — | RFC 3339 时间戳,只返回此时间之前创建的会话 |
actor | string | 否 | — | 按 Actor 过滤(仅 Admin Token 生效;非 Admin 一律取 Token 中的 Actor) |
curl 示例
curl -s "http://localhost:9091/cells/dept-legal/sessions?limit=10" \
-H "Authorization: Bearer $TOKEN" | jq .
翻页:
curl -s "http://localhost:9091/cells/dept-legal/sessions?limit=10&cursor=eyJpZCI6InNlcy1lNWY2ZzdoOCJ9" \
-H "Authorization: Bearer $TOKEN" | jq .
响应
200 OK
{
"sessions": [
{
"id": "ses-a1b2c3d4",
"title": "合同条款审查",
"created_at": "2026-09-20T10:30:00Z",
"updated_at": "2026-09-20T11:15:00Z",
"message_count": 24,
"actor": "user-zhangsan"
},
{
"id": "ses-e5f6g7h8",
"title": "判例检索",
"created_at": "2026-09-19T08:00:00Z",
"updated_at": "2026-09-19T09:45:00Z",
"message_count": 12,
"actor": "user-zhangsan"
}
],
"next_cursor": "eyJpZCI6InNlcy1lNWY2ZzdoOCJ9",
"has_more": true
}
会话对象字段说明:
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 会话唯一标识 |
title | string | 会话标题(可能为空) |
created_at | string | 创建时间(RFC 3339) |
updated_at | string | 最后更新时间(RFC 3339) |
message_count | integer | 消息总数 |
actor | string | 会话归属的 Actor |
错误码
| HTTP | 错误 | 说明 |
|---|---|---|
| 401 | — | 未认证或 Token 无效 |
| 403 | — | Token 权限不足(scope 不匹配) |
| 404 | — | Cell 不存在 |
| 503 | — | Cell 处于 Cold 状态,正在唤醒,请稍后重试(响应含 Retry-After 头) |
相关端点
- GET /sessions/{sid}/messages — 获取会话消息
- DELETE /sessions/{sid} — 删除会话
- POST /sessions/{sid}/interrupt — 中断 Run