logo
Développement
Rechercher
Get Workflow Run Credit Consumption List

Get Workflow Run Credit Consumption List

Through this interface, you can obtain the detailed run credit consumption of a specified Workflow within a time range, aggregated by runId, returning data within the last 30 days.

Request Method

GET

Request URL

https://api.gptbots.ai/v1/account/workflow/run/credits

Authentication

For details, please refer to the authentication instructions in API Overview.

Request

Request Example

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'

                    
Ce bloc de code dans la fenêtre flottante

Request Headers

Field Type Description
Authorization Bearer ${token} Use Authorization: Bearer ${token} for authentication. Obtain the key as the token on the API Key page.

Request Parameters

Field Type Required Description
start_time long Yes Query start time, millisecond timestamp.
end_time long Yes Query end time, millisecond timestamp. The interval between start_time and end_time cannot exceed 30 days.
page int No Page number, default is 1.
page_size int No Number of items per page, default is 20, maximum is 100.
run_id string No Workflow Run ID.

Response

Response Example

{ "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
}

                    
Ce bloc de code dans la fenêtre flottante

Success Response

Field Type Description
list list List of credit consumption details.
run_id string Workflow Run ID.
run_start_time long Workflow run start time (millisecond timestamp), null if the run record has been deleted.
chat decimal Credit consumption for conversation (LLM chat).
anonymization decimal Credit consumption for anonymization.
asr decimal Credit consumption for speech recognition (ASR).
tts decimal Credit consumption for text-to-speech (TTS).
rerank decimal Credit consumption for vector reranking.
database_processing decimal Credit consumption for database processing.
tool_call decimal Credit consumption for tool calling.
knowledge_doc_indexing decimal Credit consumption for knowledge base indexing.
question_tag decimal Credit consumption for question tagging.
total decimal Summary of credit consumption for this run.
total long Total number of runs matching the criteria (for pagination).
page int Current page number.
page_size int Number of items per page.
start_time long Query start time.
end_time long Query end time.

Failure Response

Field Type Description
code int Error code.
message string Error description message.

Error Codes

Code Message
40000 Parameter error
40001 Invalid time range (exceeds 30 days)
50000 Internal system error