取得 Workflow 執行點數消耗列表
取得 Workflow 執行點數消耗列表
可以透過該接口,獲取指定 Workflow 在時間範圍內的運行點數消耗明細,按 runId 聚合,最多返回30天內數據。
請求方式
GET
調用地址
https://api.gptbots.ai/v1/account/workflow/run/credits
調用鑑權
詳情參見 API 概述 的鑑權方式說明。
調用頻率
本接口計入組織套餐「統計類 API」的每分鐘額度,與其它統計類接口(包括組織級統計接口)共用該額度,超過時返回 40008。
請求
請求示例
curl -X GET 'https://api.gptbots.ai/v1/account/workflow/run/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/workflow/run/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。 |
| run_id | string | 否 | Workflow 執行 ID。 |
回應
回應範例
{
"list": [
{
"run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"run_start_time": 1774838000000,
"chat": 2.10,
"anonymization": 0,
"asr": 0.50,
"tts": 0,
"rerank": 0.30,
"database_processing": 0,
"tool_call": 0.80,
"knowledge_doc_indexing": 0,
"question_tag": 0,
"total": 3.70
}
],
"total": 1,
"page": 1,
"page_size": 20,
"start_time": 1774837924000,
"end_time": 1775183447000
}
{
"list": [
{
"run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"run_start_time": 1774838000000,
"chat": 2.10,
"anonymization": 0,
"asr": 0.50,
"tts": 0,
"rerank": 0.30,
"database_processing": 0,
"tool_call": 0.80,
"knowledge_doc_indexing": 0,
"question_tag": 0,
"total": 3.70
}
],
"total": 1,
"page": 1,
"page_size": 20,
"start_time": 1774837924000,
"end_time": 1775183447000
}
此代碼塊在浮窗中顯示
成功響應
| 字段 | 類型 | 描述 |
|---|---|---|
| list | list | 點數消耗明細列表。 |
| run_id | string | Workflow 運行 ID。 |
| run_start_time | long | Workflow 運行開始時間(毫秒時間戳),運行記錄已刪除時為 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 | 問題打標點數消耗。 |
| 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 | 系統內部錯誤 |
