取得 Agent 對話點數消耗列表
取得 Agent 對話點數消耗列表
可以通過該接口,獲取指定 Agent 在時間範圍內的對話點數消耗明細,按 conversationId 聚合,最多返回30天內數據。
請求方式
GET
調用地址
https://api.gptbots.ai/v1/account/agent/conversation/credits
調用鑑權
詳情參見 API 概述 的鑑權方式說明。
調用頻率
本接口計入組織套餐「統計類 API」的每分鐘額度,與其它統計類接口(包括組織級統計接口)共用該額度,超過時返回 40008。
請求
請求示例
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。 |
| conversation_id | string | 否 | 對話 ID。 |
回應
回應範例
{
"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 | 系統內部錯誤 |
