https://retellai.com/?utm_source=discord&utm_medium=seo logo
- how can i get post call the details about the ca...
# ❓・ai-evy-support
d
@AI Evy - how can i get post call the details about the call, duration and financial details, is there some kind a of a hook? do we need to runn API requests ?
a
Thanks for tagging me @dj.ufk. I'll look through relevant sources and get back to you shortly.
### Answer You can get post-call details including duration and financial information using both webhooks and API requests [(1) ]() . Webhook Approach (Recommended) : Retell AI supports webhook events that automatically push call data to your application . The key events are: - `call_ended`: Triggered when a call completes, containing all fields from the call object except
call_analysis
- `call_analyzed`: Triggered when call analysis is complete, including the full
call_analysis
object The webhook payload includes duration and financial details such as
duration_ms
,
call_cost
with product costs and combined cost [(1) ]() [(2) ]() . API Request Approach: You can also retrieve call details using API requests: 1. Get Call API - Retrieve specific call details [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponse = await client.call.retrieve('call_id_here') ;
2. List Calls API - Get multiple calls with filtering options [(3) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponses = await client.call.list() ;
Both approaches provide access to
call_cost
object containing product costs, total duration, and combined cost [(4) ]() [(3) ]() [(2) ]() . The webhook approach is more efficient as it pushes data automatically when events occur, rather than requiring polling [(1) ]() . Note: There's a known issue where
call_analyzed
webhooks may be sent multiple times for some calls [(5) ]() . If this affects you, consider using the
call_ended
webhook or the Get Call API as alternatives .
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Get Call](https://docs.retellai.com/api-references/get-call) [[3] List Calls](https://docs.retellai.com/api-references/list-calls) [[4] Create Web Call](https://docs.retellai.com/api-references/create-web-call) [[5] 2 call_analysis reports send to webhooks randomly by agent. Call ID: call_d9f31a1ac47a3df614f8244ca6](https://discord.com/channels/1186424376300679209/1425245575598571580) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy - and if i use webhook but my server went down for an hour, will it fill the gap when my server is back on ?
a
Thanks for the follow-up, @dj.ufk. I'll get back to you soon.
### Answer Based on the webhook documentation, Retell AI has a limited retry mechanism but doesn't provide gap-filling functionality when your server is down for extended periods [(1) ]() . Webhook Retry Behavior: Retell AI webhooks have a 10-second timeout and will retry up to 3 times if no success status (2xx) is received . However, this retry mechanism is designed for temporary network issues, not extended server downtime. What happens during server downtime: If your server is down for an hour, webhooks sent during that time will fail after the 3 retry attempts and will be lost . Retell AI doesn't queue webhooks for later delivery or provide a backfill mechanism when your server comes back online. Recommended solution: To handle server downtime gaps, you should use the API approach as a backup:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;

// Retrieve calls from when your server was down
const callResponses = await client.call.list() ;
You can filter calls by timestamp to retrieve only the calls that occurred during your server downtime and process the missed call data . Best practice: Consider implementing both webhooks for real-time processing and periodic API polling as a backup to ensure you don't miss any call data during server outages.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy - in order to use API approach as a b ackup, how can i let it to give me all the calls lin a period ?
a
Thanks for the follow-up, @dj.ufk. I'll get back to you soon.
### Answer To retrieve all calls within a specific period using the API, you can use the List Calls API with filter criteria and time-based filtering [(1) ]() . Basic approach:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponses = await client.call.list() ;
console.log(callResponses) ;
Filtering by time period: The List Calls API supports several filtering options : - `filter_criteria.start_timestamp_gte`: Filter calls that started after or at this timestamp (milliseconds since epoch) - `filter_criteria.start_timestamp_lte`: Filter calls that started before or at this timestamp (milliseconds since epoch) - `filter_criteria.end_timestamp_gte`: Filter calls that ended after or at this timestamp (milliseconds since epoch) - `filter_criteria.end_timestamp_lte`: Filter calls that ended before or at this timestamp (milliseconds since epoch) Sorting and pagination: The API also supports : - `sort_order`: Sort by
start_timestamp
in
ascending
or
descending
order - `limit`: Limit the number of calls returned (default 50, max 1000) - `pagination_key`: Use for fetching additional pages if you have more than 1000 calls This allows you to efficiently retrieve all calls that occurred during your server downtime by specifying the exact time range when your server was offline.
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the feedback, glad I was helpful.
d
@AI Evy - if the price changes in the future? can i get the properties of the agent of how much it should cost me in a minute using API ?
a
Thanks for the follow-up, @dj.ufk. I'll get back to you soon.
### Answer --- Based on the available documentation, I don't see specific API endpoints that provide real-time pricing information for agents or per-minute costs. However, the available call-related APIs do provide cost information after calls are completed [(1) ]() [(2) ]() : Post-call cost information: The call objects returned by the APIs include a
call_cost
object that contains [(1) ]() : - `product_costs`: Array of individual product costs (like TTS services) - `total_duration_seconds`: Total call duration - `total_duration_unit_price`: Price per unit of duration - `combined_cost`: Total cost for the call Example from the Create Phone Call API response:
Copy code
json
"call_cost": {
  "product_costs": [
    {
      "product": "elevenlabs_tts",
      "unit_price": 1,
      "cost": 60
    }
  ],
  "total_duration_seconds": 60,
  "total_duration_unit_price": 1,
  "combined_cost": 70
}
This allows you to calculate the per-minute cost after calls complete, but I don't see API endpoints that provide prospective pricing information for agents before calls are made. For current pricing information and how pricing changes might be communicated, I'd recommend: - Visit [Contact Sales]() - Visit [) Would you like a general answer based on my knowledge instead, or do you have other questions about the call cost data that's available through the APIs?
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] List Calls](https://docs.retellai.com/api-references/list-calls) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy - so after call complete it will show me the llm and voice price of my agent ?
a
Thanks for the follow-up, @dj.ufk. I'll get back to you soon.
### Answer --- Yes, after a call completes, you'll get detailed cost breakdowns including both LLM and voice pricing through the call APIs [(1) ]() [(2) ]() [(3) ]() . What you'll see in the
call_cost
object:
The call response includes a
call_cost
object with detailed pricing information :
Copy code
json
"call_cost": {
  "product_costs": [
    {
      "product": "elevenlabs_tts",
      "unit_price": 1,
      "cost": 60
    }
  ],
  "total_duration_seconds": 60,
  "total_duration_unit_price": 1,
  "combined_cost": 70
}
LLM token usage details: You'll also get LLM-specific usage information in the
llm_token_usage
object :
Copy code
json
"llm_token_usage": {
  "values": [123],
  "average": 123,
  "num_requests": 123
}
How to access this information: You can retrieve this cost data using either: 1. Get Call API for specific calls [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponse = await client.call.retrieve('call_id_here') ;
2. List Calls API for multiple calls [(1) ]() :
Copy code
javascript
const callResponses = await client.call.list() ;
The
product_costs
array will show individual components like TTS services, while
combined_cost
gives you the total cost for that specific call [(1) ]() [(2) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) [[2] Get Call](https://docs.retellai.com/api-references/get-call) [[3] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy - your example is confusing, for example i set an agent with Single Prompt using Gemini 2.5. and the price breakdown is $0.115/min Voice Engine: OpenAI - $0.080 per min LLM - 0.035$ per min should i usee this breakdown when i receive a call information ?
a
Thanks for the follow-up, @dj.ufk. I'll get back to you soon.
### Answer --- You should rely on the actual cost data returned in the call response rather than the pre-estimated breakdown you see in the dashboard [(1) ]() [(2) ]() [(3) ]() . The call APIs return the actual costs incurred for that specific call in the
call_cost
object :
Copy code
javascript
"call_cost": {
  "product_costs": [
    {
      "product": "elevenlabs_tts",
      "unit_price": 1,
      "cost": 60
    }
  ],
  "total_duration_seconds": 60,
  "total_duration_unit_price": 1,
  "combined_cost": 70
}
Why the actual call data is more accurate: 1. **Variable usage**: LLM token usage varies per call based on conversation complexity 2. **Actual duration**: The real call duration may differ from estimates 3. **Dynamic pricing**: The
product_costs
array shows what was actually charged for each component Your dashboard breakdown ($0.115/min total) is an estimate, but the actual call costs will be reflected in: - `product_costs`: Individual component costs (TTS, LLM, etc.) - `combined_cost`: Total actual cost for the call - `llm_token_usage`: Actual tokens used for LLM processing For accurate billing and cost tracking, always use the
call_cost
data from the completed call rather than the pre-call estimates .
​ To learn more, see the sources I considered: [[1] Get Call](https://docs.retellai.com/api-references/get-call) [[2] List Calls](https://docs.retellai.com/api-references/list-calls) [[3] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy - the call history web interface doesn't show this breakdown ?
a
Thanks for the follow-up, @dj.ufk. I'll get back to you soon.
### Answer Based on the available sources, the call history web interface doesn't show the detailed cost breakdown that's available through the API [(1) ]() . The Session History dashboard provides a comprehensive view of calls and their statuses, with filtering capabilities and customizable columns, but the detailed cost information is only accessible through API calls . This is a known limitation that has been reported by users in the community [(2) ]() . One user specifically mentioned that "the data sent to my query library does not include the cost breakdown of each call as shown on the Retell website" and noted that "the cost breakdown logic is hardcoded with the values of the pricing for different models, voice providers etc" in the UI . To get the detailed cost breakdown you need, you must use the API: The List Calls API [(3) ]() and Get Call API provide the actual
call_cost
object with detailed pricing information:
Copy code
json
"call_cost": {
  "product_costs": [
    {
      "product": "elevenlabs_tts",
      "unit_price": 1,
      "cost": 60
    }
  ],
  "total_duration_seconds": 60,
  "total_duration_unit_price": 1,
  "combined_cost": 70
}
The web interface billing section shows overall usage breakdown and costs by provider [(4) ]() , but for per-call detailed cost breakdowns showing individual component costs (LLM, TTS, etc.) , you need to retrieve this data programmatically through the API calls [(3) ]() .
​ To learn more, see the sources I considered: [[1] Monitor sessions via dashboard](https://docs.retellai.com/features/session-history) [[2] List call not retrieving the cost breakdown in dollar amounts!](https://discord.com/channels/1186424376300679209/1242992505880838194) [[3] List Calls](https://docs.retellai.com/api-references/list-calls) [[4] Billing Overview](https://docs.retellai.com/accounts/billing) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy - ok how can i run api call to get information fo an ended call ?
a
Thanks for the follow-up, @dj.ufk. I'll get back to you soon.
### Answer To get information for an ended call, you can use the Get Call API [(1) ]() . Here's how to make the API call: API Endpoint:
Copy code
GET <https://api.retellai.com/v2/get-call/%7Bcall_id%7D>
Authorization: You need to include your API key in the Authorization header :
Copy code
Authorization: Bearer YOUR_API_KEY
What information you'll get: The API returns comprehensive call details including : - `call_cost`: Detailed cost breakdown with product costs and combined cost - `duration_ms`: Call duration in milliseconds - `transcript`: Full conversation transcript - `call_analysis`: Post-call analysis including sentiment and summary - `recording_url`: Link to the call recording - `latency`: Performance metrics for the call - `llm_token_usage`: LLM token usage statistics Example response structure:
Copy code
json
{
  "call_cost": {
    "product_costs": [
      {
        "product": "elevenlabs_tts",
        "unit_price": 1,
        "cost": 60
      }
    ],
    "total_duration_seconds": 60,
    "total_duration_unit_price": 1,
    "combined_cost": 70
  },
  "duration_ms": 10000,
  "transcript": "Agent: hi how are you doing?\nUser: Doing pretty well...",
  "call_analysis": {
    "call_summary": "The agent called the user...",
    "user_sentiment": "Positive",
    "call_successful": true
  }
}
This gives you all the detailed information about the ended call, including the cost breakdown you were asking about earlier.
​ To learn more, see the sources I considered: [[1] Get Call](https://docs.retellai.com/api-references/get-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy - call id is session id in the call history web interface ?
a
Thanks for the follow-up, @dj.ufk. I'll get back to you soon.
### Answer ### Answer Based on the available documentation, I don't see explicit confirmation that the "session id" in the web interface is the same as the
call_id
used in the API [(1) ]() . However, the API documentation consistently uses
call_id
as the unique identifier for calls [(2) ]() . For example, in the Get Call API, you retrieve call information using:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponse = await client.call.retrieve('119c3f8e47135a29e65947eeb34cf12d') ;
console.log(callResponse) ;
The response includes a
call_id
field that serves as the unique identifier :
Copy code
json
{
 "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
 "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 "call_status": "registered"
}
While the Session History dashboard provides a comprehensive view of calls [(1) ]() , the documentation doesn't explicitly state whether the session ID shown in the web interface corresponds directly to the API's
call_id
. To be certain, you could try using what appears as the session ID in the web interface as the
call_id
parameter in the Get Call API to see if it returns the expected call data.
​ To learn more, see the sources I considered: [[1] Monitor sessions via dashboard](https://docs.retellai.com/features/session-history) [[2] Get Call](https://docs.retellai.com/api-references/get-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy - i see this in one of the responses for the call API "llm_token_usage": { "values": [ 116, 110, 126, 152, 165, 164, 204, 209, 216, 223, 261, 311, 317, 336, 339, 368, 383, 430 ], "average": 246.11111111111111, "num_requests": 18 }, it's not related to pricing right ? if this will show more than 3500 token ti's rlated to that ?
a
Thanks for the follow-up, @dj.ufk. I'll get back to you soon.
### Answer The
llm_token_usage
object is indeed related to pricing, especially when token counts exceed certain thresholds [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() . The
llm_token_usage
object shows: - `values`: Array of token counts for each LLM request during the call - `average`: Average tokens per request - `num_requests`: Total number of LLM requests made Regarding the 3,500 token threshold: Yes, this is directly related to pricing. According to the changelog, there's a Token Length Limit: Maximum of 8192 tokens for Retell LLM [(6) ]() . Additionally, based on community discussions, there are token surcharges that apply when your prompt size exceeds certain thresholds [(7) ]() . In your example, the individual
values
array shows token usage per request (116, 110, 126, etc.) , with an average of 246 tokens per request across 18 requests [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() . While none of these individual requests exceed 3,500 tokens, the pricing implications depend on: 1. Total token usage across all requests 2. Prompt size - if your base prompt is large, it affects the per-minute surcharge [(7) ](
32496490507) 3. Token surcharge calculations that apply when thresholds are exceeded The
call_cost
object in the same API response will show you the actual costs incurred, including any LLM-related charges based on your token usage [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.