Rishabh
03/30/2025, 1:16 PMVapi Support Bot
03/30/2025, 1:17 PM/analytics
endpoint to get detailed cost information. Here's an example for checking daily call costs:
bash
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"
}
]
}
]
}'
The response will look something like:
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. Get Call API
You can also get cost information for a specific call using the [Get Call API endpoint](https://docs.vapi.ai/api-reference/calls/get-call), which returns properties like cost
and costBreakdown
.
## 3. End-of-Call-Report Webhook
If you prefer a webhook approach, Vapi provides an ["end-of-call-report" webhook](https://docs.vapi.ai/server-url/events#end-of-call-report) that includes the cost of each call.
Is there a specific aspect of call usage or cost tracking you're interested in learning more about?
Sources:
- [Analytics API Endpoint](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1337948247678914610)Vapi Support Bot
03/30/2025, 1:17 PMKyle
03/31/2025, 9:27 AM