一、接口介绍
·统计作用域:team_id / user_id / agent_id 三个身份维度确定统计范围。
·过滤条件:session_id / time_start / time_end 语义与 /v3/conversation/query 完全一致。
二、Method 与 URL
POST https://memory.tdai.tencentyun.com/v3/conversation/count
三、使用示例
curl -i -k -X POST \\ -H 'Content-Type: application/json' \\ -H 'Authorization: Bearer *********************************' \\ -H "x-tdai-service-id: tdai-mem-xxxxxxxx" \\ https://memory.tdai.tencentyun.com/v3/conversation/count \\ -d '{ "team_id":"team-abc123", "user_id":"usr-456", "agent_id":"agt-xyz789" }'
注意:鉴权说明:
注意:所有接口都必须在请求头中携带 Authorization: Bearer <API Key> 与 x-tdai-service-id: <实例 ID>,否则将返回鉴权失败。
四、请求参数
| 参数 | 是否必选 | 参数含义 | 配置方法及要求 |
| team_id | 是 | 团队 ID。 | 数据类型:String。 |
| user_id | 是 | 用户 ID。 | 数据类型:String。 |
| agent_id | 是 | Agent ID(全局唯一)。 | 数据类型:String。 |
| session_id | 否 | 会话 ID,用于限定统计范围。 | 数据类型:String。不传则统计所有 session。 |
| task_id | 否 | Task ID。 | 数据类型:String。 |
| time_start | 否 | 统计起始时间。 | 数据类型:String。格式:ISO 8601(例如 2026-07-01T00:00:00Z)。 |
| time_end | 否 | 统计截止时间。 | 数据类型:String。格式:ISO 8601(例如 2026-07-31T23:59:59Z)。 |
五、响应示例
{ "code":0, "message":"ok", "request_id":"req-7fd3b2dd", "data":{ "total":128 }}
六、响应参数说明
| 参数名(一级) | 参数名(二级) | 参数含义 |
| data | total | 满足条件的消息总数。 |