Ethan Tan
09/11/2025, 1:25 PM{
"message": {
"timestamp": 1757596207237,
"type": "end-of-call-report",
"analysis": {
"summary": "A string containing a human-readable, AI-generated summary of the call's events.",
"successEvaluation": "A string containing a transcript snippet or an evaluation of the interaction."
},
"artifact": {
"messages": [
{
"role": "system",
"message": "A very long string that acts as the AI's configuration prompt. It includes details on:\n- Persona and Qualities (<YOUR_QUALITIES>)\n- Fundamental Stance and Principles\n- Coaching Methodologies (## STAGES OF TRANSFORMATION)\n- Guiding Goals (<YOUR_NORTH_STARS>)\n- Knowledge Base (<TRANSFORMATIVE_PRACTICES>)\n- Conversation Flow (<PHASES_OF_COACHING>)\n- Detailed Client Profile (<CLIENT_PROFILE>)"
}
]
}
}
}
How do I get costs.ModelCost.promptTokens etc?
Call ID:
1d9aae13-c937-452f-8876-741481619974Vapi Support Bot
09/11/2025, 1:26 PMcosts.ModelCost.promptTokens in the end-of-call-report, ensure you are extracting the call object from the webhook payload, as the costs array is part of the call schema. Here’s a code snippet to illustrate:
js
const costs = req.body.message.call?.costs;
const promptTokens = costs?.find(c => c.type === "ModelCost")?.promptTokens;
If the call object is missing from your payload, check your assistant or phone number configuration to ensure the full call object is included in webhook events.
Reference: [End of Call Report docs](https://docs.vapi.ai/server-url/events#end-of-call-report)
Sources:
- [Server Events End of Call Report](https://docs.vapi.ai/server-url/events#end-of-call-report)
- [API Reference Get Call](https://docs.vapi.ai/api-reference/calls/get-call)Ethan Tan
09/11/2025, 1:33 PMEthan Tan
09/11/2025, 4:22 PMChiranjeet Mishra
09/15/2025, 3:17 PMServerMessageEndOfCallReport and update your application to capture the data you need.
For call ended reasons, you may refer to the [Call Ended Reasons documentation](https://docs.vapi.ai/calls/call-ended-reason), which provides a comprehensive list of codes that you might find useful for understanding why a call ended. You can also enrich your reports by capturing structured outputs and other performance metrics as described in the [call metrics updates](https://docs.vapi.ai/changelog/2025/8/9).
when you start a call with a dynamic assistant and server.url with end-call-reporting enabled, you'll receive an "end-of-call-report" message at your server URL when the call ends. Here's what you'll get[1](https://docs.vapi.ai/server-url/events):
{ "message": { "type": "end-of-call-report", "endedReason": "hangup", "call": { /* Call Object */ }, "artifact": { "recording": { /* Recording object with URLs */ }, "transcript": "AI: How can I help? User: What's the weather? ...", "messages": [ { "role": "assistant", "message": "How can I help?" }, { "role": "user", "message": "What's the weather?" } ] } }}
To get this report:
1. Configure your server URL in the assistant or phone number settings
2. Enable end-call-reporting in your server messages configuration
3. The report will automatically be sent to your server URL when the call ends
4. The report includes the complete call transcript, recordings, and conversation history
Feel free to explore those options based on the data points you're interested in capturing.