retell-sdk 5.23.0 → 5.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/resources/agent.d.mts +3 -3
  4. package/resources/agent.d.mts.map +1 -1
  5. package/resources/agent.d.ts +3 -3
  6. package/resources/agent.d.ts.map +1 -1
  7. package/resources/batch-call.d.mts +3 -3
  8. package/resources/batch-call.d.mts.map +1 -1
  9. package/resources/batch-call.d.ts +3 -3
  10. package/resources/batch-call.d.ts.map +1 -1
  11. package/resources/call.d.mts +1231 -82
  12. package/resources/call.d.mts.map +1 -1
  13. package/resources/call.d.ts +1231 -82
  14. package/resources/call.d.ts.map +1 -1
  15. package/resources/call.js.map +1 -1
  16. package/resources/call.mjs.map +1 -1
  17. package/resources/chat.d.mts +5 -7
  18. package/resources/chat.d.mts.map +1 -1
  19. package/resources/chat.d.ts +5 -7
  20. package/resources/chat.d.ts.map +1 -1
  21. package/resources/conversation-flow-component.d.mts +6 -18
  22. package/resources/conversation-flow-component.d.mts.map +1 -1
  23. package/resources/conversation-flow-component.d.ts +6 -18
  24. package/resources/conversation-flow-component.d.ts.map +1 -1
  25. package/resources/conversation-flow.d.mts +12 -36
  26. package/resources/conversation-flow.d.mts.map +1 -1
  27. package/resources/conversation-flow.d.ts +12 -36
  28. package/resources/conversation-flow.d.ts.map +1 -1
  29. package/resources/llm.d.mts +12 -30
  30. package/resources/llm.d.mts.map +1 -1
  31. package/resources/llm.d.ts +12 -30
  32. package/resources/llm.d.ts.map +1 -1
  33. package/resources/mcp-tool.d.mts +1 -3
  34. package/resources/mcp-tool.d.mts.map +1 -1
  35. package/resources/mcp-tool.d.ts +1 -3
  36. package/resources/mcp-tool.d.ts.map +1 -1
  37. package/resources/playground.d.mts +1 -3
  38. package/resources/playground.d.mts.map +1 -1
  39. package/resources/playground.d.ts +1 -3
  40. package/resources/playground.d.ts.map +1 -1
  41. package/resources/tests.d.mts +3 -9
  42. package/resources/tests.d.mts.map +1 -1
  43. package/resources/tests.d.ts +3 -9
  44. package/resources/tests.d.ts.map +1 -1
  45. package/src/resources/agent.ts +6 -0
  46. package/src/resources/batch-call.ts +4 -2
  47. package/src/resources/call.ts +1447 -20
  48. package/src/resources/chat.ts +5 -5
  49. package/src/resources/conversation-flow-component.ts +6 -6
  50. package/src/resources/conversation-flow.ts +12 -12
  51. package/src/resources/llm.ts +12 -12
  52. package/src/resources/mcp-tool.ts +1 -1
  53. package/src/resources/playground.ts +1 -1
  54. package/src/resources/tests.ts +3 -3
  55. package/src/version.ts +1 -1
  56. package/version.d.mts +1 -1
  57. package/version.d.ts +1 -1
  58. package/version.js +1 -1
  59. package/version.mjs +1 -1
@@ -1,7 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
- import * as CallAPI from './call';
5
4
  import { APIPromise } from '../core/api-promise';
6
5
  import { buildHeaders } from '../internal/headers';
7
6
  import { RequestOptions } from '../internal/request-options';
