telnyx 6.41.1 → 6.43.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 (256) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +11 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +11 -0
  9. package/client.mjs.map +1 -1
  10. package/core/EventEmitter.d.mts +11 -0
  11. package/core/EventEmitter.d.mts.map +1 -1
  12. package/core/EventEmitter.d.ts +11 -0
  13. package/core/EventEmitter.d.ts.map +1 -1
  14. package/core/EventEmitter.js +15 -1
  15. package/core/EventEmitter.js.map +1 -1
  16. package/core/EventEmitter.mjs +13 -0
  17. package/core/EventEmitter.mjs.map +1 -1
  18. package/internal/types.d.mts +6 -6
  19. package/internal/types.d.mts.map +1 -1
  20. package/internal/types.d.ts +6 -6
  21. package/internal/types.d.ts.map +1 -1
  22. package/internal/utils/env.js +2 -2
  23. package/internal/utils/env.js.map +1 -1
  24. package/internal/utils/env.mjs +2 -2
  25. package/internal/utils/env.mjs.map +1 -1
  26. package/internal/ws-adapter-browser.d.mts +34 -0
  27. package/internal/ws-adapter-browser.d.mts.map +1 -0
  28. package/internal/ws-adapter-browser.d.ts +34 -0
  29. package/internal/ws-adapter-browser.d.ts.map +1 -0
  30. package/internal/ws-adapter-browser.js +88 -0
  31. package/internal/ws-adapter-browser.js.map +1 -0
  32. package/internal/ws-adapter-browser.mjs +84 -0
  33. package/internal/ws-adapter-browser.mjs.map +1 -0
  34. package/internal/ws-adapter-node.d.mts +27 -0
  35. package/internal/ws-adapter-node.d.mts.map +1 -0
  36. package/internal/ws-adapter-node.d.ts +27 -0
  37. package/internal/ws-adapter-node.d.ts.map +1 -0
  38. package/internal/ws-adapter-node.js +90 -0
  39. package/internal/ws-adapter-node.js.map +1 -0
  40. package/internal/ws-adapter-node.mjs +86 -0
  41. package/internal/ws-adapter-node.mjs.map +1 -0
  42. package/internal/ws-adapter.d.mts +24 -0
  43. package/internal/ws-adapter.d.mts.map +1 -0
  44. package/internal/ws-adapter.d.ts +24 -0
  45. package/internal/ws-adapter.d.ts.map +1 -0
  46. package/internal/ws-adapter.js +11 -0
  47. package/internal/ws-adapter.js.map +1 -0
  48. package/internal/ws-adapter.mjs +8 -0
  49. package/internal/ws-adapter.mjs.map +1 -0
  50. package/internal/ws.d.mts +80 -0
  51. package/internal/ws.d.mts.map +1 -0
  52. package/internal/ws.d.ts +80 -0
  53. package/internal/ws.d.ts.map +1 -0
  54. package/internal/ws.js +153 -0
  55. package/internal/ws.js.map +1 -0
  56. package/internal/ws.mjs +147 -0
  57. package/internal/ws.mjs.map +1 -0
  58. package/lib/text-to-speech-ws-base.d.mts +106 -0
  59. package/lib/text-to-speech-ws-base.d.mts.map +1 -0
  60. package/lib/text-to-speech-ws-base.d.ts +106 -0
  61. package/lib/text-to-speech-ws-base.d.ts.map +1 -0
  62. package/lib/text-to-speech-ws-base.js +475 -0
  63. package/lib/text-to-speech-ws-base.js.map +1 -0
  64. package/lib/text-to-speech-ws-base.mjs +471 -0
  65. package/lib/text-to-speech-ws-base.mjs.map +1 -0
  66. package/lib/text-to-speech-ws-internal.d.mts +71 -0
  67. package/lib/text-to-speech-ws-internal.d.mts.map +1 -0
  68. package/lib/text-to-speech-ws-internal.d.ts +71 -0
  69. package/lib/text-to-speech-ws-internal.d.ts.map +1 -0
  70. package/lib/text-to-speech-ws-internal.js +47 -0
  71. package/lib/text-to-speech-ws-internal.js.map +1 -0
  72. package/lib/text-to-speech-ws-internal.mjs +41 -0
  73. package/lib/text-to-speech-ws-internal.mjs.map +1 -0
  74. package/lib/text-to-speech-ws.d.mts +13 -0
  75. package/lib/text-to-speech-ws.d.mts.map +1 -0
  76. package/lib/text-to-speech-ws.d.ts +13 -0
  77. package/lib/text-to-speech-ws.d.ts.map +1 -0
  78. package/lib/text-to-speech-ws.js +30 -0
  79. package/lib/text-to-speech-ws.js.map +1 -0
  80. package/lib/text-to-speech-ws.mjs +25 -0
  81. package/lib/text-to-speech-ws.mjs.map +1 -0
  82. package/lib/webhooks.d.mts +6 -0
  83. package/lib/webhooks.d.mts.map +1 -1
  84. package/lib/webhooks.d.ts +6 -0
  85. package/lib/webhooks.d.ts.map +1 -1
  86. package/lib/webhooks.js +16 -0
  87. package/lib/webhooks.js.map +1 -1
  88. package/lib/webhooks.mjs +14 -0
  89. package/lib/webhooks.mjs.map +1 -1
  90. package/package.json +1 -1
  91. package/resources/ai/assistants/assistants.d.mts +938 -65
  92. package/resources/ai/assistants/assistants.d.mts.map +1 -1
  93. package/resources/ai/assistants/assistants.d.ts +938 -65
  94. package/resources/ai/assistants/assistants.d.ts.map +1 -1
  95. package/resources/ai/assistants/assistants.js +0 -1
  96. package/resources/ai/assistants/assistants.js.map +1 -1
  97. package/resources/ai/assistants/assistants.mjs +0 -1
  98. package/resources/ai/assistants/assistants.mjs.map +1 -1
  99. package/resources/ai/assistants/versions.d.mts +563 -25
  100. package/resources/ai/assistants/versions.d.mts.map +1 -1
  101. package/resources/ai/assistants/versions.d.ts +563 -25
  102. package/resources/ai/assistants/versions.d.ts.map +1 -1
  103. package/resources/ai/conversations/conversations.d.mts +2 -2
  104. package/resources/ai/conversations/conversations.d.mts.map +1 -1
  105. package/resources/ai/conversations/conversations.d.ts +2 -2
  106. package/resources/ai/conversations/conversations.d.ts.map +1 -1
  107. package/resources/ai/conversations/conversations.js.map +1 -1
  108. package/resources/ai/conversations/conversations.mjs +1 -1
  109. package/resources/ai/conversations/conversations.mjs.map +1 -1
  110. package/resources/ai/conversations/index.d.mts +1 -1
  111. package/resources/ai/conversations/index.d.mts.map +1 -1
  112. package/resources/ai/conversations/index.d.ts +1 -1
  113. package/resources/ai/conversations/index.d.ts.map +1 -1
  114. package/resources/ai/conversations/index.js.map +1 -1
  115. package/resources/ai/conversations/index.mjs +1 -1
  116. package/resources/ai/conversations/index.mjs.map +1 -1
  117. package/resources/ai/conversations/messages.d.mts +46 -48
  118. package/resources/ai/conversations/messages.d.mts.map +1 -1
  119. package/resources/ai/conversations/messages.d.ts +46 -48
  120. package/resources/ai/conversations/messages.d.ts.map +1 -1
  121. package/resources/ai/conversations/messages.js +9 -6
  122. package/resources/ai/conversations/messages.js.map +1 -1
  123. package/resources/ai/conversations/messages.mjs +9 -6
  124. package/resources/ai/conversations/messages.mjs.map +1 -1
  125. package/resources/calls/actions.d.mts +114 -6
  126. package/resources/calls/actions.d.mts.map +1 -1
  127. package/resources/calls/actions.d.ts +114 -6
  128. package/resources/calls/actions.d.ts.map +1 -1
  129. package/resources/calls/actions.js +4 -0
  130. package/resources/calls/actions.js.map +1 -1
  131. package/resources/calls/actions.mjs +4 -0
  132. package/resources/calls/actions.mjs.map +1 -1
  133. package/resources/calls/calls.d.mts +168 -8
  134. package/resources/calls/calls.d.mts.map +1 -1
  135. package/resources/calls/calls.d.ts +168 -8
  136. package/resources/calls/calls.d.ts.map +1 -1
  137. package/resources/calls/calls.js +4 -0
  138. package/resources/calls/calls.js.map +1 -1
  139. package/resources/calls/calls.mjs +4 -0
  140. package/resources/calls/calls.mjs.map +1 -1
  141. package/resources/index.d.mts +2 -3
  142. package/resources/index.d.mts.map +1 -1
  143. package/resources/index.d.ts +2 -3
  144. package/resources/index.d.ts.map +1 -1
  145. package/resources/index.js +2 -7
  146. package/resources/index.js.map +1 -1
  147. package/resources/index.mjs +1 -2
  148. package/resources/index.mjs.map +1 -1
  149. package/resources/messages/messages.d.mts +4 -0
  150. package/resources/messages/messages.d.mts.map +1 -1
  151. package/resources/messages/messages.d.ts +4 -0
  152. package/resources/messages/messages.d.ts.map +1 -1
  153. package/resources/messages/messages.js.map +1 -1
  154. package/resources/messages/messages.mjs.map +1 -1
  155. package/resources/session-analysis/session-analysis.d.mts +3 -13
  156. package/resources/session-analysis/session-analysis.d.mts.map +1 -1
  157. package/resources/session-analysis/session-analysis.d.ts +3 -13
  158. package/resources/session-analysis/session-analysis.d.ts.map +1 -1
  159. package/resources/session-analysis/session-analysis.js.map +1 -1
  160. package/resources/session-analysis/session-analysis.mjs.map +1 -1
  161. package/resources/texml/accounts/calls/calls.d.mts +45 -0
  162. package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
  163. package/resources/texml/accounts/calls/calls.d.ts +45 -0
  164. package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
  165. package/resources/texml/accounts/calls/calls.js.map +1 -1
  166. package/resources/texml/accounts/calls/calls.mjs.map +1 -1
  167. package/resources/text-to-speech/index.d.mts +2 -1
  168. package/resources/text-to-speech/index.d.mts.map +1 -1
  169. package/resources/text-to-speech/index.d.ts +2 -1
  170. package/resources/text-to-speech/index.d.ts.map +1 -1
  171. package/resources/text-to-speech/index.js.map +1 -1
  172. package/resources/text-to-speech/index.mjs.map +1 -1
  173. package/resources/text-to-speech/internal-base.d.mts +1 -48
  174. package/resources/text-to-speech/internal-base.d.mts.map +1 -1
  175. package/resources/text-to-speech/internal-base.d.ts +1 -48
  176. package/resources/text-to-speech/internal-base.d.ts.map +1 -1
  177. package/resources/text-to-speech/internal-base.js +5 -48
  178. package/resources/text-to-speech/internal-base.js.map +1 -1
  179. package/resources/text-to-speech/internal-base.mjs +1 -44
  180. package/resources/text-to-speech/internal-base.mjs.map +1 -1
  181. package/resources/text-to-speech/text-to-speech.d.mts +28 -3
  182. package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
  183. package/resources/text-to-speech/text-to-speech.d.ts +28 -3
  184. package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
  185. package/resources/text-to-speech/text-to-speech.js +1 -1
  186. package/resources/text-to-speech/text-to-speech.mjs +1 -1
  187. package/resources/text-to-speech/ws-base.d.mts +2 -0
  188. package/resources/text-to-speech/ws-base.d.mts.map +1 -0
  189. package/resources/text-to-speech/ws-base.d.ts +2 -0
  190. package/resources/text-to-speech/ws-base.d.ts.map +1 -0
  191. package/resources/text-to-speech/ws-base.js +7 -0
  192. package/resources/text-to-speech/ws-base.js.map +1 -0
  193. package/resources/text-to-speech/ws-base.mjs +3 -0
  194. package/resources/text-to-speech/ws-base.mjs.map +1 -0
  195. package/resources/text-to-speech/ws.d.mts +2 -41
  196. package/resources/text-to-speech/ws.d.mts.map +1 -1
  197. package/resources/text-to-speech/ws.d.ts +2 -41
  198. package/resources/text-to-speech/ws.d.ts.map +1 -1
  199. package/resources/text-to-speech/ws.js +2 -182
  200. package/resources/text-to-speech/ws.js.map +1 -1
  201. package/resources/text-to-speech/ws.mjs +1 -180
  202. package/resources/text-to-speech/ws.mjs.map +1 -1
  203. package/resources/verify-profiles.d.mts +97 -121
  204. package/resources/verify-profiles.d.mts.map +1 -1
  205. package/resources/verify-profiles.d.ts +97 -121
  206. package/resources/verify-profiles.d.ts.map +1 -1
  207. package/resources/webhooks.d.mts +642 -7
  208. package/resources/webhooks.d.mts.map +1 -1
  209. package/resources/webhooks.d.ts +642 -7
  210. package/resources/webhooks.d.ts.map +1 -1
  211. package/resources/webhooks.js +4 -10
  212. package/resources/webhooks.js.map +1 -1
  213. package/resources/webhooks.mjs +5 -11
  214. package/resources/webhooks.mjs.map +1 -1
  215. package/resources/whatsapp/phone-numbers/profile/profile.d.mts +5 -0
  216. package/resources/whatsapp/phone-numbers/profile/profile.d.mts.map +1 -1
  217. package/resources/whatsapp/phone-numbers/profile/profile.d.ts +5 -0
  218. package/resources/whatsapp/phone-numbers/profile/profile.d.ts.map +1 -1
  219. package/resources/whatsapp/phone-numbers/profile/profile.js.map +1 -1
  220. package/resources/whatsapp/phone-numbers/profile/profile.mjs.map +1 -1
  221. package/src/client.ts +22 -0
  222. package/src/core/EventEmitter.ts +16 -0
  223. package/src/internal/types.ts +6 -8
  224. package/src/internal/utils/env.ts +2 -2
  225. package/src/internal/ws-adapter-browser.ts +123 -0
  226. package/src/internal/ws-adapter-node.ts +105 -0
  227. package/src/internal/ws-adapter.ts +30 -0
  228. package/src/internal/ws.ts +193 -0
  229. package/src/lib/text-to-speech-ws-base.ts +618 -0
  230. package/src/lib/text-to-speech-ws-internal.ts +111 -0
  231. package/src/lib/text-to-speech-ws.ts +40 -0
  232. package/src/lib/webhooks.ts +27 -0
  233. package/src/resources/ai/assistants/assistants.ts +1065 -65
  234. package/src/resources/ai/assistants/versions.ts +639 -25
  235. package/src/resources/ai/conversations/conversations.ts +12 -2
  236. package/src/resources/ai/conversations/index.ts +6 -1
  237. package/src/resources/ai/conversations/messages.ts +67 -54
  238. package/src/resources/calls/actions.ts +184 -4
  239. package/src/resources/calls/calls.ts +191 -4
  240. package/src/resources/index.ts +6 -12
  241. package/src/resources/messages/messages.ts +5 -0
  242. package/src/resources/session-analysis/session-analysis.ts +3 -16
  243. package/src/resources/texml/accounts/calls/calls.ts +54 -0
  244. package/src/resources/text-to-speech/index.ts +2 -1
  245. package/src/resources/text-to-speech/internal-base.ts +6 -95
  246. package/src/resources/text-to-speech/text-to-speech.ts +33 -3
  247. package/src/resources/text-to-speech/ws-base.ts +7 -0
  248. package/src/resources/text-to-speech/ws.ts +2 -201
  249. package/src/resources/verify-profiles.ts +109 -142
  250. package/src/resources/webhooks.ts +886 -45
  251. package/src/resources/whatsapp/phone-numbers/profile/profile.ts +7 -0
  252. package/src/version.ts +1 -1
  253. package/version.d.mts +1 -1
  254. package/version.d.ts +1 -1
  255. package/version.js +1 -1
  256. package/version.mjs +1 -1
