telnyx 6.64.0 → 6.65.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 (149) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +10 -11
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +10 -11
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/ai/ai.d.mts +116 -114
  10. package/resources/ai/ai.d.mts.map +1 -1
  11. package/resources/ai/ai.d.ts +116 -114
  12. package/resources/ai/ai.d.ts.map +1 -1
  13. package/resources/ai/ai.js.map +1 -1
  14. package/resources/ai/ai.mjs.map +1 -1
  15. package/resources/ai/assistants/assistants.d.mts +332 -112
  16. package/resources/ai/assistants/assistants.d.mts.map +1 -1
  17. package/resources/ai/assistants/assistants.d.ts +332 -112
  18. package/resources/ai/assistants/assistants.d.ts.map +1 -1
  19. package/resources/ai/assistants/assistants.js.map +1 -1
  20. package/resources/ai/assistants/assistants.mjs.map +1 -1
  21. package/resources/ai/assistants/canary-deploys.d.mts +241 -70
  22. package/resources/ai/assistants/canary-deploys.d.mts.map +1 -1
  23. package/resources/ai/assistants/canary-deploys.d.ts +241 -70
  24. package/resources/ai/assistants/canary-deploys.d.ts.map +1 -1
  25. package/resources/ai/assistants/index.d.mts +2 -2
  26. package/resources/ai/assistants/index.d.mts.map +1 -1
  27. package/resources/ai/assistants/index.d.ts +2 -2
  28. package/resources/ai/assistants/index.d.ts.map +1 -1
  29. package/resources/ai/assistants/index.js.map +1 -1
  30. package/resources/ai/assistants/index.mjs.map +1 -1
  31. package/resources/ai/assistants/versions.d.mts +220 -6
  32. package/resources/ai/assistants/versions.d.mts.map +1 -1
  33. package/resources/ai/assistants/versions.d.ts +220 -6
  34. package/resources/ai/assistants/versions.d.ts.map +1 -1
  35. package/resources/ai/index.d.mts +2 -2
  36. package/resources/ai/index.d.mts.map +1 -1
  37. package/resources/ai/index.d.ts +2 -2
  38. package/resources/ai/index.d.ts.map +1 -1
  39. package/resources/ai/index.js.map +1 -1
  40. package/resources/ai/index.mjs.map +1 -1
  41. package/resources/ai/openai/openai.d.mts +113 -2
  42. package/resources/ai/openai/openai.d.mts.map +1 -1
  43. package/resources/ai/openai/openai.d.ts +113 -2
  44. package/resources/ai/openai/openai.d.ts.map +1 -1
  45. package/resources/ai/openai/openai.js.map +1 -1
  46. package/resources/ai/openai/openai.mjs.map +1 -1
  47. package/resources/calls/actions.d.mts +398 -41
  48. package/resources/calls/actions.d.mts.map +1 -1
  49. package/resources/calls/actions.d.ts +398 -41
  50. package/resources/calls/actions.d.ts.map +1 -1
  51. package/resources/calls/actions.js +46 -0
  52. package/resources/calls/actions.js.map +1 -1
  53. package/resources/calls/actions.mjs +46 -0
  54. package/resources/calls/actions.mjs.map +1 -1
  55. package/resources/calls/calls.d.mts +2 -2
  56. package/resources/calls/calls.d.mts.map +1 -1
  57. package/resources/calls/calls.d.ts +2 -2
  58. package/resources/calls/calls.d.ts.map +1 -1
  59. package/resources/calls/calls.js.map +1 -1
  60. package/resources/calls/calls.mjs.map +1 -1
  61. package/resources/calls/index.d.mts +1 -1
  62. package/resources/calls/index.d.mts.map +1 -1
  63. package/resources/calls/index.d.ts +1 -1
  64. package/resources/calls/index.d.ts.map +1 -1
  65. package/resources/calls/index.js.map +1 -1
  66. package/resources/calls/index.mjs.map +1 -1
  67. package/resources/conferences/actions.d.mts +11 -1
  68. package/resources/conferences/actions.d.mts.map +1 -1
  69. package/resources/conferences/actions.d.ts +11 -1
  70. package/resources/conferences/actions.d.ts.map +1 -1
  71. package/resources/index.d.mts +5 -5
  72. package/resources/index.d.mts.map +1 -1
  73. package/resources/index.d.ts +5 -5
  74. package/resources/index.d.ts.map +1 -1
  75. package/resources/index.js.map +1 -1
  76. package/resources/index.mjs.map +1 -1
  77. package/resources/networks/networks.d.mts +2 -25
  78. package/resources/networks/networks.d.mts.map +1 -1
  79. package/resources/networks/networks.d.ts +2 -25
  80. package/resources/networks/networks.d.ts.map +1 -1
  81. package/resources/networks/networks.js.map +1 -1
  82. package/resources/networks/networks.mjs.map +1 -1
  83. package/resources/public-internet-gateways.d.mts +50 -40
  84. package/resources/public-internet-gateways.d.mts.map +1 -1
  85. package/resources/public-internet-gateways.d.ts +50 -40
  86. package/resources/public-internet-gateways.d.ts.map +1 -1
  87. package/resources/public-internet-gateways.js +1 -1
  88. package/resources/public-internet-gateways.js.map +1 -1
  89. package/resources/public-internet-gateways.mjs +1 -1
  90. package/resources/public-internet-gateways.mjs.map +1 -1
  91. package/resources/shared.d.mts +0 -10
  92. package/resources/shared.d.mts.map +1 -1
  93. package/resources/shared.d.ts +0 -10
  94. package/resources/shared.d.ts.map +1 -1
  95. package/resources/uac-connections/index.d.mts +1 -1
  96. package/resources/uac-connections/index.d.mts.map +1 -1
  97. package/resources/uac-connections/index.d.ts +1 -1
  98. package/resources/uac-connections/index.d.ts.map +1 -1
  99. package/resources/uac-connections/index.js.map +1 -1
  100. package/resources/uac-connections/index.mjs.map +1 -1
  101. package/resources/uac-connections/uac-connections.d.mts +1861 -211
  102. package/resources/uac-connections/uac-connections.d.mts.map +1 -1
  103. package/resources/uac-connections/uac-connections.d.ts +1861 -211
  104. package/resources/uac-connections/uac-connections.d.ts.map +1 -1
  105. package/resources/uac-connections/uac-connections.js +1 -1
  106. package/resources/uac-connections/uac-connections.js.map +1 -1
  107. package/resources/uac-connections/uac-connections.mjs +1 -1
  108. package/resources/uac-connections/uac-connections.mjs.map +1 -1
  109. package/resources/virtual-cross-connects.d.mts +504 -48
  110. package/resources/virtual-cross-connects.d.mts.map +1 -1
  111. package/resources/virtual-cross-connects.d.ts +504 -48
  112. package/resources/virtual-cross-connects.d.ts.map +1 -1
  113. package/resources/virtual-cross-connects.js +1 -1
  114. package/resources/virtual-cross-connects.js.map +1 -1
  115. package/resources/virtual-cross-connects.mjs +1 -1
  116. package/resources/virtual-cross-connects.mjs.map +1 -1
  117. package/resources/wireguard-interfaces.d.mts +127 -43
  118. package/resources/wireguard-interfaces.d.mts.map +1 -1
  119. package/resources/wireguard-interfaces.d.ts +127 -43
  120. package/resources/wireguard-interfaces.d.ts.map +1 -1
  121. package/resources/wireguard-interfaces.js +2 -5
  122. package/resources/wireguard-interfaces.js.map +1 -1
  123. package/resources/wireguard-interfaces.mjs +2 -5
  124. package/resources/wireguard-interfaces.mjs.map +1 -1
  125. package/src/client.ts +16 -27
  126. package/src/resources/ai/ai.ts +130 -139
  127. package/src/resources/ai/assistants/assistants.ts +362 -133
  128. package/src/resources/ai/assistants/canary-deploys.ts +266 -75
  129. package/src/resources/ai/assistants/index.ts +0 -10
  130. package/src/resources/ai/assistants/versions.ts +244 -6
  131. package/src/resources/ai/index.ts +0 -6
  132. package/src/resources/ai/openai/openai.ts +131 -2
  133. package/src/resources/calls/actions.ts +543 -76
  134. package/src/resources/calls/calls.ts +8 -4
  135. package/src/resources/calls/index.ts +4 -2
  136. package/src/resources/conferences/actions.ts +13 -1
  137. package/src/resources/index.ts +8 -13
  138. package/src/resources/networks/networks.ts +4 -31
  139. package/src/resources/public-internet-gateways.ts +55 -46
  140. package/src/resources/shared.ts +0 -12
  141. package/src/resources/uac-connections/index.ts +2 -6
  142. package/src/resources/uac-connections/uac-connections.ts +2377 -378
  143. package/src/resources/virtual-cross-connects.ts +595 -54
  144. package/src/resources/wireguard-interfaces.ts +158 -53
  145. package/src/version.ts +1 -1
  146. package/version.d.mts +1 -1
  147. package/version.d.ts +1 -1
  148. package/version.js +1 -1
  149. package/version.mjs +1 -1
