logo
Development
検索
Get Agent Conversation Credit Consumption List

Get Agent Conversation Credit Consumption List

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

Request Method

GET

Request URL

https://api.gptbots.ai/v1/account/agent/conversation/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/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'

                    
このコードブロックをポップアップで表示

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.
conversation_id string No Conversation ID.

Response

Response Example

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

                    
このコードブロックをポップアップで表示

Success Response

Field Type Description
list list List of credit consumption details.
conversation_id string Conversation ID.
conversation_create_time long Conversation creation time (millisecond timestamp), null if the conversation 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.
moderation decimal Credit consumption for content moderation.
total decimal Summary of credit consumption for this conversation.
total long Total number of conversations 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