@@ -215,7 +214,7 @@ export interface PhoneCallResponse {
215
214
  /**
216
215
  * Dynamic variables collected from the call. Only available after the call ends.
217
216
  */
218
- collected_dynamic_variables?: { [key: string]: unknown };
217
+ collected_dynamic_variables?: { [key: string]: string };
219
218
 
220
219
  /**
221
220
  * Custom SIP headers to be added to the call.
@@ -336,7 +335,7 @@ export interface PhoneCallResponse {
336
335
  * your Response Engine prompt and tool description. Only applicable for Response
337
336
  * Engine.
338
337
  */
339
- retell_llm_dynamic_variables?: { [key: string]: unknown };
338
+ retell_llm_dynamic_variables?: { [key: string]: string };
340
339
 
341
340
  /**
342
341
  * Recording of the call without PII, with each party's audio stored in a separate
@@ -1288,7 +1287,7 @@ export interface WebCallResponse {
1288
1287
  /**
1289
1288
  * Dynamic variables collected from the call. Only available after the call ends.
1290
1289
  */
1291
- collected_dynamic_variables?: { [key: string]: unknown };
1290
+ collected_dynamic_variables?: { [key: string]: string };
1292
1291
 
1293
1292
  /**
1294
1293
  * Custom SIP headers to be added to the call.
@@ -1409,7 +1408,7 @@ export interface WebCallResponse {
1409
1408
  * your Response Engine prompt and tool description. Only applicable for Response
1410
1409
  * Engine.
1411
1410
  */
1412
- retell_llm_dynamic_variables?: { [key: string]: unknown };
1411
+ retell_llm_dynamic_variables?: { [key: string]: string };
1413
1412
 
1414
1413
  /**
1415
1414
  * Recording of the call without PII, with each party's audio stored in a separate
@@ -2291,7 +2290,7 @@ export interface CallListResponse {
2291
2290
  */
2292
2291
  has_more?: boolean;
2293
2292
 
2294
- items?: Array<CallListResponse.CallWebCallResponse | CallListResponse.CallPhoneCallResponse>;
2293
+ items?: Array<CallListResponse.V3WebCallResponse | CallListResponse.V3PhoneCallResponse>;
2295
2294
 
2296
2295
  /**
2297
2296
  * Pagination key for the next page.
@@ -2300,15 +2299,1437 @@ export interface CallListResponse {
2300
2299
  }
2301
2300
 
2302
2301
  export namespace CallListResponse {
2303
- /**
2304
- * V3 list calls response. Transcript fields are intentionally omitted.
2305
- */
2306
- export interface CallWebCallResponse extends CallAPI.WebCallResponse {}
2302
+ export interface V3WebCallResponse {
2303
+ /**
2304
+ * Access token to enter the web call room. This needs to be passed to your
2305
+ * frontend to join the call.
2306
+ */
2307
+ access_token: string;
2308
+
2309
+ /**
2310
+ * Corresponding agent id of this call.
2311
+ */
2312
+ agent_id: string;
2313
+
2314
+ /**
2315
+ * The version of the agent.
2316
+ */
2317
+ agent_version: number;
2318
+
2319
+ /**
2320
+ * Unique id of the call. Used to identify the call in the LLM websocket and used
2321
+ * to authenticate in the audio websocket.
2322
+ */
2323
+ call_id: string;
2324
+
2325
+ /**
2326
+ * Status of call.
2327
+ *
2328
+ * - `registered`: Call id issued, starting to make a call using this id.
2329
+ * - `ongoing`: Call connected and ongoing.
2330
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
2331
+ * hung up, or call transferred.
2332
+ * - `error`: Call encountered error.
2333
+ */
2334
+ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error';
2335
+
2336
+ /**
2337
+ * Type of the call. Used to distinguish between web call and phone call.
2338
+ */
2339
+ call_type: 'web_call';
2340
+
2341
+ /**
2342
+ * Name of the agent.
2343
+ */
2344
+ agent_name?: string;
2345
+
2346
+ /**
2347
+ * Post call analysis that includes information such as sentiment, status, summary,
2348
+ * and custom defined data to extract. Available after call ends. Subscribe to
2349
+ * `call_analyzed` webhook event type to receive it once ready.
2350
+ */
2351
+ call_analysis?: V3WebCallResponse.CallAnalysis;
2352
+
2353
+ /**
2354
+ * Cost of the call, including all the products and their costs and discount.
2355
+ */
2356
+ call_cost?: V3WebCallResponse.CallCost;
2357
+
2358
+ /**
2359
+ * Dynamic variables collected from the call. Only available after the call ends.
2360
+ */
2361
+ collected_dynamic_variables?: { [key: string]: string };
2362
+
2363
+ /**
2364
+ * Custom SIP headers to be added to the call.
2365
+ */
2366
+ custom_sip_headers?: { [key: string]: string };
2367
+
2368
+ /**
2369
+ * Data storage setting for this call's agent. "everything" stores all data,
2370
+ * "everything_except_pii" excludes PII when possible, "basic_attributes_only"
2371
+ * stores only metadata.
2372
+ */
2373
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
2374
+
2375
+ /**
2376
+ * The reason for the disconnection of the call. Read detailed description about
2377
+ * reasons listed here at
2378
+ * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons).
2379
+ */
2380
+ disconnection_reason?:
2381
+ | 'user_hangup'
2382
+ | 'agent_hangup'
2383
+ | 'call_transfer'
2384
+ | 'voicemail_reached'
2385
+ | 'ivr_reached'
2386
+ | 'inactivity'
2387
+ | 'max_duration_reached'
2388
+ | 'concurrency_limit_reached'
2389
+ | 'no_valid_payment'
2390
+ | 'scam_detected'
2391
+ | 'dial_busy'
2392
+ | 'dial_failed'
2393
+ | 'dial_no_answer'
2394
+ | 'invalid_destination'
2395
+ | 'telephony_provider_permission_denied'
2396
+ | 'telephony_provider_unavailable'
2397
+ | 'sip_routing_error'
2398
+ | 'marked_as_spam'
2399
+ | 'user_declined'
2400
+ | 'error_llm_websocket_open'
2401
+ | 'error_llm_websocket_lost_connection'
2402
+ | 'error_llm_websocket_runtime'
2403
+ | 'error_llm_websocket_corrupt_payload'
2404
+ | 'error_no_audio_received'
2405
+ | 'error_asr'
2406
+ | 'error_retell'
2407
+ | 'error_unknown'
2408
+ | 'error_user_not_joined'
2409
+ | 'registered_call_timeout'
2410
+ | 'transfer_bridged'
2411
+ | 'transfer_cancelled'
2412
+ | 'manual_stopped';
2413
+
2414
+ /**
2415
+ * Duration of the call in milliseconds. Available after call ends.
2416
+ */
2417
+ duration_ms?: number;
2418
+
2419
+ /**
2420
+ * End timestamp (milliseconds since epoch) of the call. Available after call ends.
2421
+ */
2422
+ end_timestamp?: number;
2423
+
2424
+ /**
2425
+ * URL to the knowledge base retrieved contents of the call. Available after call
2426
+ * ends if the call utilizes knowledge base feature. It consists of the respond id
2427
+ * and the retrieved contents related to that response. It's already rendered in
2428
+ * call history tab of dashboard, and you can also manually download and check
2429
+ * against the transcript to view the knowledge base retrieval results.
2430
+ */
2431
+ knowledge_base_retrieved_contents_url?: string;
2432
+
2433
+ /**
2434
+ * Latency tracking of the call, available after call ends. Not all fields here
2435
+ * will be available, as it depends on the type of call and feature used.
2436
+ */
2437
+ latency?: V3WebCallResponse.Latency;
2438
+
2439
+ /**
2440
+ * LLM token usage of the call, available after call ends. Not populated if using
2441
+ * custom LLM, realtime API, or no LLM call is made.
2442
+ */
2443
+ llm_token_usage?: V3WebCallResponse.LlmTokenUsage;
2444
+
2445
+ /**
2446
+ * An arbitrary object for storage purpose only. You can put anything here like
2447
+ * your internal customer id associated with the call. Not used for processing. You
2448
+ * can later get this field from the call object.
2449
+ */
2450
+ metadata?: unknown;
2451
+
2452
+ /**
2453
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
2454
+ * enabled, the generated URLs will include security signatures that restrict
2455
+ * access and automatically expire after 24 hours.
2456
+ */
2457
+ opt_in_signed_url?: boolean;
2458
+
2459
+ /**
2460
+ * Public log of the call, containing details about all the requests and responses
2461
+ * received in LLM WebSocket, latency tracking for each turntaking, helpful for
2462
+ * debugging and tracing. Available after call ends.
2463
+ */
2464
+ public_log_url?: string;
2465
+
2466
+ /**
2467
+ * Recording of the call, with each party's audio stored in a separate channel.
2468
+ * Available after the call ends.
2469
+ */
2470
+ recording_multi_channel_url?: string;
2471
+
2472
+ /**
2473
+ * Recording of the call. Available after call ends.
2474
+ */
2475
+ recording_url?: string;
2476
+
2477
+ /**
2478
+ * Add optional dynamic variables in key value pairs of string that injects into
2479
+ * your Response Engine prompt and tool description. Only applicable for Response
2480
+ * Engine.
2481
+ */
2482
+ retell_llm_dynamic_variables?: { [key: string]: string };
2483
+
2484
+ /**
2485
+ * Recording of the call without PII, with each party's audio stored in a separate
2486
+ * channel. Available after the call ends.
2487
+ */
2488
+ scrubbed_recording_multi_channel_url?: string;
2489
+
2490
+ /**
2491
+ * Recording of the call without PII. Available after call ends.
2492
+ */
2493
+ scrubbed_recording_url?: string;
2494
+
2495
+ /**
2496
+ * Begin timestamp (milliseconds since epoch) of the call. Available after call
2497
+ * starts.
2498
+ */
2499
+ start_timestamp?: number;
2500
+
2501
+ /**
2502
+ * The destination number or identifier where the call was transferred to. Only
2503
+ * populated when the disconnection reason was `call_transfer`. Can be a phone
2504
+ * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a
2505
+ * ";transport=..." portion (if transport is known) where the transport type can be
2506
+ * "tls", "tcp" or "udp".
2507
+ */
2508
+ transfer_destination?: string | null;
2509
+
2510
+ /**
2511
+ * Transfer end timestamp (milliseconds since epoch) of the call. Available after
2512
+ * transfer call ends.
2513
+ */
2514
+ transfer_end_timestamp?: number;
2515
+ }
2516
+
2517
+ export namespace V3WebCallResponse {
2518
+ /**
2519
+ * Post call analysis that includes information such as sentiment, status, summary,
2520
+ * and custom defined data to extract. Available after call ends. Subscribe to
2521
+ * `call_analyzed` webhook event type to receive it once ready.
2522
+ */
2523
+ export interface CallAnalysis {
2524
+ /**
2525
+ * Whether the agent seems to have a successful call with the user, where the agent
2526
+ * finishes the task, and the call was complete without being cutoff.
2527
+ */
2528
+ call_successful?: boolean;
2529
+
2530
+ /**
2531
+ * A high level summary of the call.
2532
+ */
2533
+ call_summary?: string;
2534
+
2535
+ /**
2536
+ * Custom analysis data that was extracted based on the schema defined in agent
2537
+ * post call analysis data. Can be empty if nothing is specified.
2538
+ */
2539
+ custom_analysis_data?: unknown;
2540
+
2541
+ /**
2542
+ * Whether the call is entered voicemail.
2543
+ */
2544
+ in_voicemail?: boolean;
2545
+
2546
+ /**
2547
+ * Sentiment of the user in the call.
2548
+ */
2549
+ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
2550
+ }
2551
+
2552
+ /**
2553
+ * Cost of the call, including all the products and their costs and discount.
2554
+ */
2555
+ export interface CallCost {
2556
+ /**
2557
+ * Combined cost of all individual costs in cents
2558
+ */
2559
+ combined_cost: number;
2560
+
2561
+ /**
2562
+ * List of products with their unit prices and costs in cents
2563
+ */
2564
+ product_costs: Array<CallCost.ProductCost>;
2565
+
2566
+ /**
2567
+ * Total duration of the call in seconds
2568
+ */
2569
+ total_duration_seconds: number;
2570
+
2571
+ /**
2572
+ * Total unit duration price of all products in cents per second
2573
+ */
2574
+ total_duration_unit_price: number;
2575
+ }
2576
+
2577
+ export namespace CallCost {
2578
+ export interface ProductCost {
2579
+ /**
2580
+ * Cost for the product in cents for the duration of the call.
2581
+ */
2582
+ cost: number;
2583
+
2584
+ /**
2585
+ * Product name that has a cost associated with it.
2586
+ */
2587
+ product: string;
2588
+
2589
+ /**
2590
+ * True if this cost item is for a transfer segment.
2591
+ */
2592
+ is_transfer_leg_cost?: boolean;
2593
+
2594
+ /**
2595
+ * Unit price of the product in cents per second.
2596
+ */
2597
+ unit_price?: number;
2598
+ }
2599
+ }
2600
+
2601
+ /**
2602
+ * Latency tracking of the call, available after call ends. Not all fields here
2603
+ * will be available, as it depends on the type of call and feature used.
2604
+ */
2605
+ export interface Latency {
2606
+ /**
2607
+ * Transcription latency (diff between the duration of the chunks streamed and the
2608
+ * durations of the transcribed part) tracking of the call.
2609
+ */
2610
+ asr?: Latency.Asr;
2611
+
2612
+ /**
2613
+ * End to end latency (from user stops talking to agent start talking) tracking of
2614
+ * the call. This latency does not account for the network trip time from Retell
2615
+ * server to user frontend. The latency is tracked every time turn change between
2616
+ * user and agent.
2617
+ */
2618
+ e2e?: Latency.E2E;
2619
+
2620
+ /**
2621
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
2622
+ * relevant context received) tracking of the call. Only populated when using
2623
+ * knowledge base feature for the agent of the call.
2624
+ */
2625
+ knowledge_base?: Latency.KnowledgeBase;
2626
+
2627
+ /**
2628
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
2629
+ * of the call. When using custom LLM. this latency includes LLM websocket
2630
+ * roundtrip time between user server and Retell server.
2631
+ */
2632
+ llm?: Latency.Llm;
2633
+
2634
+ /**
2635
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
2636
+ * of the call. Only populated for calls using custom LLM.
2637
+ */
2638
+ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt;
2639
+
2640
+ /**
2641
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
2642
+ * received) tracking of the call. Only populated for calls that uses S2S model
2643
+ * like Realtime API.
2644
+ */
2645
+ s2s?: Latency.S2s;
2646
+
2647
+ /**
2648
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
2649
+ * tracking of the call.
2650
+ */
2651
+ tts?: Latency.Tts;
2652
+ }
2653
+
2654
+ export namespace Latency {
2655
+ /**
2656
+ * Transcription latency (diff between the duration of the chunks streamed and the
2657
+ * durations of the transcribed part) tracking of the call.
2658
+ */
2659
+ export interface Asr {
2660
+ /**
2661
+ * Maximum latency in the call, measured in milliseconds.
2662
+ */
2663
+ max?: number;
2664
+
2665
+ /**
2666
+ * Minimum latency in the call, measured in milliseconds.
2667
+ */
2668
+ min?: number;
2669
+
2670
+ /**
2671
+ * Number of data points (number of times latency is tracked).
2672
+ */
2673
+ num?: number;
2674
+
2675
+ /**
2676
+ * 50 percentile of latency, measured in milliseconds.
2677
+ */
2678
+ p50?: number;
2679
+
2680
+ /**
2681
+ * 90 percentile of latency, measured in milliseconds.
2682
+ */
2683
+ p90?: number;
2684
+
2685
+ /**
2686
+ * 95 percentile of latency, measured in milliseconds.
2687
+ */
2688
+ p95?: number;
2689
+
2690
+ /**
2691
+ * 99 percentile of latency, measured in milliseconds.
2692
+ */
2693
+ p99?: number;
2694
+
2695
+ /**
2696
+ * All the latency data points in the call, measured in milliseconds.
2697
+ */
2698
+ values?: Array<number>;
2699
+ }
2700
+
2701
+ /**
2702
+ * End to end latency (from user stops talking to agent start talking) tracking of
2703
+ * the call. This latency does not account for the network trip time from Retell
2704
+ * server to user frontend. The latency is tracked every time turn change between
2705
+ * user and agent.
2706
+ */
2707
+ export interface E2E {
2708
+ /**
2709
+ * Maximum latency in the call, measured in milliseconds.
2710
+ */
2711
+ max?: number;
2712
+
2713
+ /**
2714
+ * Minimum latency in the call, measured in milliseconds.
2715
+ */
2716
+ min?: number;
2717
+
2718
+ /**
2719
+ * Number of data points (number of times latency is tracked).
2720
+ */
2721
+ num?: number;
2722
+
2723
+ /**
2724
+ * 50 percentile of latency, measured in milliseconds.
2725
+ */
2726
+ p50?: number;
2727
+
2728
+ /**
2729
+ * 90 percentile of latency, measured in milliseconds.
2730
+ */
2731
+ p90?: number;
2732
+
2733
+ /**
2734
+ * 95 percentile of latency, measured in milliseconds.
2735
+ */
2736
+ p95?: number;
2737
+
2738
+ /**
2739
+ * 99 percentile of latency, measured in milliseconds.
2740
+ */
2741
+ p99?: number;
2742
+
2743
+ /**
2744
+ * All the latency data points in the call, measured in milliseconds.
2745
+ */
2746
+ values?: Array<number>;
2747
+ }
2748
+
2749
+ /**
2750
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
2751
+ * relevant context received) tracking of the call. Only populated when using
2752
+ * knowledge base feature for the agent of the call.
2753
+ */
2754
+ export interface KnowledgeBase {
2755
+ /**
2756
+ * Maximum latency in the call, measured in milliseconds.
2757
+ */
2758
+ max?: number;
2759
+
2760
+ /**
2761
+ * Minimum latency in the call, measured in milliseconds.
2762
+ */
2763
+ min?: number;
2764
+
2765
+ /**
2766
+ * Number of data points (number of times latency is tracked).
2767
+ */
2768
+ num?: number;
2769
+
2770
+ /**
2771
+ * 50 percentile of latency, measured in milliseconds.
2772
+ */
2773
+ p50?: number;
2774
+
2775
+ /**
2776
+ * 90 percentile of latency, measured in milliseconds.
2777
+ */
2778
+ p90?: number;
2779
+
2780
+ /**
2781
+ * 95 percentile of latency, measured in milliseconds.
2782
+ */
2783
+ p95?: number;
2784
+
2785
+ /**
2786
+ * 99 percentile of latency, measured in milliseconds.
2787
+ */
2788
+ p99?: number;
2789
+
2790
+ /**
2791
+ * All the latency data points in the call, measured in milliseconds.
2792
+ */
2793
+ values?: Array<number>;
2794
+ }
2795
+
2796
+ /**
2797
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
2798
+ * of the call. When using custom LLM. this latency includes LLM websocket
2799
+ * roundtrip time between user server and Retell server.
2800
+ */
2801
+ export interface Llm {
2802
+ /**
2803
+ * Maximum latency in the call, measured in milliseconds.
2804
+ */
2805
+ max?: number;
2806
+
2807
+ /**
2808
+ * Minimum latency in the call, measured in milliseconds.
2809
+ */
2810
+ min?: number;
2811
+
2812
+ /**
2813
+ * Number of data points (number of times latency is tracked).
2814
+ */
2815
+ num?: number;
2816
+
2817
+ /**
2818
+ * 50 percentile of latency, measured in milliseconds.
2819
+ */
2820
+ p50?: number;
2821
+
2822
+ /**
2823
+ * 90 percentile of latency, measured in milliseconds.
2824
+ */
2825
+ p90?: number;
2826
+
2827
+ /**
2828
+ * 95 percentile of latency, measured in milliseconds.
2829
+ */
2830
+ p95?: number;
2831
+
2832
+ /**
2833
+ * 99 percentile of latency, measured in milliseconds.
2834
+ */
2835
+ p99?: number;
2836
+
2837
+ /**
2838
+ * All the latency data points in the call, measured in milliseconds.
2839
+ */
2840
+ values?: Array<number>;
2841
+ }
2842
+
2843
+ /**
2844
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
2845
+ * of the call. Only populated for calls using custom LLM.
2846
+ */
2847
+ export interface LlmWebsocketNetworkRtt {
2848
+ /**
2849
+ * Maximum latency in the call, measured in milliseconds.
2850
+ */
2851
+ max?: number;
2852
+
2853
+ /**
2854
+ * Minimum latency in the call, measured in milliseconds.
2855
+ */
2856
+ min?: number;
2857
+
2858
+ /**
2859
+ * Number of data points (number of times latency is tracked).
2860
+ */
2861
+ num?: number;
2862
+
2863
+ /**
2864
+ * 50 percentile of latency, measured in milliseconds.
2865
+ */
2866
+ p50?: number;
2867
+
2868
+ /**
2869
+ * 90 percentile of latency, measured in milliseconds.
2870
+ */
2871
+ p90?: number;
2872
+
2873
+ /**
2874
+ * 95 percentile of latency, measured in milliseconds.
2875
+ */
2876
+ p95?: number;
2877
+
2878
+ /**
2879
+ * 99 percentile of latency, measured in milliseconds.
2880
+ */
2881
+ p99?: number;
2882
+
2883
+ /**
2884
+ * All the latency data points in the call, measured in milliseconds.
2885
+ */
2886
+ values?: Array<number>;
2887
+ }
2888
+
2889
+ /**
2890
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
2891
+ * received) tracking of the call. Only populated for calls that uses S2S model
2892
+ * like Realtime API.
2893
+ */
2894
+ export interface S2s {
2895
+ /**
2896
+ * Maximum latency in the call, measured in milliseconds.
2897
+ */
2898
+ max?: number;
2899
+
2900
+ /**
2901
+ * Minimum latency in the call, measured in milliseconds.
2902
+ */
2903
+ min?: number;
2904
+
2905
+ /**
2906
+ * Number of data points (number of times latency is tracked).
2907
+ */
2908
+ num?: number;
2909
+
2910
+ /**
2911
+ * 50 percentile of latency, measured in milliseconds.
2912
+ */
2913
+ p50?: number;
2914
+
2915
+ /**
2916
+ * 90 percentile of latency, measured in milliseconds.
2917
+ */
2918
+ p90?: number;
2919
+
2920
+ /**
2921
+ * 95 percentile of latency, measured in milliseconds.
2922
+ */
2923
+ p95?: number;
2924
+
2925
+ /**
2926
+ * 99 percentile of latency, measured in milliseconds.
2927
+ */
2928
+ p99?: number;
2929
+
2930
+ /**
2931
+ * All the latency data points in the call, measured in milliseconds.
2932
+ */
2933
+ values?: Array<number>;
2934
+ }
2935
+
2936
+ /**
2937
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
2938
+ * tracking of the call.
2939
+ */
2940
+ export interface Tts {
2941
+ /**
2942
+ * Maximum latency in the call, measured in milliseconds.
2943
+ */
2944
+ max?: number;
2945
+
2946
+ /**
2947
+ * Minimum latency in the call, measured in milliseconds.
2948
+ */
2949
+ min?: number;
2950
+
2951
+ /**
2952
+ * Number of data points (number of times latency is tracked).
2953
+ */
2954
+ num?: number;
2955
+
2956
+ /**
2957
+ * 50 percentile of latency, measured in milliseconds.
2958
+ */
2959
+ p50?: number;
2960
+
2961
+ /**
2962
+ * 90 percentile of latency, measured in milliseconds.
2963
+ */
2964
+ p90?: number;
2965
+
2966
+ /**
2967
+ * 95 percentile of latency, measured in milliseconds.
2968
+ */
2969
+ p95?: number;
2970
+
2971
+ /**
2972
+ * 99 percentile of latency, measured in milliseconds.
2973
+ */
2974
+ p99?: number;
2975
+
2976
+ /**
2977
+ * All the latency data points in the call, measured in milliseconds.
2978
+ */
2979
+ values?: Array<number>;
2980
+ }
2981
+ }
2982
+
2983
+ /**
2984
+ * LLM token usage of the call, available after call ends. Not populated if using
2985
+ * custom LLM, realtime API, or no LLM call is made.
2986
+ */
2987
+ export interface LlmTokenUsage {
2988
+ /**
2989
+ * Average token count of the call.
2990
+ */
2991
+ average: number;
2992
+
2993
+ /**
2994
+ * Number of requests made to the LLM.
2995
+ */
2996
+ num_requests: number;
2997
+
2998
+ /**
2999
+ * All the token count values in the call.
3000
+ */
3001
+ values: Array<number>;
3002
+ }
3003
+ }
3004
+
3005
+ export interface V3PhoneCallResponse {
3006
+ /**
3007
+ * Corresponding agent id of this call.
3008
+ */
3009
+ agent_id: string;
3010
+
3011
+ /**
3012
+ * The version of the agent.
3013
+ */
3014
+ agent_version: number;
3015
+
3016
+ /**
3017
+ * Unique id of the call. Used to identify the call in the LLM websocket and used
3018
+ * to authenticate in the audio websocket.
3019
+ */
3020
+ call_id: string;
3021
+
3022
+ /**
3023
+ * Status of call.
3024
+ *
3025
+ * - `registered`: Call id issued, starting to make a call using this id.
3026
+ * - `ongoing`: Call connected and ongoing.
3027
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
3028
+ * hung up, or call transferred.
3029
+ * - `error`: Call encountered error.
3030
+ */
3031
+ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error';
3032
+
3033
+ /**
3034
+ * Type of the call. Used to distinguish between web call and phone call.
3035
+ */
3036
+ call_type: 'phone_call';
3037
+
3038
+ /**
3039
+ * Direction of the phone call.
3040
+ */
3041
+ direction: 'inbound' | 'outbound';
3042
+
3043
+ /**
3044
+ * The caller number.
3045
+ */
3046
+ from_number: string;
3047
+
3048
+ /**
3049
+ * The callee number.
3050
+ */
3051
+ to_number: string;
3052
+
3053
+ /**
3054
+ * Name of the agent.
3055
+ */
3056
+ agent_name?: string;
3057
+
3058
+ /**
3059
+ * Post call analysis that includes information such as sentiment, status, summary,
3060
+ * and custom defined data to extract. Available after call ends. Subscribe to
3061
+ * `call_analyzed` webhook event type to receive it once ready.
3062
+ */
3063
+ call_analysis?: V3PhoneCallResponse.CallAnalysis;
3064
+
3065
+ /**
3066
+ * Cost of the call, including all the products and their costs and discount.
3067
+ */
3068
+ call_cost?: V3PhoneCallResponse.CallCost;
3069
+
3070
+ /**
3071
+ * Dynamic variables collected from the call. Only available after the call ends.
3072
+ */
3073
+ collected_dynamic_variables?: { [key: string]: string };
3074
+
3075
+ /**
3076
+ * Custom SIP headers to be added to the call.
3077
+ */
3078
+ custom_sip_headers?: { [key: string]: string };
3079
+
3080
+ /**
3081
+ * Data storage setting for this call's agent. "everything" stores all data,
3082
+ * "everything_except_pii" excludes PII when possible, "basic_attributes_only"
3083
+ * stores only metadata.
3084
+ */
3085
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
3086
+
3087
+ /**
3088
+ * The reason for the disconnection of the call. Read detailed description about
3089
+ * reasons listed here at
3090
+ * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons).
3091
+ */
3092
+ disconnection_reason?:
3093
+ | 'user_hangup'
3094
+ | 'agent_hangup'
3095
+ | 'call_transfer'
3096
+ | 'voicemail_reached'
3097
+ | 'ivr_reached'
3098
+ | 'inactivity'
3099
+ | 'max_duration_reached'
3100
+ | 'concurrency_limit_reached'
3101
+ | 'no_valid_payment'
3102
+ | 'scam_detected'
3103
+ | 'dial_busy'
3104
+ | 'dial_failed'
3105
+ | 'dial_no_answer'
3106
+ | 'invalid_destination'
3107
+ | 'telephony_provider_permission_denied'
3108
+ | 'telephony_provider_unavailable'
3109
+ | 'sip_routing_error'
3110
+ | 'marked_as_spam'
3111
+ | 'user_declined'
3112
+ | 'error_llm_websocket_open'
3113
+ | 'error_llm_websocket_lost_connection'
3114
+ | 'error_llm_websocket_runtime'
3115
+ | 'error_llm_websocket_corrupt_payload'
3116
+ | 'error_no_audio_received'
3117
+ | 'error_asr'
3118
+ | 'error_retell'
3119
+ | 'error_unknown'
3120
+ | 'error_user_not_joined'
3121
+ | 'registered_call_timeout'
3122
+ | 'transfer_bridged'
3123
+ | 'transfer_cancelled'
3124
+ | 'manual_stopped';
3125
+
3126
+ /**
3127
+ * Duration of the call in milliseconds. Available after call ends.
3128
+ */
3129
+ duration_ms?: number;
3130
+
3131
+ /**
3132
+ * End timestamp (milliseconds since epoch) of the call. Available after call ends.
3133
+ */
3134
+ end_timestamp?: number;
3135
+
3136
+ /**
3137
+ * URL to the knowledge base retrieved contents of the call. Available after call
3138
+ * ends if the call utilizes knowledge base feature. It consists of the respond id
3139
+ * and the retrieved contents related to that response. It's already rendered in
3140
+ * call history tab of dashboard, and you can also manually download and check
3141
+ * against the transcript to view the knowledge base retrieval results.
3142
+ */
3143
+ knowledge_base_retrieved_contents_url?: string;
3144
+
3145
+ /**
3146
+ * Latency tracking of the call, available after call ends. Not all fields here
3147
+ * will be available, as it depends on the type of call and feature used.
3148
+ */
3149
+ latency?: V3PhoneCallResponse.Latency;
3150
+
3151
+ /**
3152
+ * LLM token usage of the call, available after call ends. Not populated if using
3153
+ * custom LLM, realtime API, or no LLM call is made.
3154
+ */
3155
+ llm_token_usage?: V3PhoneCallResponse.LlmTokenUsage;
3156
+
3157
+ /**
3158
+ * An arbitrary object for storage purpose only. You can put anything here like
3159
+ * your internal customer id associated with the call. Not used for processing. You
3160
+ * can later get this field from the call object.
3161
+ */
3162
+ metadata?: unknown;
3163
+
3164
+ /**
3165
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
3166
+ * enabled, the generated URLs will include security signatures that restrict
3167
+ * access and automatically expire after 24 hours.
3168
+ */
3169
+ opt_in_signed_url?: boolean;
3170
+
3171
+ /**
3172
+ * Public log of the call, containing details about all the requests and responses
3173
+ * received in LLM WebSocket, latency tracking for each turntaking, helpful for
3174
+ * debugging and tracing. Available after call ends.
3175
+ */
3176
+ public_log_url?: string;
3177
+
3178
+ /**
3179
+ * Recording of the call, with each party's audio stored in a separate channel.
3180
+ * Available after the call ends.
3181
+ */
3182
+ recording_multi_channel_url?: string;
3183
+
3184
+ /**
3185
+ * Recording of the call. Available after call ends.
3186
+ */
3187
+ recording_url?: string;
3188
+
3189
+ /**
3190
+ * Add optional dynamic variables in key value pairs of string that injects into
3191
+ * your Response Engine prompt and tool description. Only applicable for Response
3192
+ * Engine.
3193
+ */
3194
+ retell_llm_dynamic_variables?: { [key: string]: string };
3195
+
3196
+ /**
3197
+ * Recording of the call without PII, with each party's audio stored in a separate
3198
+ * channel. Available after the call ends.
3199
+ */
3200
+ scrubbed_recording_multi_channel_url?: string;
3201
+
3202
+ /**
3203
+ * Recording of the call without PII. Available after call ends.
3204
+ */
3205
+ scrubbed_recording_url?: string;
3206
+
3207
+ /**
3208
+ * Begin timestamp (milliseconds since epoch) of the call. Available after call
3209
+ * starts.
3210
+ */
3211
+ start_timestamp?: number;
3212
+
3213
+ /**
3214
+ * Telephony identifier of the call, populated when available. Tracking purposes
3215
+ * only.
3216
+ */
3217
+ telephony_identifier?: V3PhoneCallResponse.TelephonyIdentifier;
3218
+
3219
+ /**
3220
+ * The destination number or identifier where the call was transferred to. Only
3221
+ * populated when the disconnection reason was `call_transfer`. Can be a phone
3222
+ * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a
3223
+ * ";transport=..." portion (if transport is known) where the transport type can be
3224
+ * "tls", "tcp" or "udp".
3225
+ */
3226
+ transfer_destination?: string | null;
3227
+
3228
+ /**
3229
+ * Transfer end timestamp (milliseconds since epoch) of the call. Available after
3230
+ * transfer call ends.
3231
+ */
3232
+ transfer_end_timestamp?: number;
3233
+ }
3234
+
3235
+ export namespace V3PhoneCallResponse {
3236
+ /**
3237
+ * Post call analysis that includes information such as sentiment, status, summary,
3238
+ * and custom defined data to extract. Available after call ends. Subscribe to
3239
+ * `call_analyzed` webhook event type to receive it once ready.
3240
+ */
3241
+ export interface CallAnalysis {
3242
+ /**
3243
+ * Whether the agent seems to have a successful call with the user, where the agent
3244
+ * finishes the task, and the call was complete without being cutoff.
3245
+ */
3246
+ call_successful?: boolean;
3247
+
3248
+ /**
3249
+ * A high level summary of the call.
3250
+ */
3251
+ call_summary?: string;
3252
+
3253
+ /**
3254
+ * Custom analysis data that was extracted based on the schema defined in agent
3255
+ * post call analysis data. Can be empty if nothing is specified.
3256
+ */
3257
+ custom_analysis_data?: unknown;
3258
+
3259
+ /**
3260
+ * Whether the call is entered voicemail.
3261
+ */
3262
+ in_voicemail?: boolean;
3263
+
3264
+ /**
3265
+ * Sentiment of the user in the call.
3266
+ */
3267
+ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
3268
+ }
3269
+
3270
+ /**
3271
+ * Cost of the call, including all the products and their costs and discount.
3272
+ */
3273
+ export interface CallCost {
3274
+ /**
3275
+ * Combined cost of all individual costs in cents
3276
+ */
3277
+ combined_cost: number;
3278
+
3279
+ /**
3280
+ * List of products with their unit prices and costs in cents
3281
+ */
3282
+ product_costs: Array<CallCost.ProductCost>;
2307
3283
 
2308
- /**
2309
- * V3 list calls response. Transcript fields are intentionally omitted.
2310
- */
2311
- export interface CallPhoneCallResponse extends CallAPI.PhoneCallResponse {}
3284
+ /**
3285
+ * Total duration of the call in seconds
3286
+ */
3287
+ total_duration_seconds: number;
3288
+
3289
+ /**
3290
+ * Total unit duration price of all products in cents per second
3291
+ */
3292
+ total_duration_unit_price: number;
3293
+ }
3294
+
3295
+ export namespace CallCost {
3296
+ export interface ProductCost {
3297
+ /**
3298
+ * Cost for the product in cents for the duration of the call.
3299
+ */
3300
+ cost: number;
3301
+
3302
+ /**
3303
+ * Product name that has a cost associated with it.
3304
+ */
3305
+ product: string;
3306
+
3307
+ /**
3308
+ * True if this cost item is for a transfer segment.
3309
+ */
3310
+ is_transfer_leg_cost?: boolean;
3311
+
3312
+ /**
3313
+ * Unit price of the product in cents per second.
3314
+ */
3315
+ unit_price?: number;
3316
+ }
3317
+ }
3318
+
3319
+ /**
3320
+ * Latency tracking of the call, available after call ends. Not all fields here
3321
+ * will be available, as it depends on the type of call and feature used.
3322
+ */
3323
+ export interface Latency {
3324
+ /**
3325
+ * Transcription latency (diff between the duration of the chunks streamed and the
3326
+ * durations of the transcribed part) tracking of the call.
3327
+ */
3328
+ asr?: Latency.Asr;
3329
+
3330
+ /**
3331
+ * End to end latency (from user stops talking to agent start talking) tracking of
3332
+ * the call. This latency does not account for the network trip time from Retell
3333
+ * server to user frontend. The latency is tracked every time turn change between
3334
+ * user and agent.
3335
+ */
3336
+ e2e?: Latency.E2E;
3337
+
3338
+ /**
3339
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
3340
+ * relevant context received) tracking of the call. Only populated when using
3341
+ * knowledge base feature for the agent of the call.
3342
+ */
3343
+ knowledge_base?: Latency.KnowledgeBase;
3344
+
3345
+ /**
3346
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
3347
+ * of the call. When using custom LLM. this latency includes LLM websocket
3348
+ * roundtrip time between user server and Retell server.
3349
+ */
3350
+ llm?: Latency.Llm;
3351
+
3352
+ /**
3353
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
3354
+ * of the call. Only populated for calls using custom LLM.
3355
+ */
3356
+ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt;
3357
+
3358
+ /**
3359
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
3360
+ * received) tracking of the call. Only populated for calls that uses S2S model
3361
+ * like Realtime API.
3362
+ */
3363
+ s2s?: Latency.S2s;
3364
+
3365
+ /**
3366
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
3367
+ * tracking of the call.
3368
+ */
3369
+ tts?: Latency.Tts;
3370
+ }
3371
+
3372
+ export namespace Latency {
3373
+ /**
3374
+ * Transcription latency (diff between the duration of the chunks streamed and the
3375
+ * durations of the transcribed part) tracking of the call.
3376
+ */
3377
+ export interface Asr {
3378
+ /**
3379
+ * Maximum latency in the call, measured in milliseconds.
3380
+ */
3381
+ max?: number;
3382
+
3383
+ /**
3384
+ * Minimum latency in the call, measured in milliseconds.
3385
+ */
3386
+ min?: number;
3387
+
3388
+ /**
3389
+ * Number of data points (number of times latency is tracked).
3390
+ */
3391
+ num?: number;
3392
+
3393
+ /**
3394
+ * 50 percentile of latency, measured in milliseconds.
3395
+ */
3396
+ p50?: number;
3397
+
3398
+ /**
3399
+ * 90 percentile of latency, measured in milliseconds.
3400
+ */
3401
+ p90?: number;
3402
+
3403
+ /**
3404
+ * 95 percentile of latency, measured in milliseconds.
3405
+ */
3406
+ p95?: number;
3407
+
3408
+ /**
3409
+ * 99 percentile of latency, measured in milliseconds.
3410
+ */
3411
+ p99?: number;
3412
+
3413
+ /**
3414
+ * All the latency data points in the call, measured in milliseconds.
3415
+ */
3416
+ values?: Array<number>;
3417
+ }
3418
+
3419
+ /**
3420
+ * End to end latency (from user stops talking to agent start talking) tracking of
3421
+ * the call. This latency does not account for the network trip time from Retell
3422
+ * server to user frontend. The latency is tracked every time turn change between
3423
+ * user and agent.
3424
+ */
3425
+ export interface E2E {
3426
+ /**
3427
+ * Maximum latency in the call, measured in milliseconds.
3428
+ */
3429
+ max?: number;
3430
+
3431
+ /**
3432
+ * Minimum latency in the call, measured in milliseconds.
3433
+ */
3434
+ min?: number;
3435
+
3436
+ /**
3437
+ * Number of data points (number of times latency is tracked).
3438
+ */
3439
+ num?: number;
3440
+
3441
+ /**
3442
+ * 50 percentile of latency, measured in milliseconds.
3443
+ */
3444
+ p50?: number;
3445
+
3446
+ /**
3447
+ * 90 percentile of latency, measured in milliseconds.
3448
+ */
3449
+ p90?: number;
3450
+
3451
+ /**
3452
+ * 95 percentile of latency, measured in milliseconds.
3453
+ */
3454
+ p95?: number;
3455
+
3456
+ /**
3457
+ * 99 percentile of latency, measured in milliseconds.
3458
+ */
3459
+ p99?: number;
3460
+
3461
+ /**
3462
+ * All the latency data points in the call, measured in milliseconds.
3463
+ */
3464
+ values?: Array<number>;
3465
+ }
3466
+
3467
+ /**
3468
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
3469
+ * relevant context received) tracking of the call. Only populated when using
3470
+ * knowledge base feature for the agent of the call.
3471
+ */
3472
+ export interface KnowledgeBase {
3473
+ /**
3474
+ * Maximum latency in the call, measured in milliseconds.
3475
+ */
3476
+ max?: number;
3477
+
3478
+ /**
3479
+ * Minimum latency in the call, measured in milliseconds.
3480
+ */
3481
+ min?: number;
3482
+
3483
+ /**
3484
+ * Number of data points (number of times latency is tracked).
3485
+ */
3486
+ num?: number;
3487
+
3488
+ /**
3489
+ * 50 percentile of latency, measured in milliseconds.
3490
+ */
3491
+ p50?: number;
3492
+
3493
+ /**
3494
+ * 90 percentile of latency, measured in milliseconds.
3495
+ */
3496
+ p90?: number;
3497
+
3498
+ /**
3499
+ * 95 percentile of latency, measured in milliseconds.
3500
+ */
3501
+ p95?: number;
3502
+
3503
+ /**
3504
+ * 99 percentile of latency, measured in milliseconds.
3505
+ */
3506
+ p99?: number;
3507
+
3508
+ /**
3509
+ * All the latency data points in the call, measured in milliseconds.
3510
+ */
3511
+ values?: Array<number>;
3512
+ }
3513
+
3514
+ /**
3515
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
3516
+ * of the call. When using custom LLM. this latency includes LLM websocket
3517
+ * roundtrip time between user server and Retell server.
3518
+ */
3519
+ export interface Llm {
3520
+ /**
3521
+ * Maximum latency in the call, measured in milliseconds.
3522
+ */
3523
+ max?: number;
3524
+
3525
+ /**
3526
+ * Minimum latency in the call, measured in milliseconds.
3527
+ */
3528
+ min?: number;
3529
+
3530
+ /**
3531
+ * Number of data points (number of times latency is tracked).
3532
+ */
3533
+ num?: number;
3534
+
3535
+ /**
3536
+ * 50 percentile of latency, measured in milliseconds.
3537
+ */
3538
+ p50?: number;
3539
+
3540
+ /**
3541
+ * 90 percentile of latency, measured in milliseconds.
3542
+ */
3543
+ p90?: number;
3544
+
3545
+ /**
3546
+ * 95 percentile of latency, measured in milliseconds.
3547
+ */
3548
+ p95?: number;
3549
+
3550
+ /**
3551
+ * 99 percentile of latency, measured in milliseconds.
3552
+ */
3553
+ p99?: number;
3554
+
3555
+ /**
3556
+ * All the latency data points in the call, measured in milliseconds.
3557
+ */
3558
+ values?: Array<number>;
3559
+ }
3560
+
3561
+ /**
3562
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
3563
+ * of the call. Only populated for calls using custom LLM.
3564
+ */
3565
+ export interface LlmWebsocketNetworkRtt {
3566
+ /**
3567
+ * Maximum latency in the call, measured in milliseconds.
3568
+ */
3569
+ max?: number;
3570
+
3571
+ /**
3572
+ * Minimum latency in the call, measured in milliseconds.
3573
+ */
3574
+ min?: number;
3575
+
3576
+ /**
3577
+ * Number of data points (number of times latency is tracked).
3578
+ */
3579
+ num?: number;
3580
+
3581
+ /**
3582
+ * 50 percentile of latency, measured in milliseconds.
3583
+ */
3584
+ p50?: number;
3585
+
3586
+ /**
3587
+ * 90 percentile of latency, measured in milliseconds.
3588
+ */
3589
+ p90?: number;
3590
+
3591
+ /**
3592
+ * 95 percentile of latency, measured in milliseconds.
3593
+ */
3594
+ p95?: number;
3595
+
3596
+ /**
3597
+ * 99 percentile of latency, measured in milliseconds.
3598
+ */
3599
+ p99?: number;
3600
+
3601
+ /**
3602
+ * All the latency data points in the call, measured in milliseconds.
3603
+ */
3604
+ values?: Array<number>;
3605
+ }
3606
+
3607
+ /**
3608
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
3609
+ * received) tracking of the call. Only populated for calls that uses S2S model
3610
+ * like Realtime API.
3611
+ */
3612
+ export interface S2s {
3613
+ /**
3614
+ * Maximum latency in the call, measured in milliseconds.
3615
+ */
3616
+ max?: number;
3617
+
3618
+ /**
3619
+ * Minimum latency in the call, measured in milliseconds.
3620
+ */
3621
+ min?: number;
3622
+
3623
+ /**
3624
+ * Number of data points (number of times latency is tracked).
3625
+ */
3626
+ num?: number;
3627
+
3628
+ /**
3629
+ * 50 percentile of latency, measured in milliseconds.
3630
+ */
3631
+ p50?: number;
3632
+
3633
+ /**
3634
+ * 90 percentile of latency, measured in milliseconds.
3635
+ */
3636
+ p90?: number;
3637
+
3638
+ /**
3639
+ * 95 percentile of latency, measured in milliseconds.
3640
+ */
3641
+ p95?: number;
3642
+
3643
+ /**
3644
+ * 99 percentile of latency, measured in milliseconds.
3645
+ */
3646
+ p99?: number;
3647
+
3648
+ /**
3649
+ * All the latency data points in the call, measured in milliseconds.
3650
+ */
3651
+ values?: Array<number>;
3652
+ }
3653
+
3654
+ /**
3655
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
3656
+ * tracking of the call.
3657
+ */
3658
+ export interface Tts {
3659
+ /**
3660
+ * Maximum latency in the call, measured in milliseconds.
3661
+ */
3662
+ max?: number;
3663
+
3664
+ /**
3665
+ * Minimum latency in the call, measured in milliseconds.
3666
+ */
3667
+ min?: number;
3668
+
3669
+ /**
3670
+ * Number of data points (number of times latency is tracked).
3671
+ */
3672
+ num?: number;
3673
+
3674
+ /**
3675
+ * 50 percentile of latency, measured in milliseconds.
3676
+ */
3677
+ p50?: number;
3678
+
3679
+ /**
3680
+ * 90 percentile of latency, measured in milliseconds.
3681
+ */
3682
+ p90?: number;
3683
+
3684
+ /**
3685
+ * 95 percentile of latency, measured in milliseconds.
3686
+ */
3687
+ p95?: number;
3688
+
3689
+ /**
3690
+ * 99 percentile of latency, measured in milliseconds.
3691
+ */
3692
+ p99?: number;
3693
+
3694
+ /**
3695
+ * All the latency data points in the call, measured in milliseconds.
3696
+ */
3697
+ values?: Array<number>;
3698
+ }
3699
+ }
3700
+
3701
+ /**
3702
+ * LLM token usage of the call, available after call ends. Not populated if using
3703
+ * custom LLM, realtime API, or no LLM call is made.
3704
+ */
3705
+ export interface LlmTokenUsage {
3706
+ /**
3707
+ * Average token count of the call.
3708
+ */
3709
+ average: number;
3710
+
3711
+ /**
3712
+ * Number of requests made to the LLM.
3713
+ */
3714
+ num_requests: number;
3715
+
3716
+ /**
3717
+ * All the token count values in the call.
3718
+ */
3719
+ values: Array<number>;
3720
+ }
3721
+
3722
+ /**
3723
+ * Telephony identifier of the call, populated when available. Tracking purposes
3724
+ * only.
3725
+ */
3726
+ export interface TelephonyIdentifier {
3727
+ /**
3728
+ * Twilio call sid.
3729
+ */
3730
+ twilio_call_sid?: string;
3731
+ }
3732
+ }
2312
3733
  }
