获取 Agent 对话积分消耗列表
获取 Agent 对话积分消耗列表
可以通过该接口,获取指定 Agent 在时间范围内的对话积分消耗明细,按 conversationId 聚合,最多返回30天内数据。
请求方式
GET
调用地址
https://api.gptbots.ai/v1/account/agent/conversation/credits
调用鉴权
详情参见 API 概述 的鉴权方式说明。
请求
请求示例
curl -X GET 'https://api.gptbots.ai/v1/account/agent/conversation/credits?start_time=1774837924000&end_time=1775183447000&page=1&page_size=20' \
-H 'Authorization: Bearer your_apikey'
curl -X GET 'https://api.gptbots.ai/v1/account/agent/conversation/credits?start_time=1774837924000&end_time=1775183447000&page=1&page_size=20' \
-H 'Authorization: Bearer your_apikey'
此代碼塊在浮窗中顯示
请求头
| 字段 | 类型 | 描述 |
|---|---|---|
| Authorization | Bearer ${token} | 使用 Authorization: Bearer ${token}进行调用鉴权,请在 API 密钥页面获取密钥作为 token。 |
请求参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| start_time | long | 是 | 查询开始时间,毫秒时间戳。 |
| end_time | long | 是 | 查询结束时间,毫秒时间戳。start_time 与 end_time 间隔不能超过30天。 |
| page | int | 否 | 页码,默认为 1。 |
| page_size | int | 否 | 每页条数,默认为 20,最大为 100。 |
响应
响应示例
{
"list": [
{
"conversation_id": "6830a1f2e4b0f1a2b3c4d5e6",
"conversation_create_time": 1774838000000,
"chat": 1.50,
"anonymization": 0,
"asr": 0,
"tts": 0,
"rerank": 0.30,
"database_processing": 0,
"tool_call": 0.20,
"knowledge_doc_indexing": 0,
"question_tag": 0,
"moderation": 0.01,
"total": 2.0
}
],
"total": 1,
"page": 1,
"page_size": 20,
"start_time": 1774837924000,
"end_time": 1775183447000
}
{
"list": [
{
"conversation_id": "6830a1f2e4b0f1a2b3c4d5e6",
"conversation_create_time": 1774838000000,
"chat": 1.50,
"anonymization": 0,
"asr": 0,
"tts": 0,
"rerank": 0.30,
"database_processing": 0,
"tool_call": 0.20,
"knowledge_doc_indexing": 0,
"question_tag": 0,
"moderation": 0.01,
"total": 2.0
}
],
"total": 1,
"page": 1,
"page_size": 20,
"start_time": 1774837924000,
"end_time": 1775183447000
}
此代碼塊在浮窗中顯示
成功响应
| 字段 | 类型 | 描述 |
|---|---|---|
| list | list | 积分消耗明细列表。 |
| conversation_id | string | 会话 ID。 |
| conversation_create_time | long | 会话创建时间(毫秒时间戳),会话记录已删除时为 null。 |
| chat | decimal | 对话(LLM chat)积分消耗。 |
| anonymization | decimal | 匿名化积分消耗。 |
| asr | decimal | 语音识别(ASR)积分消耗。 |
| tts | decimal | 文字转语音(TTS)积分消耗。 |
| rerank | decimal | 向量重排积分消耗。 |
| database_processing | decimal | 数据库处理积分消耗。 |
| tool_call | decimal | 工具调用积分消耗。 |
| knowledge_doc_indexing | decimal | 知识库索引积分消耗。 |
| question_tag | decimal | 问题打标积分消耗。 |
| moderation | decimal | 内容审查消耗积分。 |
| total | decimal | 该会话的汇总积分消耗。 |
| total | long | 符合条件的会话总数(用于分页)。 |
| page | int | 当前页码。 |
| page_size | int | 每页条数。 |
| start_time | long | 查询开始时间。 |
| end_time | long | 查询结束时间。 |
失败响应
| 字段 | 类型 | 描述 |
|---|---|---|
| code | int | 错误码。 |
| message | string | 错误描述信息。 |
错误码
| Code | Message |
|---|---|
| 40000 | 参数错误 |
| 40001 | 时间范围不合法(超过30天) |
| 50000 | 系统内部错误 |
