Get Total Credit Consumption
Get Total Credit Consumption
Retrieve the total credits consumed by the Agent within a specified time range.
Note: Data can be queried for a maximum range of 365 days.
Request Method
GET
Request URL
https://api-${endpoint}.gptbots.ai/v1/account/bill/total
Request Authentication
See Overview for authentication details.
Request
Request Example
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/account/bill/total?start_time=1732982400000&end_time=1735660799999' \
-H 'Authorization: Bearer ${API Key}' \
                    
                      
                      curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/account/bill/total?start_time=1732982400000&end_time=1735660799999' \
-H 'Authorization: Bearer ${API Key}' \
                    
                    Este bloque de código en una ventana flotante
                Request Header
| Field | Type | Description | 
|---|---|---|
| Authorization | Bearer ${token} | Use Authorization: Bearer ${token}for authentication. Get the key from the API Keys page as token. | 
Request Parameters
| Field | Type | Required | Description | 
|---|---|---|---|
| start_time | String | Yes | Start time. | 
| end_time | String | Yes | End time. | 
Response
Response Example
{
    "start_date": "2022-02-02",
    "end_date": "2022-02-03",
    "total": 100.0000,
    "chat": 10.0000,
    "knowledge_doc_indexing": 10.0000,
    "knowledge_doc_storage": 10.0000,
    "rerank": 10.0000,
    "database_processing": 10.0000,
    "tool_call": 10.0000,
    "asr": 10.0000,
    "tts": 10.0000
}
                    
                      
                      {
    "start_date": "2022-02-02",
    "end_date": "2022-02-03",
    "total": 100.0000,
    "chat": 10.0000,
    "knowledge_doc_indexing": 10.0000,
    "knowledge_doc_storage": 10.0000,
    "rerank": 10.0000,
    "database_processing": 10.0000,
    "tool_call": 10.0000,
    "asr": 10.0000,
    "tts": 10.0000
}
                    
                    Este bloque de código en una ventana flotante
                Success Response
| Field | Type | Description | 
|---|---|---|
| start_date | String | Start date. | 
| end_date | String | End date. | 
| total | Number | Total credits. | 
| chat | Number | Credits consumed in text conversations. | 
| knowledge_doc_indexing | Number | Credits consumed for knowledge document indexing. | 
| knowledge_doc_storage | Number | Credits consumed for knowledge document storage. | 
| rerank | Number | Credits consumed for reranking. | 
| database_processing | Number | Credits consumed for database processing. | 
| tool_call | Number | Credits consumed for tool calls. | 
| asr | Number | Credits consumed for speech-to-text. | 
| tts | Number | Credits consumed for text-to-speech. | 
Failure Response
| Field | Type | Description | 
|---|---|---|
| code | Int | Error code. | 
| message | String | Error details. | 