@@ -500,6 +500,40 @@ export class Actions extends APIResource {
500
500
  return this._client.post(path`/calls/${callControlID}/actions/ai_assistant_start`, { body, ...options });
501
501
  }
502
502
 
503
+ /**
504
+ * Start a Conversation Relay session on an active call. Conversation Relay
505
+ * connects the call audio to your WebSocket so your application can exchange
506
+ * realtime messages with the caller while Telnyx handles speech recognition and
507
+ * text-to-speech. Only one AI Assistant or Conversation Relay session can be
508
+ * active on a call at a time.
509
+ *
510
+ * **Expected Webhooks:**
511
+ *
512
+ * - `conversation_relay.disconnected`
513
+ *
514
+ * @example
515
+ * ```ts
516
+ * const response =
517
+ * await client.calls.actions.startConversationRelay(
518
+ * 'call_control_id',
519
+ * {
520
+ * conversation_relay_url:
521
+ * 'wss://example.com/conversation-relay',
522
+ * },
523
+ * );
524
+ * ```
525
+ */
526
+ startConversationRelay(
527
+ callControlID: string,
528
+ body: ActionStartConversationRelayParams,
529
+ options?: RequestOptions,
530
+ ): APIPromise<ActionStartConversationRelayResponse> {
531
+ return this._client.post(path`/calls/${callControlID}/actions/conversation_relay_start`, {
532
+ body,
533
+ ...options,
534
+ });
535
+ }
536
+
503
537
  /**
504
538
  * Call forking allows you to stream the media from a call to a specific target in
505
539
  * realtime. This stream can be used to enable realtime audio analysis to support a
@@ -691,6 +725,28 @@ export class Actions extends APIResource {
691
725
  return this._client.post(path`/calls/${callControlID}/actions/ai_assistant_stop`, { body, ...options });
692
726
  }
693
727
 
728
+ /**
729
+ * Stop the active Conversation Relay session on a call.
730
+ *
731
+ * @example
732
+ * ```ts
733
+ * const response =
734
+ * await client.calls.actions.stopConversationRelay(
735
+ * 'call_control_id',
736
+ * );
737
+ * ```
738
+ */
739
+ stopConversationRelay(
740
+ callControlID: string,
741
+ body: ActionStopConversationRelayParams,
742
+ options?: RequestOptions,
743
+ ): APIPromise<ActionStopConversationRelayResponse> {
744
+ return this._client.post(path`/calls/${callControlID}/actions/conversation_relay_stop`, {
745
+ body,
746
+ ...options,
747
+ });
748
+ }
749
+
694
750
  /**
695
751
  * Stop forking a call.
696
752
  *
@@ -1463,24 +1519,6 @@ export namespace TranscriptionEngineAConfig {
1463
1519
  }
1464
1520
  }
1465
1521
 
1466
- export interface TranscriptionEngineAssemblyaiConfig {
1467
- /**
1468
- * Whether to send also interim results. If set to false, only final results will
1469
- * be sent.
1470
- */
1471
- interim_results?: boolean;
1472
-
1473
- /**
1474
- * Engine identifier for AssemblyAI transcription service
1475
- */
1476
- transcription_engine?: 'AssemblyAI';
1477
-
1478
- /**
1479
- * The model to use for transcription.
1480
- */
1481
- transcription_model?: 'assemblyai/universal-streaming';
1482
- }
1483
-
1484
1522
  export interface TranscriptionEngineAzureConfig {
1485
1523
  /**
1486
1524
  * Azure region to use for speech recognition
@@ -1694,54 +1732,6 @@ export interface TranscriptionEngineTelnyxConfig {
1694
1732
  transcription_model?: 'openai/whisper-tiny' | 'openai/whisper-large-v3-turbo';
1695
1733
  }
1696
1734
 
1697
- export interface TranscriptionEngineXaiConfig {
1698
- /**
1699
- * Whether to send also interim results. If set to false, only final results will
1700
- * be sent.
1701
- */
1702
- interim_results?: boolean;
1703
-
1704
- /**
1705
- * Language to use for speech recognition
1706
- */
1707
- language?:
1708
- | 'ar'
1709
- | 'cs'
1710
- | 'da'
1711
- | 'de'
1712
- | 'en'
1713
- | 'es'
1714
- | 'fa'
1715
- | 'fil'
1716
- | 'fr'
1717
- | 'hi'
1718
- | 'id'
1719
- | 'it'
1720
- | 'ja'
1721
- | 'ko'
1722
- | 'mk'
1723
- | 'ms'
1724
- | 'nl'
1725
- | 'pl'
1726
- | 'pt'
1727
- | 'ro'
1728
- | 'ru'
1729
- | 'sv'
1730
- | 'th'
1731
- | 'tr'
1732
- | 'vi';
1733
-
1734
- /**
1735
- * Engine identifier for xAI transcription service
1736
- */
1737
- transcription_engine?: 'xAI';
1738
-
1739
- /**
1740
- * The model to use for transcription.
1741
- */
1742
- transcription_model?: 'xai/grok-stt';
1743
- }
1744
-
1745
1735
  export interface TranscriptionStartRequest {
1746
1736
  /**
1747
1737
  * Use this field to add state to every subsequent webhook. It must be a valid
@@ -1765,8 +1755,8 @@ export interface TranscriptionStartRequest {
1765
1755
  | TranscriptionEngineGoogleConfig
1766
1756
  | TranscriptionEngineTelnyxConfig
1767
1757
  | TranscriptionEngineAzureConfig
1768
- | TranscriptionEngineXaiConfig
1769
- | TranscriptionEngineAssemblyaiConfig
1758
+ | TranscriptionStartRequest.TranscriptionEngineXaiConfig
1759
+ | TranscriptionStartRequest.TranscriptionEngineAssemblyaiConfig
1770
1760
  | TranscriptionEngineAConfig
1771
1761
  | TranscriptionEngineBConfig
1772
1762
  | DeepgramNova2Config
@@ -1780,6 +1770,74 @@ export interface TranscriptionStartRequest {
1780
1770
  transcription_tracks?: string;
1781
1771
  }
1782
1772
 
1773
+ export namespace TranscriptionStartRequest {
1774
+ export interface TranscriptionEngineXaiConfig {
1775
+ /**
1776
+ * Whether to send also interim results. If set to false, only final results will
1777
+ * be sent.
1778
+ */
1779
+ interim_results?: boolean;
1780
+
1781
+ /**
1782
+ * Language to use for speech recognition
1783
+ */
1784
+ language?:
1785
+ | 'ar'
1786
+ | 'cs'
1787
+ | 'da'
1788
+ | 'de'
1789
+ | 'en'
1790
+ | 'es'
1791
+ | 'fa'
1792
+ | 'fil'
1793
+ | 'fr'
1794
+ | 'hi'
1795
+ | 'id'
1796
+ | 'it'
1797
+ | 'ja'
1798
+ | 'ko'
1799
+ | 'mk'
1800
+ | 'ms'
1801
+ | 'nl'
1802
+ | 'pl'
1803
+ | 'pt'
1804
+ | 'ro'
1805
+ | 'ru'
1806
+ | 'sv'
1807
+ | 'th'
1808
+ | 'tr'
1809
+ | 'vi';
1810
+
1811
+ /**
1812
+ * Engine identifier for xAI transcription service
1813
+ */
1814
+ transcription_engine?: 'xAI';
1815
+
1816
+ /**
1817
+ * The model to use for transcription.
1818
+ */
1819
+ transcription_model?: 'xai/grok-stt';
1820
+ }
1821
+
1822
+ export interface TranscriptionEngineAssemblyaiConfig {
1823
+ /**
1824
+ * Whether to send also interim results. If set to false, only final results will
1825
+ * be sent.
1826
+ */
1827
+ interim_results?: boolean;
1828
+
1829
+ /**
1830
+ * Engine identifier for AssemblyAI transcription service
1831
+ */
1832
+ transcription_engine?: 'AssemblyAI';
1833
+
1834
+ /**
1835
+ * The model to use for transcription.
1836
+ */
1837
+ transcription_model?: 'assemblyai/universal-streaming';
1838
+ }
1839
+ }
1840
+
1783
1841
  export interface ActionAddAIAssistantMessagesResponse {
1784
1842
  data?: CallControlCommandResult;
1785
1843
  }