2313
3734
 
2314
3735
  export interface CallUpdateParams {
@@ -3230,7 +4651,7 @@ export interface CallCreatePhoneCallParams {
3230
4651
  * your Response Engine prompt and tool description. Only applicable for Response
3231
4652
  * Engine.
3232
4653
  */
3233
- retell_llm_dynamic_variables?: { [key: string]: unknown };
4654
+ retell_llm_dynamic_variables?: { [key: string]: string };
3234
4655
  }
3235
4656
 
3236
4657
  export namespace CallCreatePhoneCallParams {
@@ -3786,12 +5207,14 @@ export namespace CallCreatePhoneCallParams {
3786
5207
  | 'eleven_v3'
3787
5208
  | 'sonic-3'
3788
5209
  | 'sonic-3-latest'
5210
+ | 'sonic-3.5'
3789
5211
  | 'tts-1'
3790
5212
  | 'gpt-4o-mini-tts'
3791
5213
  | 'speech-02-turbo'
3792
5214
  | 'speech-2.8-turbo'
3793
5215
  | 's1'
3794
5216
  | 's2-pro'
5217
+ | 's2.1-pro'
3795
5218
  | null;
3796
5219
 
3797
5220
  /**
@@ -4512,7 +5935,7 @@ export namespace CallCreatePhoneCallParams {
4512
5935
  * Select the underlying speech to speech model. Can only set this or model, not
4513
5936
  * both.
4514
5937
  */
4515
- s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
5938
+ s2s_model?: 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
4516
5939
 
4517
5940
  /**
4518
5941
  * The speaker who starts the conversation. Required. Must be either 'user' or
@@ -4591,7 +6014,7 @@ export interface CallCreateWebCallParams {
4591
6014
  * your Response Engine prompt and tool description. Only applicable for Response
4592
6015
  * Engine.
4593
6016
  */
4594
- retell_llm_dynamic_variables?: { [key: string]: unknown };
6017
+ retell_llm_dynamic_variables?: { [key: string]: string };
4595
6018
  }
4596
6019
 
4597
6020
  export namespace CallCreateWebCallParams {
@@ -5147,12 +6570,14 @@ export namespace CallCreateWebCallParams {
5147
6570
  | 'eleven_v3'
5148
6571
  | 'sonic-3'
5149
6572
  | 'sonic-3-latest'
6573
+ | 'sonic-3.5'
5150
6574
  | 'tts-1'
5151
6575
  | 'gpt-4o-mini-tts'
5152
6576
  | 'speech-02-turbo'
5153
6577
  | 'speech-2.8-turbo'
5154
6578
  | 's1'
5155
6579
  | 's2-pro'
6580
+ | 's2.1-pro'
5156
6581
  | null;
5157
6582
 
5158
6583
  /**
@@ -5873,7 +7298,7 @@ export namespace CallCreateWebCallParams {
5873
7298
  * Select the underlying speech to speech model. Can only set this or model, not
5874
7299
  * both.
5875
7300
  */
5876
- s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
7301
+ s2s_model?: 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
5877
7302
 
5878
7303
  /**
5879
7304
  * The speaker who starts the conversation. Required. Must be either 'user' or
@@ -5947,7 +7372,7 @@ export interface CallRegisterPhoneCallParams {
5947
7372
  * your Response Engine prompt and tool description. Only applicable for Response
5948
7373
  * Engine.
5949
7374
  */
5950
- retell_llm_dynamic_variables?: { [key: string]: unknown };
7375
+ retell_llm_dynamic_variables?: { [key: string]: string };
5951
7376
 
5952
7377
  /**
5953
7378
  * The number you want to call, in E.164 format. Stored for tracking purpose.
@@ -6508,12 +7933,14 @@ export namespace CallRegisterPhoneCallParams {
6508
7933
  | 'eleven_v3'
6509
7934
  | 'sonic-3'
6510
7935
  | 'sonic-3-latest'
7936
+ | 'sonic-3.5'
6511
7937
  | 'tts-1'
6512
7938
  | 'gpt-4o-mini-tts'
6513
7939
  | 'speech-02-turbo'
6514
7940
  | 'speech-2.8-turbo'
6515
7941
  | 's1'
6516
7942
  | 's2-pro'
7943
+ | 's2.1-pro'
6517
7944
  | null;
6518
7945
 
6519
7946
  /**
@@ -7234,7 +8661,7 @@ export namespace CallRegisterPhoneCallParams {
7234
8661
  * Select the underlying speech to speech model. Can only set this or model, not
7235
8662
  * both.
7236
8663
  */
7237
- s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
8664
+ s2s_model?: 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
7238
8665
 
7239
8666
  /**
7240
8667
  * The speaker who starts the conversation. Required. Must be either 'user' or