@@ -33,7 +33,6 @@ export declare class Assistants extends APIResource {
33
33
  * const inferenceEmbedding =
34
34
  * await client.ai.assistants.create({
35
35
  * instructions: 'instructions',
36
- * model: 'model',
37
36
  * name: 'name',
38
37
  * });
39
38
  * ```
@@ -240,9 +239,11 @@ export declare namespace AssistantTool {
240
239
  from: string;
241
240
  /**
242
241
  * The different possible targets of the transfer. The assistant will be able to
243
- * choose one of the targets to transfer the call to.
242
+ * choose one of the targets to transfer the call to. This can also be a dynamic
243
+ * variable string like `{{ targets }}` where `targets` is returned by the dynamic
244
+ * variables webhook and resolves to an array of target objects at runtime.
244
245
  */
245
- targets: Array<Transfer.Target>;
246
+ targets: Array<Transfer.UnionMember0> | string;
246
247
  /**
247
248
  * Custom headers to be added to the SIP INVITE for the transfer command.
248
249
  */
@@ -267,15 +268,15 @@ export declare namespace AssistantTool {
267
268
  warm_transfer_instructions?: string;
268
269
  }
269
270
  namespace Transfer {
270
- interface Target {
271
+ interface UnionMember0 {
271
272
  /**
272
- * The name of the target.
273
+ * The destination number or SIP URI of the call.
273
274
  */
274
- name?: string;
275
+ to: string;
275
276
  /**
276
- * The destination number or SIP URI of the call.
277
+ * The name of the target.
277
278
  */
278
- to?: string;
279
+ name?: string;
279
280
  }
280
281
  interface CustomHeader {
281
282
  name?: string;
@@ -410,6 +411,15 @@ export declare namespace AssistantTool {
410
411
  * Number or SIP URI placing the call.
411
412
  */
412
413
  from?: string;
414
+ /**
415
+ * The different possible targets of the invite. The assistant will be able to
416
+ * choose one of the targets to invite to the call. This can also be a dynamic
417
+ * variable string like `{{ targets }}` where `targets` is returned by the dynamic
418
+ * variables webhook and resolves to an array of target objects at runtime. If
419
+ * omitted or null, the invite tool can still be configured and targets may be
420
+ * supplied dynamically at runtime.
421
+ */
422
+ targets?: Array<InviteConfig.UnionMember0> | string | null;
413
423
  /**
414
424
  * Configuration for voicemail detection (AMD - Answering Machine Detection) on the
415
425
  * invited call.
@@ -427,6 +437,16 @@ export declare namespace AssistantTool {
427
437
  */
428
438
  value?: string;
429
439
  }
440
+ interface UnionMember0 {
441
+ /**
442
+ * The destination number or SIP URI of the call.
443
+ */
444
+ to: string;
445
+ /**
446
+ * The name of the target.
447
+ */
448
+ name?: string;
449
+ }
430
450
  /**
431
451
  * Configuration for voicemail detection (AMD - Answering Machine Detection) on the
432
452
  * invited call.
@@ -607,9 +627,11 @@ export interface InferenceEmbedding {
607
627
  */
608
628
  instructions: string;
609
629
  /**
610
- * ID of the model to use. You can use the
630
+ * ID of the model to use when `external_llm` is not set. You can use the
611
631
  * [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
612
- * to see all of your available models,
632
+ * to see available models. If `external_llm` is provided, the assistant uses
633
+ * `external_llm` instead of this field. If neither `model` nor `external_llm` is
634
+ * provided, Telnyx applies the default model.
613
635
  */
614
636
  model: string;
615
637
  name: string;
@@ -621,13 +643,26 @@ export interface InferenceEmbedding {
621
643
  [key: string]: unknown;
622
644
  };
623
645
  /**
624
- * If the dynamic_variables_webhook_url is set for the assistant, we will send a
625
- * request at the start of the conversation. See our
626
- * [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
627
- * for more information.
646
+ * Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
647
+ * 10000 ms. If the webhook does not respond within this timeout, the call proceeds
648
+ * with default values. See the
649
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
650
+ */
651
+ dynamic_variables_webhook_timeout_ms?: number;
652
+ /**
653
+ * If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
654
+ * URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
655
+ * the webhook response must wrap variables under a top-level `dynamic_variables`
656
+ * object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
657
+ * flat object will be ignored and variables will fall back to their defaults. See
658
+ * the
659
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
660
+ * for the full request/response format and timeout behavior.
628
661
  */
629
662
  dynamic_variables_webhook_url?: string;
630
663
  enabled_features?: Array<EnabledFeatures>;
664
+ external_llm?: InferenceEmbedding.ExternalLlm;
665
+ fallback_config?: InferenceEmbedding.FallbackConfig;
631
666
  /**
632
667
  * Text that the assistant will use to start the conversation. This may be
633
668
  * templated with
@@ -640,29 +675,290 @@ export interface InferenceEmbedding {
640
675
  import_metadata?: ImportMetadata;
641
676
  insight_settings?: InsightSettings;
642
677
  /**
643
- * This is only needed when using third-party inference providers. The `identifier`
644
- * for an integration secret
678
+ * Connected integrations attached to the assistant. The catalog of available
679
+ * integrations is at `/ai/integrations`; the user's connected integrations are at
680
+ * `/ai/integrations/connections`. Each item references a catalog integration by
681
+ * `integration_id`.
682
+ */
683
+ integrations?: Array<InferenceEmbedding.Integration>;
684
+ /**
685
+ * Settings for interruptions and how the assistant decides the user has finished
686
+ * speaking. These timings are most relevant when using non turn-taking
687
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
688
+ * behavior is controlled by the transcription end-of-turn settings under
689
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
690
+ * `eager_eot_threshold`).
691
+ */
692
+ interruption_settings?: InferenceEmbedding.InterruptionSettings;
693
+ /**
694
+ * This is only needed when using third-party inference providers selected by
695
+ * `model`. The `identifier` for an integration secret
645
696
  * [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
646
- * that refers to your LLM provider's API key. Warning: Free plans are unlikely to
647
- * work with this integration.
697
+ * that refers to your LLM provider's API key. For bring-your-own endpoint
698
+ * authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
699
+ * are unlikely to work with this integration.
648
700
  */
649
701
  llm_api_key_ref?: string;
702
+ /**
703
+ * MCP servers attached to the assistant. Create MCP servers with
704
+ * `/ai/mcp_servers`, then reference them by `id` here.
705
+ */
706
+ mcp_servers?: Array<InferenceEmbedding.McpServer>;
650
707
  messaging_settings?: MessagingSettings;
651
708
  observability_settings?: Observability;
709
+ /**
710
+ * Configuration for post-conversation processing. When enabled, the assistant
711
+ * receives one additional LLM turn after the conversation ends, allowing it to
712
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
713
+ * can execute multiple parallel or sequential tools during this phase.
714
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
715
+ * post-conversation. Beta feature.
716
+ */
717
+ post_conversation_settings?: InferenceEmbedding.PostConversationSettings;
652
718
  privacy_settings?: PrivacySettings;
719
+ /**
720
+ * IDs of missions related to this assistant.
721
+ */
722
+ related_mission_ids?: Array<string>;
723
+ /**
724
+ * Tags associated with the assistant. Tags can also be managed with the assistant
725
+ * tag endpoints.
726
+ */
727
+ tags?: Array<string>;
653
728
  telephony_settings?: TelephonySettings;
654
729
  /**
655
- * The tools that the assistant can use. These may be templated with
656
- * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
730
+ * Deprecated for new integrations. Inline tool definitions available to the
731
+ * assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
732
+ * endpoints.
657
733
  */
658
734
  tools?: Array<AssistantTool>;
659
735
  transcription?: TranscriptionSettings;
736
+ /**
737
+ * Timestamp when this assistant version was created.
738
+ */
739
+ version_created_at?: string;
740
+ /**
741
+ * Identifier for the assistant version returned by version-aware assistant
742
+ * endpoints.
743
+ */
744
+ version_id?: string;
745
+ /**
746
+ * Human-readable name for the assistant version.
747
+ */
748
+ version_name?: string;
660
749
  voice_settings?: VoiceSettings;
661
750
  /**
662
751
  * Configuration settings for the assistant's web widget.
663
752
  */
664
753
  widget_settings?: WidgetSettings;
665
754
  }
755
+ export declare namespace InferenceEmbedding {
756
+ interface ExternalLlm {
757
+ /**
758
+ * Base URL for the external LLM endpoint.
759
+ */
760
+ base_url: string;
761
+ /**
762
+ * Model identifier to use with the external LLM endpoint.
763
+ */
764
+ model: string;
765
+ /**
766
+ * Authentication method used when connecting to the external LLM endpoint.
767
+ */
768
+ authentication_method?: 'token' | 'certificate';
769
+ /**
770
+ * Integration secret identifier for the client certificate used with certificate
771
+ * authentication.
772
+ */
773
+ certificate_ref?: string;
774
+ /**
775
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
776
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
777
+ * request body. Defaults to `false`. Example payload sent to the external
778
+ * endpoint:
779
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
780
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
781
+ * limits.
782
+ */
783
+ forward_metadata?: boolean;
784
+ /**
785
+ * Integration secret identifier for the external LLM API key.
786
+ */
787
+ llm_api_key_ref?: string;
788
+ /**
789
+ * URL used to retrieve an access token when certificate authentication is enabled.
790
+ */
791
+ token_retrieval_url?: string;
792
+ }
793
+ interface FallbackConfig {
794
+ external_llm?: FallbackConfig.ExternalLlm;
795
+ /**
796
+ * Integration secret identifier for the fallback model API key.
797
+ */
798
+ llm_api_key_ref?: string;
799
+ /**
800
+ * Fallback Telnyx-hosted model to use when the primary LLM provider is
801
+ * unavailable.
802
+ */
803
+ model?: string;
804
+ }
805
+ namespace FallbackConfig {
806
+ interface ExternalLlm {
807
+ /**
808
+ * Base URL for the external LLM endpoint.
809
+ */
810
+ base_url: string;
811
+ /**
812
+ * Model identifier to use with the external LLM endpoint.
813
+ */
814
+ model: string;
815
+ /**
816
+ * Authentication method used when connecting to the external LLM endpoint.
817
+ */
818
+ authentication_method?: 'token' | 'certificate';
819
+ /**
820
+ * Integration secret identifier for the client certificate used with certificate
821
+ * authentication.
822
+ */
823
+ certificate_ref?: string;
824
+ /**
825
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
826
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
827
+ * request body. Defaults to `false`. Example payload sent to the external
828
+ * endpoint:
829
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
830
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
831
+ * limits.
832
+ */
833
+ forward_metadata?: boolean;
834
+ /**
835
+ * Integration secret identifier for the external LLM API key.
836
+ */
837
+ llm_api_key_ref?: string;
838
+ /**
839
+ * URL used to retrieve an access token when certificate authentication is enabled.
840
+ */
841
+ token_retrieval_url?: string;
842
+ }
843
+ }
844
+ /**
845
+ * Reference to a connected integration attached to an assistant. Discover
846
+ * available integrations with `/ai/integrations` and connected integrations with
847
+ * `/ai/integrations/connections`.
848
+ */
849
+ interface Integration {
850
+ /**
851
+ * Catalog integration ID to attach. This is the `id` from the integrations catalog
852
+ * at `/ai/integrations` (the same value also appears as `integration_id` on
853
+ * entries returned by `/ai/integrations/connections`). It is **not** the
854
+ * connection-level `id` from `/ai/integrations/connections`.
855
+ */
856
+ integration_id: string;
857
+ /**
858
+ * Optional per-assistant allowlist of integration tool names. When omitted or
859
+ * empty, all tools allowed by the connected integration are available to the
860
+ * assistant.
861
+ */
862
+ allowed_list?: Array<string>;
863
+ }
864
+ /**
865
+ * Settings for interruptions and how the assistant decides the user has finished
866
+ * speaking. These timings are most relevant when using non turn-taking
867
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
868
+ * behavior is controlled by the transcription end-of-turn settings under
869
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
870
+ * `eager_eot_threshold`).
871
+ */
872
+ interface InterruptionSettings {
873
+ /**
874
+ * Whether users can interrupt the assistant while it is speaking.
875
+ */
876
+ enable?: boolean;
877
+ /**
878
+ * Controls when the assistant starts speaking after the user stops. These
879
+ * thresholds primarily apply to non turn-taking transcription models. For
880
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
881
+ * transcription end-of-turn settings under `transcription.settings` instead.
882
+ */
883
+ start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
884
+ }
885
+ namespace InterruptionSettings {
886
+ /**
887
+ * Controls when the assistant starts speaking after the user stops. These
888
+ * thresholds primarily apply to non turn-taking transcription models. For
889
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
890
+ * transcription end-of-turn settings under `transcription.settings` instead.
891
+ */
892
+ interface StartSpeakingPlan {
893
+ /**
894
+ * Endpointing thresholds used to decide when the user has finished speaking.
895
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
896
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
897
+ * `eager_eot_threshold`.
898
+ */
899
+ transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
900
+ /**
901
+ * Minimum seconds to wait before the assistant starts speaking.
902
+ */
903
+ wait_seconds?: number;
904
+ }
905
+ namespace StartSpeakingPlan {
906
+ /**
907
+ * Endpointing thresholds used to decide when the user has finished speaking.
908
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
909
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
910
+ * `eager_eot_threshold`.
911
+ */
912
+ interface TranscriptionEndpointingPlan {
913
+ /**
914
+ * Seconds to wait after the transcript ends without punctuation.
915
+ */
916
+ on_no_punctuation_seconds?: number;
917
+ /**
918
+ * Seconds to wait after the transcript ends with a number.
919
+ */
920
+ on_number_seconds?: number;
921
+ /**
922
+ * Seconds to wait after the transcript ends with punctuation.
923
+ */
924
+ on_punctuation_seconds?: number;
925
+ }
926
+ }
927
+ }
928
+ /**
929
+ * Reference to an MCP server attached to an assistant. Create and manage MCP
930
+ * servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
931
+ * ID.
932
+ */
933
+ interface McpServer {
934
+ /**
935
+ * ID of the MCP server to attach. This must be the `id` of an MCP server returned
936
+ * by the `/ai/mcp_servers` endpoints.
937
+ */
938
+ id: string;
939
+ /**
940
+ * Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
941
+ * uses the MCP server's configured `allowed_tools`.
942
+ */
943
+ allowed_tools?: Array<string>;
944
+ }
945
+ /**
946
+ * Configuration for post-conversation processing. When enabled, the assistant
947
+ * receives one additional LLM turn after the conversation ends, allowing it to
948
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
949
+ * can execute multiple parallel or sequential tools during this phase.
950
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
951
+ * post-conversation. Beta feature.
952
+ */
953
+ interface PostConversationSettings {
954
+ /**
955
+ * Whether post-conversation processing is enabled. When true, the assistant will
956
+ * be invoked after the conversation ends to perform any final tool calls. Defaults
957
+ * to false.
958
+ */
959
+ enabled?: boolean;
960
+ }
961
+ }
666
962
  export interface InferenceEmbeddingWebhookToolParams {
667
963
  type: 'webhook';
668
964
  webhook: InferenceEmbeddingWebhookToolParams.Webhook;
@@ -901,6 +1197,12 @@ export interface TelephonySettings {
901
1197
  * transferred to a human representative).
902
1198
  */
903
1199
  time_limit_secs?: number;
1200
+ /**
1201
+ * Duration in seconds of end user silence before the assistant checks in on the
1202
+ * user. When this limit is reached the assistant will prompt the user to respond.
1203
+ * This is distinct from user_idle_timeout_secs which stops the assistant entirely.
1204
+ */
1205
+ user_idle_reply_secs?: number;
904
1206
  /**
905
1207
  * Maximum duration in seconds of end user silence on the call. When this limit is
906
1208
  * reached the assistant will be stopped. This limit does not apply to portions of
@@ -1007,22 +1309,34 @@ export declare namespace TelephonySettings {
1007
1309
  }
1008
1310
  export interface TranscriptionSettings {
1009
1311
  /**
1010
- * The language of the audio to be transcribed. If not set, of if set to `auto`,
1011
- * the model will automatically detect the language.
1312
+ * Integration secret identifier for the transcription provider API key. Currently
1313
+ * used for Azure transcription regions that require a customer-provided API key.
1314
+ */
1315
+ api_key_ref?: string;
1316
+ /**
1317
+ * The language of the audio to be transcribed. If not set, or if set to `auto`,
1318
+ * supported models will automatically detect the language. For `deepgram/flux`,
1319
+ * supported values are: `auto` (Telnyx language detection controls the language
1320
+ * hint), `multi` (no language hint), and language-specific hints `en`, `es`, `fr`,
1321
+ * `de`, `hi`, `ru`, `pt`, `ja`, `it`, and `nl`.
1012
1322
  */
1013
1323
  language?: string;
1014
1324
  /**
1015
- * The speech to text model to be used by the voice assistant. All the deepgram
1016
- * models are run on-premise.
1325
+ * The speech to text model to be used by the voice assistant. All Deepgram models
1326
+ * are run on-premise.
1017
1327
  *
1018
- * - `deepgram/flux` is optimized for turn-taking but is English-only.
1019
- * - `deepgram/nova-3` is multi-lingual with automatic language detection but
1020
- * slightly higher latency.
1328
+ * - `deepgram/flux` is optimized for turn-taking with multilingual language hints.
1329
+ * - `deepgram/nova-3` is multilingual with automatic language detection.
1330
+ * - `deepgram/nova-2` is Deepgram's previous-generation multilingual model.
1331
+ * - `azure/fast` is a multilingual Azure transcription model.
1332
+ * - `assemblyai/universal-streaming` is a multilingual streaming model with
1333
+ * configurable turn detection.
1334
+ * - `xai/grok-stt` is a multilingual Grok STT model.
1021
1335
  */
1022
- model?: 'deepgram/flux' | 'deepgram/nova-3' | 'deepgram/nova-2' | 'azure/fast' | 'distil-whisper/distil-large-v2' | 'openai/whisper-large-v3-turbo';
1336
+ model?: 'deepgram/flux' | 'deepgram/nova-3' | 'deepgram/nova-2' | 'azure/fast' | 'assemblyai/universal-streaming' | 'xai/grok-stt' | 'distil-whisper/distil-large-v2' | 'openai/whisper-large-v3-turbo';
1023
1337
  /**
1024
1338
  * Region on third party cloud providers (currently Azure) if using one of their
1025
- * models
1339
+ * models. Some regions require `api_key_ref`.
1026
1340
  */
1027
1341
  region?: string;
1028
1342
  settings?: TranscriptionSettingsConfig;
@@ -1034,6 +1348,12 @@ export interface TranscriptionSettingsConfig {
1034
1348
  * eot_threshold effectively disables eager end of turn.
1035
1349
  */
1036
1350
  eager_eot_threshold?: number;
1351
+ /**
1352
+ * Available only for assemblyai/universal-streaming. Confidence level required to
1353
+ * trigger an end of turn. Higher values require more certainty before ending a
1354
+ * turn.
1355
+ */
1356
+ end_of_turn_confidence_threshold?: number;
1037
1357
  /**
1038
1358
  * Available only for deepgram/flux. Confidence required to trigger an end of turn.
1039
1359
  * Higher values = more reliable turn detection but slightly increased latency.
@@ -1044,6 +1364,23 @@ export interface TranscriptionSettingsConfig {
1044
1364
  * an end of turn, regardless of confidence.
1045
1365
  */
1046
1366
  eot_timeout_ms?: number;
1367
+ /**
1368
+ * Available only for deepgram/nova-3 and deepgram/flux. A comma-separated list of
1369
+ * key terms to boost for recognition during transcription. Helps improve accuracy
1370
+ * for domain-specific terminology, proper nouns, or uncommon words.
1371
+ */
1372
+ keyterm?: string;
1373
+ /**
1374
+ * Available only for assemblyai/universal-streaming. Maximum duration of silence
1375
+ * in milliseconds before forcing an end of turn.
1376
+ */
1377
+ max_turn_silence?: number;
1378
+ /**
1379
+ * Available only for assemblyai/universal-streaming. Minimum duration of silence
1380
+ * in milliseconds before a turn can end. Must be less than or equal to
1381
+ * max_turn_silence.
1382
+ */
1383
+ min_turn_silence?: number;
1047
1384
  numerals?: boolean;
1048
1385
  smart_format?: boolean;
1049
1386
  }
@@ -1059,20 +1396,22 @@ export declare namespace TransferTool {
1059
1396
  from: string;
1060
1397
  /**
1061
1398
  * The different possible targets of the transfer. The assistant will be able to
1062
- * choose one of the targets to transfer the call to.
1399
+ * choose one of the targets to transfer the call to. This can also be a dynamic
1400
+ * variable string like `{{ targets }}` where `targets` is returned by the dynamic
1401
+ * variables webhook and resolves to an array of target objects at runtime.
1063
1402
  */
1064
- targets: Array<Transfer.Target>;
1403
+ targets: Array<Transfer.UnionMember0> | string;
1065
1404
  }
1066
1405
  namespace Transfer {
1067
- interface Target {
1406
+ interface UnionMember0 {
1068
1407
  /**
1069
- * The name of the target.
1408
+ * The destination number or SIP URI of the call.
1070
1409
  */
1071
- name?: string;
1410
+ to: string;
1072
1411
  /**
1073
- * The destination number or SIP URI of the call.
1412
+ * The name of the target.
1074
1413
  */
1075
- to?: string;
1414
+ name?: string;
1076
1415
  }
1077
1416
  }
1078
1417
  }
@@ -1084,7 +1423,11 @@ export interface VoiceSettings {
1084
1423
  * key as an integration secret under the `api_key_ref` field. See
1085
1424
  * [integration secrets documentation](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
1086
1425
  * for details. For Telnyx voices, use `Telnyx.<model_id>.<voice_id>` (e.g.
1087
- * Telnyx.KokoroTTS.af_heart)
1426
+ * Telnyx.KokoroTTS.af_heart). The voice portion of the identifier supports
1427
+ * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
1428
+ * using mustache syntax (e.g. `Telnyx.Ultra.{{voice_id}}`). The variable is
1429
+ * resolved at call time from your dynamic variables webhook, allowing you to
1430
+ * select the voice dynamically per call.
1088
1431
  */
1089
1432
  voice: string;
1090
1433
  /**
@@ -1376,12 +1719,6 @@ export interface AssistantCreateParams {
1376
1719
  * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
1377
1720
  */
1378
1721
  instructions: string;
1379
- /**
1380
- * ID of the model to use. You can use the
1381
- * [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
1382
- * to see all of your available models,
1383
- */
1384
- model: string;
1385
1722
  name: string;
1386
1723
  description?: string;
1387
1724
  /**
@@ -1391,13 +1728,26 @@ export interface AssistantCreateParams {
1391
1728
  [key: string]: unknown;
1392
1729
  };
1393
1730
  /**
1394
- * If the dynamic_variables_webhook_url is set for the assistant, we will send a
1395
- * request at the start of the conversation. See our
1396
- * [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
1397
- * for more information.
1731
+ * Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
1732
+ * 10000 ms. If the webhook does not respond within this timeout, the call proceeds
1733
+ * with default values. See the
1734
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
1735
+ */
1736
+ dynamic_variables_webhook_timeout_ms?: number;
1737
+ /**
1738
+ * If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
1739
+ * URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
1740
+ * the webhook response must wrap variables under a top-level `dynamic_variables`
1741
+ * object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
1742
+ * flat object will be ignored and variables will fall back to their defaults. See
1743
+ * the
1744
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
1745
+ * for the full request/response format and timeout behavior.
1398
1746
  */
1399
1747
  dynamic_variables_webhook_url?: string;
1400
1748
  enabled_features?: Array<EnabledFeatures>;
1749
+ external_llm?: AssistantCreateParams.ExternalLlm;
1750
+ fallback_config?: AssistantCreateParams.FallbackConfig;
1401
1751
  /**
1402
1752
  * Text that the assistant will use to start the conversation. This may be
1403
1753
  * templated with
@@ -1409,21 +1759,70 @@ export interface AssistantCreateParams {
1409
1759
  greeting?: string;
1410
1760
  insight_settings?: InsightSettings;
1411
1761
  /**
1412
- * This is only needed when using third-party inference providers. The `identifier`
1413
- * for an integration secret
1762
+ * Connected integrations attached to the assistant. The catalog of available
1763
+ * integrations is at `/ai/integrations`; the user's connected integrations are at
1764
+ * `/ai/integrations/connections`. Each item references a catalog integration by
1765
+ * `integration_id`.
1766
+ */
1767
+ integrations?: Array<AssistantCreateParams.Integration>;
1768
+ /**
1769
+ * Settings for interruptions and how the assistant decides the user has finished
1770
+ * speaking. These timings are most relevant when using non turn-taking
1771
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
1772
+ * behavior is controlled by the transcription end-of-turn settings under
1773
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
1774
+ * `eager_eot_threshold`).
1775
+ */
1776
+ interruption_settings?: AssistantCreateParams.InterruptionSettings;
1777
+ /**
1778
+ * This is only needed when using third-party inference providers selected by
1779
+ * `model`. The `identifier` for an integration secret
1414
1780
  * [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
1415
- * that refers to your LLM provider's API key. Warning: Free plans are unlikely to
1416
- * work with this integration.
1781
+ * that refers to your LLM provider's API key. For bring-your-own endpoint
1782
+ * authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
1783
+ * are unlikely to work with this integration.
1417
1784
  */
1418
1785
  llm_api_key_ref?: string;
1786
+ /**
1787
+ * MCP servers attached to the assistant. Create MCP servers with
1788
+ * `/ai/mcp_servers`, then reference them by `id` here.
1789
+ */
1790
+ mcp_servers?: Array<AssistantCreateParams.McpServer>;
1419
1791
  messaging_settings?: MessagingSettings;
1792
+ /**
1793
+ * ID of the model to use when `external_llm` is not set. You can use the
1794
+ * [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
1795
+ * to see available models. If `external_llm` is provided, the assistant uses
1796
+ * `external_llm` instead of this field. If neither `model` nor `external_llm` is
1797
+ * provided, Telnyx applies the default model.
1798
+ */
1799
+ model?: string;
1420
1800
  observability_settings?: ObservabilityReq;
1801
+ /**
1802
+ * Configuration for post-conversation processing. When enabled, the assistant
1803
+ * receives one additional LLM turn after the conversation ends, allowing it to
1804
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
1805
+ * can execute multiple parallel or sequential tools during this phase.
1806
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
1807
+ * post-conversation. Beta feature.
1808
+ */
1809
+ post_conversation_settings?: AssistantCreateParams.PostConversationSettings;
1421
1810
  privacy_settings?: PrivacySettings;
1811
+ /**
1812
+ * Tags associated with the assistant. Tags can also be managed with the assistant
1813
+ * tag endpoints.
1814
+ */
1815
+ tags?: Array<string>;
1422
1816
  telephony_settings?: TelephonySettings;
1817
+ /**
1818
+ * IDs of shared tools to attach to the assistant. New integrations should prefer
1819
+ * `tool_ids` over inline `tools`.
1820
+ */
1423
1821
  tool_ids?: Array<string>;
1424
1822
  /**
1425
- * The tools that the assistant can use. These may be templated with
1426
- * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
1823
+ * Deprecated for new integrations. Inline tool definitions available to the
1824
+ * assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
1825
+ * endpoints.
1427
1826
  */
1428
1827
  tools?: Array<AssistantTool>;
1429
1828
  transcription?: TranscriptionSettings;
@@ -1433,6 +1832,213 @@ export interface AssistantCreateParams {
1433
1832
  */
1434
1833
  widget_settings?: WidgetSettings;
1435
1834
  }
1835
+ export declare namespace AssistantCreateParams {
1836
+ interface ExternalLlm {
1837
+ /**
1838
+ * Base URL for the external LLM endpoint.
1839
+ */
1840
+ base_url: string;
1841
+ /**
1842
+ * Model identifier to use with the external LLM endpoint.
1843
+ */
1844
+ model: string;
1845
+ /**
1846
+ * Authentication method used when connecting to the external LLM endpoint.
1847
+ */
1848
+ authentication_method?: 'token' | 'certificate';
1849
+ /**
1850
+ * Integration secret identifier for the client certificate used with certificate
1851
+ * authentication.
1852
+ */
1853
+ certificate_ref?: string;
1854
+ /**
1855
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
1856
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
1857
+ * request body. Defaults to `false`. Example payload sent to the external
1858
+ * endpoint:
1859
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
1860
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
1861
+ * limits.
1862
+ */
1863
+ forward_metadata?: boolean;
1864
+ /**
1865
+ * Integration secret identifier for the external LLM API key.
1866
+ */
1867
+ llm_api_key_ref?: string;
1868
+ /**
1869
+ * URL used to retrieve an access token when certificate authentication is enabled.
1870
+ */
1871
+ token_retrieval_url?: string;
1872
+ }
1873
+ interface FallbackConfig {
1874
+ external_llm?: FallbackConfig.ExternalLlm;
1875
+ /**
1876
+ * Integration secret identifier for the fallback model API key.
1877
+ */
1878
+ llm_api_key_ref?: string;
1879
+ /**
1880
+ * Fallback Telnyx-hosted model to use when the primary LLM provider is
1881
+ * unavailable.
1882
+ */
1883
+ model?: string;
1884
+ }
1885
+ namespace FallbackConfig {
1886
+ interface ExternalLlm {
1887
+ /**
1888
+ * Base URL for the external LLM endpoint.
1889
+ */
1890
+ base_url: string;
1891
+ /**
1892
+ * Model identifier to use with the external LLM endpoint.
1893
+ */
1894
+ model: string;
1895
+ /**
1896
+ * Authentication method used when connecting to the external LLM endpoint.
1897
+ */
1898
+ authentication_method?: 'token' | 'certificate';
1899
+ /**
1900
+ * Integration secret identifier for the client certificate used with certificate
1901
+ * authentication.
1902
+ */
1903
+ certificate_ref?: string;
1904
+ /**
1905
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
1906
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
1907
+ * request body. Defaults to `false`. Example payload sent to the external
1908
+ * endpoint:
1909
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
1910
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
1911
+ * limits.
1912
+ */
1913
+ forward_metadata?: boolean;
1914
+ /**
1915
+ * Integration secret identifier for the external LLM API key.
1916
+ */
1917
+ llm_api_key_ref?: string;
1918
+ /**
1919
+ * URL used to retrieve an access token when certificate authentication is enabled.
1920
+ */
1921
+ token_retrieval_url?: string;
1922
+ }
1923
+ }
1924
+ /**
1925
+ * Reference to a connected integration attached to an assistant. Discover
1926
+ * available integrations with `/ai/integrations` and connected integrations with
1927
+ * `/ai/integrations/connections`.
1928
+ */
1929
+ interface Integration {
1930
+ /**
1931
+ * Catalog integration ID to attach. This is the `id` from the integrations catalog
1932
+ * at `/ai/integrations` (the same value also appears as `integration_id` on
1933
+ * entries returned by `/ai/integrations/connections`). It is **not** the
1934
+ * connection-level `id` from `/ai/integrations/connections`.
1935
+ */
1936
+ integration_id: string;
1937
+ /**
1938
+ * Optional per-assistant allowlist of integration tool names. When omitted or
1939
+ * empty, all tools allowed by the connected integration are available to the
1940
+ * assistant.
1941
+ */
1942
+ allowed_list?: Array<string>;
1943
+ }
1944
+ /**
1945
+ * Settings for interruptions and how the assistant decides the user has finished
1946
+ * speaking. These timings are most relevant when using non turn-taking
1947
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
1948
+ * behavior is controlled by the transcription end-of-turn settings under
1949
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
1950
+ * `eager_eot_threshold`).
1951
+ */
1952
+ interface InterruptionSettings {
1953
+ /**
1954
+ * Whether users can interrupt the assistant while it is speaking.
1955
+ */
1956
+ enable?: boolean;
1957
+ /**
1958
+ * Controls when the assistant starts speaking after the user stops. These
1959
+ * thresholds primarily apply to non turn-taking transcription models. For
1960
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
1961
+ * transcription end-of-turn settings under `transcription.settings` instead.
1962
+ */
1963
+ start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
1964
+ }
1965
+ namespace InterruptionSettings {
1966
+ /**
1967
+ * Controls when the assistant starts speaking after the user stops. These
1968
+ * thresholds primarily apply to non turn-taking transcription models. For
1969
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
1970
+ * transcription end-of-turn settings under `transcription.settings` instead.
1971
+ */
1972
+ interface StartSpeakingPlan {
1973
+ /**
1974
+ * Endpointing thresholds used to decide when the user has finished speaking.
1975
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
1976
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
1977
+ * `eager_eot_threshold`.
1978
+ */
1979
+ transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
1980
+ /**
1981
+ * Minimum seconds to wait before the assistant starts speaking.
1982
+ */
1983
+ wait_seconds?: number;
1984
+ }
1985
+ namespace StartSpeakingPlan {
1986
+ /**
1987
+ * Endpointing thresholds used to decide when the user has finished speaking.
1988
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
1989
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
1990
+ * `eager_eot_threshold`.
1991
+ */
1992
+ interface TranscriptionEndpointingPlan {
1993
+ /**
1994
+ * Seconds to wait after the transcript ends without punctuation.
1995
+ */
1996
+ on_no_punctuation_seconds?: number;
1997
+ /**
1998
+ * Seconds to wait after the transcript ends with a number.
1999
+ */
2000
+ on_number_seconds?: number;
2001
+ /**
2002
+ * Seconds to wait after the transcript ends with punctuation.
2003
+ */
2004
+ on_punctuation_seconds?: number;
2005
+ }
2006
+ }
2007
+ }
2008
+ /**
2009
+ * Reference to an MCP server attached to an assistant. Create and manage MCP
2010
+ * servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
2011
+ * ID.
2012
+ */
2013
+ interface McpServer {
2014
+ /**
2015
+ * ID of the MCP server to attach. This must be the `id` of an MCP server returned
2016
+ * by the `/ai/mcp_servers` endpoints.
2017
+ */
2018
+ id: string;
2019
+ /**
2020
+ * Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
2021
+ * uses the MCP server's configured `allowed_tools`.
2022
+ */
2023
+ allowed_tools?: Array<string>;
2024
+ }
2025
+ /**
2026
+ * Configuration for post-conversation processing. When enabled, the assistant
2027
+ * receives one additional LLM turn after the conversation ends, allowing it to
2028
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
2029
+ * can execute multiple parallel or sequential tools during this phase.
2030
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
2031
+ * post-conversation. Beta feature.
2032
+ */
2033
+ interface PostConversationSettings {
2034
+ /**
2035
+ * Whether post-conversation processing is enabled. When true, the assistant will
2036
+ * be invoked after the conversation ends to perform any final tool calls. Defaults
2037
+ * to false.
2038
+ */
2039
+ enabled?: boolean;
2040
+ }
2041
+ }
1436
2042
  export interface AssistantRetrieveParams {
1437
2043
  call_control_id?: string;
1438
2044
  fetch_dynamic_variables_from_webhook?: boolean;
@@ -1448,13 +2054,26 @@ export interface AssistantUpdateParams {
1448
2054
  [key: string]: unknown;
1449
2055
  };
1450
2056
  /**
1451
- * If the dynamic_variables_webhook_url is set for the assistant, we will send a
1452
- * request at the start of the conversation. See our
1453
- * [guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
1454
- * for more information.
2057
+ * Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
2058
+ * 10000 ms. If the webhook does not respond within this timeout, the call proceeds
2059
+ * with default values. See the
2060
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
2061
+ */
2062
+ dynamic_variables_webhook_timeout_ms?: number;
2063
+ /**
2064
+ * If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
2065
+ * URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
2066
+ * the webhook response must wrap variables under a top-level `dynamic_variables`
2067
+ * object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
2068
+ * flat object will be ignored and variables will fall back to their defaults. See
2069
+ * the
2070
+ * [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
2071
+ * for the full request/response format and timeout behavior.
1455
2072
  */
1456
2073
  dynamic_variables_webhook_url?: string;
1457
2074
  enabled_features?: Array<EnabledFeatures>;
2075
+ external_llm?: AssistantUpdateParams.ExternalLlm;
2076
+ fallback_config?: AssistantUpdateParams.FallbackConfig;
1458
2077
  /**
1459
2078
  * Text that the assistant will use to start the conversation. This may be
1460
2079
  * templated with
@@ -1471,42 +2090,296 @@ export interface AssistantUpdateParams {
1471
2090
  */
1472
2091
  instructions?: string;
1473
2092
  /**
1474
- * This is only needed when using third-party inference providers. The `identifier`
1475
- * for an integration secret
2093
+ * Connected integrations attached to the assistant. The catalog of available
2094
+ * integrations is at `/ai/integrations`; the user's connected integrations are at
2095
+ * `/ai/integrations/connections`. Each item references a catalog integration by
2096
+ * `integration_id`.
2097
+ */
2098
+ integrations?: Array<AssistantUpdateParams.Integration>;
2099
+ /**
2100
+ * Settings for interruptions and how the assistant decides the user has finished
2101
+ * speaking. These timings are most relevant when using non turn-taking
2102
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
2103
+ * behavior is controlled by the transcription end-of-turn settings under
2104
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
2105
+ * `eager_eot_threshold`).
2106
+ */
2107
+ interruption_settings?: AssistantUpdateParams.InterruptionSettings;
2108
+ /**
2109
+ * This is only needed when using third-party inference providers selected by
2110
+ * `model`. The `identifier` for an integration secret
1476
2111
  * [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
1477
- * that refers to your LLM provider's API key. Warning: Free plans are unlikely to
1478
- * work with this integration.
2112
+ * that refers to your LLM provider's API key. For bring-your-own endpoint
2113
+ * authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
2114
+ * are unlikely to work with this integration.
1479
2115
  */
1480
2116
  llm_api_key_ref?: string;
2117
+ /**
2118
+ * MCP servers attached to the assistant. Create MCP servers with
2119
+ * `/ai/mcp_servers`, then reference them by `id` here.
2120
+ */
2121
+ mcp_servers?: Array<AssistantUpdateParams.McpServer>;
1481
2122
  messaging_settings?: MessagingSettings;
1482
2123
  /**
1483
- * ID of the model to use. You can use the
2124
+ * ID of the model to use when `external_llm` is not set. You can use the
1484
2125
  * [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
1485
- * to see all of your available models,
2126
+ * to see available models. If `external_llm` is provided, the assistant uses
2127
+ * `external_llm` instead of this field. If neither `model` nor `external_llm` is
2128
+ * provided, Telnyx applies the default model.
1486
2129
  */
1487
2130
  model?: string;
1488
2131
  name?: string;
1489
2132
  observability_settings?: ObservabilityReq;
2133
+ /**
2134
+ * Configuration for post-conversation processing. When enabled, the assistant
2135
+ * receives one additional LLM turn after the conversation ends, allowing it to
2136
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
2137
+ * can execute multiple parallel or sequential tools during this phase.
2138
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
2139
+ * post-conversation. Beta feature.
2140
+ */
2141
+ post_conversation_settings?: AssistantUpdateParams.PostConversationSettings;
1490
2142
  privacy_settings?: PrivacySettings;
1491
2143
  /**
1492
2144
  * Indicates whether the assistant should be promoted to the main version. Defaults
1493
2145
  * to true.
1494
2146
  */
1495
2147
  promote_to_main?: boolean;
2148
+ /**
2149
+ * Tags associated with the assistant. Tags can also be managed with the assistant
2150
+ * tag endpoints.
2151
+ */
2152
+ tags?: Array<string>;
1496
2153
  telephony_settings?: TelephonySettings;
2154
+ /**
2155
+ * IDs of shared tools to attach to the assistant. New integrations should prefer
2156
+ * `tool_ids` over inline `tools`.
2157
+ */
1497
2158
  tool_ids?: Array<string>;
1498
2159
  /**
1499
- * The tools that the assistant can use. These may be templated with
1500
- * [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
2160
+ * Deprecated for new integrations. Inline tool definitions available to the
2161
+ * assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
2162
+ * endpoints.
1501
2163
  */
1502
2164
  tools?: Array<AssistantTool>;
1503
2165
  transcription?: TranscriptionSettings;
2166
+ /**
2167
+ * Human-readable name for the assistant version.
2168
+ */
2169
+ version_name?: string;
1504
2170
  voice_settings?: VoiceSettings;
1505
2171
  /**
1506
2172
  * Configuration settings for the assistant's web widget.
1507
2173
  */
1508
2174
  widget_settings?: WidgetSettings;
1509
2175
  }
2176
+ export declare namespace AssistantUpdateParams {
2177
+ interface ExternalLlm {
2178
+ /**
2179
+ * Base URL for the external LLM endpoint.
2180
+ */
2181
+ base_url: string;
2182
+ /**
2183
+ * Model identifier to use with the external LLM endpoint.
2184
+ */
2185
+ model: string;
2186
+ /**
2187
+ * Authentication method used when connecting to the external LLM endpoint.
2188
+ */
2189
+ authentication_method?: 'token' | 'certificate';
2190
+ /**
2191
+ * Integration secret identifier for the client certificate used with certificate
2192
+ * authentication.
2193
+ */
2194
+ certificate_ref?: string;
2195
+ /**
2196
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
2197
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
2198
+ * request body. Defaults to `false`. Example payload sent to the external
2199
+ * endpoint:
2200
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
2201
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
2202
+ * limits.
2203
+ */
2204
+ forward_metadata?: boolean;
2205
+ /**
2206
+ * Integration secret identifier for the external LLM API key.
2207
+ */
2208
+ llm_api_key_ref?: string;
2209
+ /**
2210
+ * URL used to retrieve an access token when certificate authentication is enabled.
2211
+ */
2212
+ token_retrieval_url?: string;
2213
+ }
2214
+ interface FallbackConfig {
2215
+ external_llm?: FallbackConfig.ExternalLlm;
2216
+ /**
2217
+ * Integration secret identifier for the fallback model API key.
2218
+ */
2219
+ llm_api_key_ref?: string;
2220
+ /**
2221
+ * Fallback Telnyx-hosted model to use when the primary LLM provider is
2222
+ * unavailable.
2223
+ */
2224
+ model?: string;
2225
+ }
2226
+ namespace FallbackConfig {
2227
+ interface ExternalLlm {
2228
+ /**
2229
+ * Base URL for the external LLM endpoint.
2230
+ */
2231
+ base_url: string;
2232
+ /**
2233
+ * Model identifier to use with the external LLM endpoint.
2234
+ */
2235
+ model: string;
2236
+ /**
2237
+ * Authentication method used when connecting to the external LLM endpoint.
2238
+ */
2239
+ authentication_method?: 'token' | 'certificate';
2240
+ /**
2241
+ * Integration secret identifier for the client certificate used with certificate
2242
+ * authentication.
2243
+ */
2244
+ certificate_ref?: string;
2245
+ /**
2246
+ * When `true`, Telnyx forwards the assistant's dynamic variables to the external
2247
+ * LLM endpoint as a top-level `extra_metadata` object on the chat completion
2248
+ * request body. Defaults to `false`. Example payload sent to the external
2249
+ * endpoint:
2250
+ * `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
2251
+ * Distinct from OpenAI's native `metadata` field, which has its own size and type
2252
+ * limits.
2253
+ */
2254
+ forward_metadata?: boolean;
2255
+ /**
2256
+ * Integration secret identifier for the external LLM API key.
2257
+ */
2258
+ llm_api_key_ref?: string;
2259
+ /**
2260
+ * URL used to retrieve an access token when certificate authentication is enabled.
2261
+ */
2262
+ token_retrieval_url?: string;
2263
+ }
2264
+ }
2265
+ /**
2266
+ * Reference to a connected integration attached to an assistant. Discover
2267
+ * available integrations with `/ai/integrations` and connected integrations with
2268
+ * `/ai/integrations/connections`.
2269
+ */
2270
+ interface Integration {
2271
+ /**
2272
+ * Catalog integration ID to attach. This is the `id` from the integrations catalog
2273
+ * at `/ai/integrations` (the same value also appears as `integration_id` on
2274
+ * entries returned by `/ai/integrations/connections`). It is **not** the
2275
+ * connection-level `id` from `/ai/integrations/connections`.
2276
+ */
2277
+ integration_id: string;
2278
+ /**
2279
+ * Optional per-assistant allowlist of integration tool names. When omitted or
2280
+ * empty, all tools allowed by the connected integration are available to the
2281
+ * assistant.
2282
+ */
2283
+ allowed_list?: Array<string>;
2284
+ }
2285
+ /**
2286
+ * Settings for interruptions and how the assistant decides the user has finished
2287
+ * speaking. These timings are most relevant when using non turn-taking
2288
+ * transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
2289
+ * behavior is controlled by the transcription end-of-turn settings under
2290
+ * `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
2291
+ * `eager_eot_threshold`).
2292
+ */
2293
+ interface InterruptionSettings {
2294
+ /**
2295
+ * Whether users can interrupt the assistant while it is speaking.
2296
+ */
2297
+ enable?: boolean;
2298
+ /**
2299
+ * Controls when the assistant starts speaking after the user stops. These
2300
+ * thresholds primarily apply to non turn-taking transcription models. For
2301
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
2302
+ * transcription end-of-turn settings under `transcription.settings` instead.
2303
+ */
2304
+ start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
2305
+ }
2306
+ namespace InterruptionSettings {
2307
+ /**
2308
+ * Controls when the assistant starts speaking after the user stops. These
2309
+ * thresholds primarily apply to non turn-taking transcription models. For
2310
+ * turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
2311
+ * transcription end-of-turn settings under `transcription.settings` instead.
2312
+ */
2313
+ interface StartSpeakingPlan {
2314
+ /**
2315
+ * Endpointing thresholds used to decide when the user has finished speaking.
2316
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
2317
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
2318
+ * `eager_eot_threshold`.
2319
+ */
2320
+ transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
2321
+ /**
2322
+ * Minimum seconds to wait before the assistant starts speaking.
2323
+ */
2324
+ wait_seconds?: number;
2325
+ }
2326
+ namespace StartSpeakingPlan {
2327
+ /**
2328
+ * Endpointing thresholds used to decide when the user has finished speaking.
2329
+ * Applies to non turn-taking transcription models. For `deepgram/flux`, use
2330
+ * `transcription.settings.eot_threshold` / `eot_timeout_ms` /
2331
+ * `eager_eot_threshold`.
2332
+ */
2333
+ interface TranscriptionEndpointingPlan {
2334
+ /**
2335
+ * Seconds to wait after the transcript ends without punctuation.
2336
+ */
2337
+ on_no_punctuation_seconds?: number;
2338
+ /**
2339
+ * Seconds to wait after the transcript ends with a number.
2340
+ */
2341
+ on_number_seconds?: number;
2342
+ /**
2343
+ * Seconds to wait after the transcript ends with punctuation.
2344
+ */
2345
+ on_punctuation_seconds?: number;
2346
+ }
2347
+ }
2348
+ }
2349
+ /**
2350
+ * Reference to an MCP server attached to an assistant. Create and manage MCP
2351
+ * servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
2352
+ * ID.
2353
+ */
2354
+ interface McpServer {
2355
+ /**
2356
+ * ID of the MCP server to attach. This must be the `id` of an MCP server returned
2357
+ * by the `/ai/mcp_servers` endpoints.
2358
+ */
2359
+ id: string;
2360
+ /**
2361
+ * Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
2362
+ * uses the MCP server's configured `allowed_tools`.
2363
+ */
2364
+ allowed_tools?: Array<string>;
2365
+ }
2366
+ /**
2367
+ * Configuration for post-conversation processing. When enabled, the assistant
2368
+ * receives one additional LLM turn after the conversation ends, allowing it to
2369
+ * execute tool calls such as logging to a CRM or sending a summary. The assistant
2370
+ * can execute multiple parallel or sequential tools during this phase.
2371
+ * Telephony-control tools (e.g. hangup, transfer) are unavailable
2372
+ * post-conversation. Beta feature.
2373
+ */
2374
+ interface PostConversationSettings {
2375
+ /**
2376
+ * Whether post-conversation processing is enabled. When true, the assistant will
2377
+ * be invoked after the conversation ends to perform any final tool calls. Defaults
2378
+ * to false.
2379
+ */
2380
+ enabled?: boolean;
2381
+ }
2382
+ }
1510
2383
  export interface AssistantChatParams {
1511
2384
  /**
1512
2385
  * The message content sent by the client to the assistant