@@ -1868,6 +1926,21 @@ export interface ActionStartAIAssistantResponse {
1868
1926
  data?: CallControlCommandResultWithConversationID;
1869
1927
  }
1870
1928
 
1929
+ export interface ActionStartConversationRelayResponse {
1930
+ data?: ActionStartConversationRelayResponse.Data;
1931
+ }
1932
+
1933
+ export namespace ActionStartConversationRelayResponse {
1934
+ export interface Data {
1935
+ /**
1936
+ * The ID of the Conversation Relay session created by the command.
1937
+ */
1938
+ conversation_relay_id?: string;
1939
+
1940
+ result?: string;
1941
+ }
1942
+ }
1943
+
1871
1944
  export interface ActionStartForkingResponse {
1872
1945
  data?: CallControlCommandResult;
1873
1946
  }
@@ -1900,6 +1973,10 @@ export interface ActionStopAIAssistantResponse {
1900
1973
  data?: CallControlCommandResult;
1901
1974
  }
1902
1975
 
1976
+ export interface ActionStopConversationRelayResponse {
1977
+ data?: CallControlCommandResult;
1978
+ }
1979
+
1903
1980
  export interface ActionStopForkingResponse {
1904
1981
  data?: CallControlCommandResult;
1905
1982
  }
@@ -2720,7 +2797,7 @@ export interface ActionGatherUsingAIParams {
2720
2797
  | Shared.AzureVoiceSettings
2721
2798
  | Shared.RimeVoiceSettings
2722
2799
  | Shared.ResembleVoiceSettings
2723
- | Shared.XaiVoiceSettings;
2800
+ | ActionGatherUsingAIParams.XaiVoiceSettings;
2724
2801
  }
