Billing Question
# support
d
From the billing page user interface, will I be able to know yesterday's usage and last month usage? If so, can you please let me know how to do it.
a
HeyDhina Thank you for creating the ticket! A member of our team will reach out to you shortly.
v
@Dhina Absolutely! On the billing page of the user interface, you should be able to view your past usage, including yesterday's and last month's usage. Here's how you can do it: 1. Log in to your VAPI dashboard. 2. Navigate to the 'Billing' section. 3. Look for the usage reports or history area. There should be options to view your usage by different time frames. 4. Select the time frame for 'Yesterday' to view the previous day's usage. 5. To view last month's usage, select the time frame for 'Last Month'. These options will provide you with detailed insights into your usage for the specified periods. If you encounter any issues or cannot find these options, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
d
Where is the usage reports or history area located
s
@Dhina You can use analytics API to calculate the yesterday and last month usage. [1] date billing
curl_request
Copy code
curl --location 'https://api.vapi.ai/analytics' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data '{
    "queries": [
        {
            "name": "getAnalyticsByAssistantID",
            "table": "call",
            "timeRange": {
                "start": "2025-01-29T00:00:00Z",
                "end": "2025-01-29T23:59:59Z",
                "step": "day"
            },
            "operations": [
                {
                    "operation": "sum",
                    "column": "cost"
                }
            ]
            
        }
    ]
}'
example_response
Copy code
json
[{"name":"getAnalyticsByAssistantID","timeRange":{"start":"2025-01-29T00:00:00.000Z","end":"2025-01-29T23:59:59.000Z","step":"day","timezone":"UTC"},"result":[{"date":"2025-01-29T00:00:00.000Z","sumCost":0.0226}]}]
** [2] Monthly Billing**
Copy code
curl --location 'https://api.vapi.ai/analytics' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data '{
    "queries": [
        {
            "name": "getAnalyticsByAssistantID",
            "table": "call",
            "timeRange": {
                "start": "2025-01-01T00:00:00Z",
                "end": "2025-01-31T23:59:59Z",
                "step": "month"
            },
            "operations": [
                {
                    "operation": "sum",
                    "column": "cost"
                }
            ]
            
        }
    ]
}'
example_response
Copy code
json
[{"name":"getAnalyticsByAssistantID","timeRange":{"start":"2025-01-01T00:00:00.000Z","end":"2025-01-31T23:59:59.000Z","step":"month","timezone":"UTC"},"result":[{"date":"2025-01-01T00:00:00.000Z","sumCost":8.444260000000003}]}]
Do let me know if you require further help!!
d
Thanks