How do get other data in end-of-call-report?
# support
e
Vapi's end-of-call-report is only sending the basic fields to my webhook.
Copy code
{
  "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-741481619974
v
To access
costs.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:
Copy code
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)
e
Can you describe what I should do step-by-step please? I start a call with vapi.start, with a dynamic assistant, and **server.url **and serverMessages with end-call-reporting How do I get all those costs and tokens reported at the end of a call?
@Shubham Bajaj any help much appreciated!
c
Hi Ethan Tan, To include more data in the end-of-call report, you can leverage the details available in the
ServerMessageEndOfCallReport
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):
Copy code
{  "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.
2 Views