- 文档首页
TRAE CN
用量管理
按会话 ID 查询用量明细
按会话 ID 查询用量明细
按会话 ID 查询指定会话的用量明细。每条明细附带用量发生时成员的直属部门。
statistics:read
- 请求地址:{域名}/openapi/v1/statistics/session_usage_detail
- 本接口返回与指定 Session ID 匹配的 TRAE 内置模型和企业自定义模型的用量明细。模型来源以响应中的 model_source 字段为准。
- 单次请求最多支持传入 100 个 Session ID。系统会自动去除重复的 Session ID。
请求参数
请求头参数
该接口独有的响应参数如下,参数位于 data 数组中。通用响应参数参考此文档。
示例
curl -X POST "${HOST}/openapi/v1/statistics/session_usage_detail" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
"6a43b324xxxxd71ed71f9e19"
"request_id": "req_xxx",
"start_time": 1780012345,
"email": "alice@example.com",
"model_name": "model-a",
"session_id": "6a43b324xxxxd71ed71f9e19",
"completion_tokens": 2000,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 1000
"total_cost": "0.800000",
"total_cost_currency": "CNY",
"consumption_source": "mixed",
"department_id": "20001",
"full_path": "示例企业/研发一部"
错误码
若该接口的请求返回错误码,参考错误码文档进行排查。
最近更新时间:2026.10.12 17:54:06