2725
2802
 
2726
2803
  export namespace ActionGatherUsingAIParams {
@@ -2735,6 +2812,18 @@ export namespace ActionGatherUsingAIParams {
2735
2812
  */
2736
2813
  role?: 'assistant' | 'user';
2737
2814
  }
2815
+
2816
+ export interface XaiVoiceSettings {
2817
+ /**
2818
+ * Voice settings provider type
2819
+ */
2820
+ type: 'xai';
2821
+
2822
+ /**
2823
+ * Language code, or `auto` to detect automatically.
2824
+ */
2825
+ language?: string;
2826
+ }
2738
2827
  }
2739
2828
 
2740
2829
  export interface ActionGatherUsingAudioParams {
@@ -2992,7 +3081,7 @@ export interface ActionGatherUsingSpeakParams {
2992
3081
  | Shared.RimeVoiceSettings
2993
3082
  | Shared.ResembleVoiceSettings
2994
3083
  | ActionGatherUsingSpeakParams.InworldVoiceSettings
2995
- | Shared.XaiVoiceSettings;
3084
+ | ActionGatherUsingSpeakParams.XaiVoiceSettings;
2996
3085
  }
2997
3086
 
2998
3087
  export namespace ActionGatherUsingSpeakParams {
@@ -3002,6 +3091,18 @@ export namespace ActionGatherUsingSpeakParams {
3002
3091
  */
3003
3092
  type: 'inworld';
3004
3093
  }
3094
+
3095
+ export interface XaiVoiceSettings {
3096
+ /**
3097
+ * Voice settings provider type
3098
+ */
3099
+ type: 'xai';
3100
+
3101
+ /**
3102
+ * Language code, or `auto` to detect automatically.
3103
+ */
3104
+ language?: string;
3105
+ }
3005
3106
  }
3006
3107
 
3007
3108
  export interface ActionHangupParams {
@@ -3375,7 +3476,7 @@ export interface ActionSpeakParams {
3375
3476
  | Shared.RimeVoiceSettings
3376
3477
  | Shared.ResembleVoiceSettings
3377
3478
  | ActionSpeakParams.InworldVoiceSettings
3378
- | Shared.XaiVoiceSettings;
3479
+ | ActionSpeakParams.XaiVoiceSettings;
3379
3480
  }
3380
3481
 
3381
3482
  export namespace ActionSpeakParams {
@@ -3385,6 +3486,18 @@ export namespace ActionSpeakParams {
3385
3486
  */
3386
3487
  type: 'inworld';
3387
3488
  }
3489
+
3490
+ export interface XaiVoiceSettings {
3491
+ /**
3492
+ * Voice settings provider type
3493
+ */
3494
+ type: 'xai';
3495
+
3496
+ /**
3497
+ * Language code, or `auto` to detect automatically.
3498
+ */
3499
+ language?: string;
3500
+ }
3388
3501
  }
3389
3502
 
3390
3503
  export interface ActionStartAIAssistantParams {
@@ -3490,7 +3603,7 @@ export interface ActionStartAIAssistantParams {
3490
3603
  | Shared.AzureVoiceSettings
3491
3604
  | Shared.RimeVoiceSettings
3492
3605
  | Shared.ResembleVoiceSettings
3493
- | Shared.XaiVoiceSettings;
3606
+ | ActionStartAIAssistantParams.XaiVoiceSettings;
3494
3607
  }
3495
3608
 
3496
3609
  export namespace ActionStartAIAssistantParams {
@@ -3658,6 +3771,276 @@ export namespace ActionStartAIAssistantParams {
3658
3771
  */
3659
3772
  on_hangup?: 'continue_conversation' | 'end_conversation';
3660
3773
  }
3774
+
3775
+ export interface XaiVoiceSettings {
3776
+ /**
3777
+ * Voice settings provider type
3778
+ */
3779
+ type: 'xai';
3780
+
3781
+ /**
3782
+ * Language code, or `auto` to detect automatically.
3783
+ */
3784
+ language?: string;
3785
+ }
3786
+ }
3787
+
3788
+ export interface ActionStartConversationRelayParams {
3789
+ /**
3790
+ * WebSocket URL for your Conversation Relay server. Must start with `ws://` or
3791
+ * `wss://`.
3792
+ */
3793
+ conversation_relay_url: string;
3794
+
3795
+ /**
3796
+ * Custom parameters for the Conversation Relay session. Pass key-value data as
3797
+ * `assistant.dynamic_variables` to make it available to the relay session.
3798
+ */
3799
+ assistant?: ActionStartConversationRelayParams.Assistant;
3800
+
3801
+ /**
3802
+ * Use this field to add state to subsequent webhooks. It must be a valid Base-64
3803
+ * encoded string.
3804
+ */
3805
+ client_state?: string;
3806
+
3807
+ /**
3808
+ * Use this field to avoid duplicate commands. Telnyx will ignore any command with
3809
+ * the same `command_id` for the same `call_control_id`.
3810
+ */
3811
+ command_id?: string;
3812
+
3813
+ /**
3814
+ * Enable DTMF detection for the relay session.
3815
+ */
3816
+ conversation_relay_dtmf_detection?: boolean;
3817
+
3818
+ /**
3819
+ * Text played when the relay session starts.
3820
+ */
3821
+ greeting?: string;
3822
+
3823
+ /**
3824
+ * Settings for handling caller interruptions during Conversation Relay speech.
3825
+ */
3826
+ interruption_settings?: ActionStartConversationRelayParams.InterruptionSettings;
3827
+
3828
+ /**
3829
+ * Default language for the relay session. This value is used for both
3830
+ * text-to-speech and speech recognition unless `tts_language` or
3831
+ * `transcription_language` are provided.
3832
+ */
3833
+ language?: string;
3834
+
3835
+ /**
3836
+ * Language-specific TTS and transcription settings. Use this when the relay
3837
+ * session needs per-language provider, voice, or speech model configuration.
3838
+ */
3839
+ languages?: Array<ActionStartConversationRelayParams.Language>;
3840
+
3841
+ /**
3842
+ * Participants to add to the conversation.
3843
+ */
3844
+ participants?: Array<ActionStartConversationRelayParams.Participant>;
3845
+
3846
+ /**
3847
+ * When true, sends message history update webhooks.
3848
+ */
3849
+ send_message_history_updates?: boolean;
3850
+
3851
+ /**
3852
+ * Speech-to-text settings for Conversation Relay.
3853
+ */
3854
+ transcription?: ActionStartConversationRelayParams.Transcription;
3855
+
3856
+ /**
3857
+ * Language to use for speech recognition. Overrides `language` for transcription
3858
+ * when provided.
3859
+ */
3860
+ transcription_language?: string;
3861
+
3862
+ /**
3863
+ * Language to use for text-to-speech. Overrides `language` for TTS when provided.
3864
+ */
3865
+ tts_language?: string;
3866
+
3867
+ /**
3868
+ * Time in milliseconds to wait for caller input before timing out.
3869
+ */
3870
+ user_response_timeout_ms?: number;
3871
+
3872
+ /**
3873
+ * The voice to be used by the voice assistant. Currently we support ElevenLabs,
3874
+ * Telnyx and AWS voices.
3875
+ *
3876
+ * **Supported Providers:**
3877
+ *
3878
+ * - **AWS:** Use `AWS.Polly.<VoiceId>` (e.g., `AWS.Polly.Joanna`). For neural
3879
+ * voices, which provide more realistic, human-like speech, append `-Neural` to
3880
+ * the `VoiceId` (e.g., `AWS.Polly.Joanna-Neural`). Check the
3881
+ * [available voices](https://docs.aws.amazon.com/polly/latest/dg/available-voices.html)
3882
+ * for compatibility.
3883
+ * - **Azure:** Use `Azure.<VoiceId>. (e.g. Azure.en-CA-ClaraNeural,
3884
+ * Azure.en-CA-LiamNeural, Azure.en-US-BrianMultilingualNeural,
3885
+ * Azure.en-US-Ava:DragonHDLatestNeural. For a complete list of voices, go to
3886
+ * [Azure Voice Gallery](https://speech.microsoft.com/portal/voicegallery).)
3887
+ * - **ElevenLabs:** Use `ElevenLabs.<ModelId>.<VoiceId>` (e.g.,
3888
+ * `ElevenLabs.BaseModel.John`). The `ModelId` part is optional. To use
3889
+ * ElevenLabs, you must provide your ElevenLabs API key as an integration secret
3890
+ * under `"voice_settings": {"api_key_ref": "<secret_id>"}`. See
3891
+ * [integration secrets documentation](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
3892
+ * for details. Check
3893
+ * [available voices](https://elevenlabs.io/docs/api-reference/get-voices).
3894
+ * - **Telnyx:** Use `Telnyx.<model_id>.<voice_id>`
3895
+ * - **Inworld:** Use `Inworld.<ModelId>.<VoiceId>` (e.g., `Inworld.Mini.Loretta`,
3896
+ * `Inworld.Max.Oliver`). Supported models: `Mini`, `Max`.
3897
+ * - **xAI:** Use `xAI.<VoiceId>` (e.g., `xAI.eve`). Available voices: `eve`,
3898
+ * `ara`, `rex`, `sal`, `leo`.
3899
+ */
3900
+ voice?: string;
3901
+
3902
+ /**
3903
+ * The settings associated with the voice selected
3904
+ */
3905
+ voice_settings?:
3906
+ | ElevenLabsVoiceSettings
3907
+ | TelnyxVoiceSettings
3908
+ | AwsVoiceSettings
3909
+ | Shared.AzureVoiceSettings
3910
+ | Shared.RimeVoiceSettings
3911
+ | Shared.ResembleVoiceSettings
3912
+ | ActionStartConversationRelayParams.XaiVoiceSettings;
3913
+ }
3914
+
3915
+ export namespace ActionStartConversationRelayParams {
3916
+ /**
3917
+ * Custom parameters for the Conversation Relay session. Pass key-value data as
3918
+ * `assistant.dynamic_variables` to make it available to the relay session.
3919
+ */
3920
+ export interface Assistant {
3921
+ /**
3922
+ * Custom key-value parameters forwarded to the Conversation Relay session.
3923
+ */
3924
+ dynamic_variables?: { [key: string]: string };
3925
+
3926
+ [k: string]: unknown;
3927
+ }
3928
+
3929
+ /**
3930
+ * Settings for handling caller interruptions during Conversation Relay speech.
3931
+ */
3932
+ export interface InterruptionSettings {
3933
+ /**
3934
+ * Legacy boolean form. `true` is equivalent to `interruptible=any`; `false` is
3935
+ * equivalent to `interruptible=none`.
3936
+ */
3937
+ enable?: boolean;
3938
+
3939
+ /**
3940
+ * Controls when caller input can interrupt assistant speech. `any` allows speech
3941
+ * or DTMF interruptions; `none` disables interruptions; `speech` allows speech
3942
+ * only; `dtmf` allows DTMF only.
3943
+ */
3944
+ interruptible?: 'none' | 'any' | 'speech' | 'dtmf';
3945
+
3946
+ /**
3947
+ * Controls when caller input can interrupt assistant speech. `any` allows speech
3948
+ * or DTMF interruptions; `none` disables interruptions; `speech` allows speech
3949
+ * only; `dtmf` allows DTMF only.
3950
+ */
3951
+ interruptible_greeting?: 'none' | 'any' | 'speech' | 'dtmf';
3952
+
3953
+ /**
3954
+ * Controls when caller input can interrupt assistant speech. `any` allows speech
3955
+ * or DTMF interruptions; `none` disables interruptions; `speech` allows speech
3956
+ * only; `dtmf` allows DTMF only.
3957
+ */
3958
+ welcome_greeting_interruptible?: 'none' | 'any' | 'speech' | 'dtmf';
3959
+ }
3960
+
3961
+ /**
3962
+ * Language-specific speech and transcription settings for Conversation Relay.
3963
+ */
3964
+ export interface Language {
3965
+ /**
3966
+ * BCP 47 language code.
3967
+ */
3968
+ code?: string;
3969
+
3970
+ /**
3971
+ * Speech recognition model for this language.
3972
+ */
3973
+ speech_model?: string;
3974
+
3975
+ /**
3976
+ * Speech-to-text provider for this language.
3977
+ */
3978
+ transcription_provider?: string;
3979
+
3980
+ /**
3981
+ * Text-to-speech provider for this language.
3982
+ */
3983
+ tts_provider?: string;
3984
+
3985
+ /**
3986
+ * Voice identifier for this language.
3987
+ */
3988
+ voice?: string;
3989
+ }
3990
+
3991
+ export interface Participant {
3992
+ /**
3993
+ * The call_control_id of the participant to add to the conversation.
3994
+ */
3995
+ id: string;
3996
+
3997
+ /**
3998
+ * The role of the participant in the conversation.
3999
+ */
4000
+ role: 'user';
4001
+
4002
+ /**
4003
+ * Display name for the participant.
4004
+ */
4005
+ name?: string;
4006
+
4007
+ /**
4008
+ * Determines what happens to the conversation when this participant hangs up.
4009
+ */
4010
+ on_hangup?: 'continue_conversation' | 'end_conversation';
4011
+ }
4012
+
4013
+ /**
4014
+ * Speech-to-text settings for Conversation Relay.
4015
+ */
4016
+ export interface Transcription {
4017
+ /**
4018
+ * Transcription language.
4019
+ */
4020
+ language?: string;
4021
+
4022
+ /**
4023
+ * Transcription model to use.
4024
+ */
4025
+ model?: string;
4026
+
4027
+ /**
4028
+ * Transcription provider to use.
4029
+ */
4030
+ provider?: string;
4031
+ }
4032
+
4033
+ export interface XaiVoiceSettings {
4034
+ /**
4035
+ * Voice settings provider type
4036
+ */
4037
+ type: 'xai';
4038
+
4039
+ /**
4040
+ * Language code, or `auto` to detect automatically.
4041
+ */
4042
+ language?: string;
4043
+ }
3661
4044
  }
3662
4045
 
3663
4046
  export interface ActionStartForkingParams {
@@ -4354,8 +4737,8 @@ export interface ActionStartTranscriptionParams {
4354
4737
  | TranscriptionEngineGoogleConfig
4355
4738
  | TranscriptionEngineTelnyxConfig
4356
4739
  | TranscriptionEngineAzureConfig
4357
- | TranscriptionEngineXaiConfig
4358
- | TranscriptionEngineAssemblyaiConfig
4740
+ | ActionStartTranscriptionParams.TranscriptionEngineXaiConfig
4741
+ | ActionStartTranscriptionParams.TranscriptionEngineAssemblyaiConfig
4359
4742
  | TranscriptionEngineAConfig
4360
4743
  | TranscriptionEngineBConfig
4361
4744
  | DeepgramNova2Config
@@ -4369,6 +4752,74 @@ export interface ActionStartTranscriptionParams {
4369
4752
  transcription_tracks?: string;
4370
4753
  }
4371
4754
 
4755
+ export namespace ActionStartTranscriptionParams {
4756
+ export interface TranscriptionEngineXaiConfig {
4757
+ /**
4758
+ * Whether to send also interim results. If set to false, only final results will
4759
+ * be sent.
4760
+ */
4761
+ interim_results?: boolean;
4762
+
4763
+ /**
4764
+ * Language to use for speech recognition
4765
+ */
4766
+ language?:
4767
+ | 'ar'
4768
+ | 'cs'
4769
+ | 'da'
4770
+ | 'de'
4771
+ | 'en'
4772
+ | 'es'
4773
+ | 'fa'
4774
+ | 'fil'
4775
+ | 'fr'
4776
+ | 'hi'
4777
+ | 'id'
4778
+ | 'it'
4779
+ | 'ja'
4780
+ | 'ko'
4781
+ | 'mk'
4782
+ | 'ms'
4783
+ | 'nl'
4784
+ | 'pl'
4785
+ | 'pt'
4786
+ | 'ro'
4787
+ | 'ru'
4788
+ | 'sv'
4789
+ | 'th'
4790
+ | 'tr'
4791
+ | 'vi';
4792
+
4793
+ /**
4794
+ * Engine identifier for xAI transcription service
4795
+ */
4796
+ transcription_engine?: 'xAI';
4797
+
4798
+ /**
4799
+ * The model to use for transcription.
4800
+ */
4801
+ transcription_model?: 'xai/grok-stt';
4802
+ }
4803
+
4804
+ export interface TranscriptionEngineAssemblyaiConfig {
4805
+ /**
4806
+ * Whether to send also interim results. If set to false, only final results will
4807
+ * be sent.
4808
+ */
4809
+ interim_results?: boolean;
4810
+
4811
+ /**
4812
+ * Engine identifier for AssemblyAI transcription service
4813
+ */
4814
+ transcription_engine?: 'AssemblyAI';
4815
+
4816
+ /**
4817
+ * The model to use for transcription.
4818
+ */
4819
+ transcription_model?: 'assemblyai/universal-streaming';
4820
+ }
4821
+ }
4822
+
4372
4823
  export interface ActionStopAIAssistantParams {
4373
4824
  /**
4374
4825
  * Use this field to add state to every subsequent webhook. It must be a valid
@@ -4383,6 +4834,20 @@ export interface ActionStopAIAssistantParams {
4383
4834
  command_id?: string;
4384
4835
  }
4385
4836
 
4837
+ export interface ActionStopConversationRelayParams {
4838
+ /**
4839
+ * Use this field to add state to subsequent webhooks. It must be a valid Base-64
4840
+ * encoded string.
4841
+ */
4842
+ client_state?: string;
4843
+
4844
+ /**
4845
+ * Use this field to avoid duplicate commands. Telnyx will ignore any command with
4846
+ * the same `command_id` for the same `call_control_id`.
4847
+ */
4848
+ command_id?: string;
4849
+ }
4850
+
4386
4851
  export interface ActionStopForkingParams {
4387
4852
  /**
4388
4853
  * Use this field to add state to every subsequent webhook. It must be a valid
@@ -4889,13 +5354,11 @@ export declare namespace Actions {
4889
5354
  type TelnyxVoiceSettings as TelnyxVoiceSettings,
4890
5355
  type TranscriptionConfig as TranscriptionConfig,
4891
5356
  type TranscriptionEngineAConfig as TranscriptionEngineAConfig,
4892
- type TranscriptionEngineAssemblyaiConfig as TranscriptionEngineAssemblyaiConfig,
4893
5357
  type TranscriptionEngineAzureConfig as TranscriptionEngineAzureConfig,
4894
5358
  type TranscriptionEngineBConfig as TranscriptionEngineBConfig,
4895
5359
  type TranscriptionEngineDeepgramConfig as TranscriptionEngineDeepgramConfig,
4896
5360
  type TranscriptionEngineGoogleConfig as TranscriptionEngineGoogleConfig,
4897
5361
  type TranscriptionEngineTelnyxConfig as TranscriptionEngineTelnyxConfig,
4898
- type TranscriptionEngineXaiConfig as TranscriptionEngineXaiConfig,
4899
5362
  type TranscriptionStartRequest as TranscriptionStartRequest,
4900
5363
  type ActionAddAIAssistantMessagesResponse as ActionAddAIAssistantMessagesResponse,
4901
5364
  type ActionAnswerResponse as ActionAnswerResponse,
@@ -4916,6 +5379,7 @@ export declare namespace Actions {
4916
5379
  type ActionSendSipInfoResponse as ActionSendSipInfoResponse,
4917
5380
  type ActionSpeakResponse as ActionSpeakResponse,
4918
5381
  type ActionStartAIAssistantResponse as ActionStartAIAssistantResponse,
5382
+ type ActionStartConversationRelayResponse as ActionStartConversationRelayResponse,
4919
5383
  type ActionStartForkingResponse as ActionStartForkingResponse,
4920
5384
  type ActionStartNoiseSuppressionResponse as ActionStartNoiseSuppressionResponse,
4921
5385
  type ActionStartPlaybackResponse as ActionStartPlaybackResponse,
@@ -4924,6 +5388,7 @@ export declare namespace Actions {
4924
5388
  type ActionStartStreamingResponse as ActionStartStreamingResponse,
4925
5389
  type ActionStartTranscriptionResponse as ActionStartTranscriptionResponse,
4926
5390
  type ActionStopAIAssistantResponse as ActionStopAIAssistantResponse,
5391
+ type ActionStopConversationRelayResponse as ActionStopConversationRelayResponse,
4927
5392
  type ActionStopForkingResponse as ActionStopForkingResponse,
4928
5393
  type ActionStopGatherResponse as ActionStopGatherResponse,
4929
5394
  type ActionStopNoiseSuppressionResponse as ActionStopNoiseSuppressionResponse,
@@ -4954,6 +5419,7 @@ export declare namespace Actions {
4954
5419
  type ActionSendSipInfoParams as ActionSendSipInfoParams,
4955
5420
  type ActionSpeakParams as ActionSpeakParams,
4956
5421
  type ActionStartAIAssistantParams as ActionStartAIAssistantParams,
5422
+ type ActionStartConversationRelayParams as ActionStartConversationRelayParams,
4957
5423
  type ActionStartForkingParams as ActionStartForkingParams,
4958
5424
  type ActionStartNoiseSuppressionParams as ActionStartNoiseSuppressionParams,
4959
5425
  type ActionStartPlaybackParams as ActionStartPlaybackParams,
@@ -4962,6 +5428,7 @@ export declare namespace Actions {
4962
5428
  type ActionStartStreamingParams as ActionStartStreamingParams,
4963
5429
  type ActionStartTranscriptionParams as ActionStartTranscriptionParams,
4964
5430
  type ActionStopAIAssistantParams as ActionStopAIAssistantParams,
5431
+ type ActionStopConversationRelayParams as ActionStopConversationRelayParams,
4965
5432
  type ActionStopForkingParams as ActionStopForkingParams,
4966
5433
  type ActionStopGatherParams as ActionStopGatherParams,
4967
5434
  type ActionStopNoiseSuppressionParams as ActionStopNoiseSuppressionParams,