minus.ace
10/10/2025, 10:29 PMAI Evy
10/10/2025, 10:29 PMAI Evy
10/10/2025, 10:30 PMchat_cost field that breaks down costs by product and provides a combined total [(2) ]() [(1) ]() .
Here's how to retrieve a chat's cost information:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(chatResponse.agent_id) ;
[(1) ]()
The response includes a chat_cost object with product-level costs and a combined total [(2) ]() [(1) ]() :
json
"chat_cost": {
"product_costs": [
{
"product": "elevenlabs_tts",
"unit_price": 1,
"cost": 60
}
],
"combined_cost": 70
}
To calculate weekly costs per agent, you would need to retrieve all chats for a specific agent using the List Chat endpoint [(2) ]() , filter by date range, and sum the combined_cost values from each chat's chat_cost field [(2) ]() [(1) ]() .AI Evy
10/10/2025, 10:30 PMAI Evy
10/10/2025, 10:30 PMminus.ace
10/10/2025, 10:31 PMAI Evy
10/10/2025, 10:31 PMAI Evy
10/10/2025, 10:31 PMagent_id field and a chat_cost object with detailed cost breakdown . To calculate costs per agent, you would:
1. Use the List Chat endpoint to retrieve all calls [(1) ]()
2. Filter by agent_id to isolate calls for each specific agent
3. Sum the combined_cost values from each call's chat_cost field [(1) ]() [(2) ]()
Here's the cost structure returned for each call [(1) ]() :
json
"chat_cost": {
"product_costs": [
{
"product": "elevenlabs_tts",
"unit_price": 1,
"cost": 60
}
],
"combined_cost": 70
}
The dashboard billing usage currently shows combined totals, but you can build your own reporting by querying the API and aggregating costs by agent_id [(1) ]() [(2) ]() .
**AI Evy
10/10/2025, 10:31 PMAI Evy
10/10/2025, 10:31 PM