import { APIResource } from "../core/resource.mjs"; import { APIPromise } from "../core/api-promise.mjs"; import { RequestOptions } from "../internal/request-options.mjs"; export declare class Call extends APIResource { /** * Retrieve details of a specific call * * @example * ```ts * const callResponse = await client.call.retrieve( * '119c3f8e47135a29e65947eeb34cf12d', * ); * ``` */ retrieve(callID: string, options?: RequestOptions): APIPromise; /** * Update metadata and sensitive data storage settings for an existing call. * * @example * ```ts * const callResponse = await client.call.update( * 'call_a4441234567890777c4a4a123e6', * { * data_storage_setting: 'everything_except_pii', * metadata: { * customer_id: 'cust_123', * notes: 'Follow-up required', * }, * }, * ); * ``` */ update(callID: string, body: CallUpdateParams, options?: RequestOptions): APIPromise; /** * List calls with unified cursor pagination response. * * @example * ```ts * const calls = await client.call.list(); * ``` */ list(body?: CallListParams | null | undefined, options?: RequestOptions): APIPromise; /** * Delete a specific call and its associated data * * @example * ```ts * await client.call.delete( * '119c3f8e47135a29e65947eeb34cf12d', * ); * ``` */ delete(callID: string, options?: RequestOptions): APIPromise; /** * Create a new outbound phone call. * * @example * ```ts * const phoneCallResponse = await client.call.createPhoneCall( * { * from_number: '+14157774444', * to_number: '+12137774445', * }, * ); * ``` */ createPhoneCall(body: CallCreatePhoneCallParams, options?: RequestOptions): APIPromise; /** * Create a new web call and return browser connection details. * * @example * ```ts * const createWebCallResponse = * await client.call.createWebCall({ * agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD', * }); * ``` */ createWebCall(body: CallCreateWebCallParams, options?: RequestOptions): APIPromise; /** * Mint a subscribe-only access token for an in-progress call so a client can * listen to live audio. The returned token grants join + subscribe on the call's * existing audio room; it cannot publish. The call must be in ONGOING status. * * @example * ```ts * const response = await client.call.listenLive( * '119c3f8e47135a29e65947eeb34cf12d', * ); * ``` */ listenLive(callID: string, options?: RequestOptions): APIPromise; /** * Register a new phone call for custom telephony * * @example * ```ts * const phoneCallResponse = * await client.call.registerPhoneCall({ * agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD', * }); * ``` */ registerPhoneCall(body: CallRegisterPhoneCallParams, options?: RequestOptions): APIPromise; /** * Rerun post-call analysis for a specific call. This operation incurs charges. * * @example * ```ts * const callResponse = await client.call.rerunAnalysis( * 'call_119c3f8e47135a29e65947eeb34cf12d', * ); * ``` */ rerunAnalysis(callID: string, options?: RequestOptions): APIPromise; /** * Stop an ongoing call. * * @example * ```ts * await client.call.stop('call_a4441234567890777c4a4a123e6'); * ``` */ stop(callID: string, options?: RequestOptions): APIPromise; /** * Take over an in-progress call from the AI agent. The agent stops responding and * the specified live-listen participant is allowed to speak directly to the * caller. The call must be in ONGOING status. Calls cannot be taken over while a * PCI session is active. * * @example * ```ts * const response = await client.call.takeOverLive( * '119c3f8e47135a29e65947eeb34cf12d', * { participant_id: 'listener_a1b2c3d4e5f6g7h8i9j0' }, * ); * ``` */ takeOverLive(callID: string, body: CallTakeOverLiveParams, options?: RequestOptions): APIPromise; /** * Update an ongoing call at runtime. Supports overriding dynamic variables, * metadata, and the data storage setting on the running call, and controlling the * live agent (inject context, trigger a response). These overrides take effect * immediately on the live call; metadata and data storage setting changes are also * persisted to the call record. To update a call that is no longer ongoing, use * /v2/update-call/{call_id}. * * @example * ```ts * const response = await client.call.updateLive( * 'call_a4441234567890777c4a4a123e6', * { * call_control: { * additional_context: * 'Customer just opened a support ticket about billing.', * trigger_response: true, * }, * fields_to_override: { * override_dynamic_variables: { * additional_discount: '15%', * }, * }, * }, * ); * ``` */ updateLive(callID: string, body: CallUpdateLiveParams, options?: RequestOptions): APIPromise; } export type CallResponse = WebCallResponse | PhoneCallResponse; export interface CreateWebCallResponse { /** * Token authorizing this browser to join the web call. Pass it to your frontend. */ access_token: string; /** * Unique identifier for the web call. */ call_id: string; /** * Unix epoch ms when the access_token expires. */ expires_at: number; /** * ICE servers to configure before the browser creates its peer connection. */ ice_servers: Array; /** * Connection transport to select in the web client. */ transport: 'gateway'; } export declare namespace CreateWebCallResponse { interface IceServer { urls: string | Array; credential?: string; username?: string; } } export interface PhoneCallResponse { /** * Corresponding agent id of this call. */ agent_id: string; /** * The version of the agent. */ agent_version: number; /** * Unique id of the call. Used to identify the call in the LLM websocket and used * to authenticate in the audio websocket. */ call_id: string; /** * Status of call. * * - `registered`: Call id issued, starting to make a call using this id. * - `ongoing`: Call connected and ongoing. * - `ended`: The underlying websocket has ended for the call. Either user or agent * hung up, or call transferred. * - `error`: Call encountered error. */ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error'; /** * Type of the call. Used to distinguish between web call and phone call. */ call_type: 'phone_call'; /** * Direction of the phone call. */ direction: 'inbound' | 'outbound'; /** * The caller number. */ from_number: string; /** * The callee number. */ to_number: string; /** * Name of the agent. */ agent_name?: string; /** * Tag pointing at the agent version used for this call, captured at call creation * time and frozen thereafter (unaffected by later tag reassignments). Populated * whether the caller dispatched by tag, numeric version, "latest", or * "latest_published" — when the caller specified a tag, that tag wins; otherwise * the most-recently- assigned tag on the resolved version is used. Absent when no * tag points at the resolved version (or for calls created before this field was * introduced). */ agent_tag?: string | null; /** * Post call analysis that includes information such as sentiment, status, summary, * and custom defined data to extract. Available after call ends. Subscribe to * `call_analyzed` webhook event type to receive it once ready. */ call_analysis?: PhoneCallResponse.CallAnalysis; /** * Cost of the call, including all the products and their costs and discount. */ call_cost?: PhoneCallResponse.CallCost; /** * Dynamic variables collected from the call. Only available after the call ends. */ collected_dynamic_variables?: { [key: string]: string; }; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Data storage setting for this call's agent. "everything" stores all data, * "everything_except_pii" excludes PII when possible, "basic_attributes_only" * stores only metadata. */ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null; /** * The reason for the disconnection of the call. Read detailed description about * reasons listed here at * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons). */ disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'user_requested_dnc' | 'user_requested_callback' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_concurrency_fallback' | 'no_valid_payment' | 'credit_exhausted' | 'budget_reached' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'network_blocked' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped' | 'call_take_over'; /** * Duration of the call in milliseconds. Available after call ends. */ duration_ms?: number; /** * End timestamp (milliseconds since epoch) of the call. Available after call ends. */ end_timestamp?: number; /** * URL to the knowledge base retrieved contents of the call. Available after call * ends if the call utilizes knowledge base feature. It consists of the respond id * and the retrieved contents related to that response. It's already rendered in * call history tab of dashboard, and you can also manually download and check * against the transcript to view the knowledge base retrieval results. */ knowledge_base_retrieved_contents_url?: string; /** * Latency tracking of the call, available after call ends. Not all fields here * will be available, as it depends on the type of call and feature used. */ latency?: PhoneCallResponse.Latency; /** * LLM token usage of the call, available after call ends. Not populated if using * custom LLM, realtime API, or no LLM call is made. */ llm_token_usage?: PhoneCallResponse.LlmTokenUsage; /** * An arbitrary object for storage purpose only. You can put anything here like * your internal customer id associated with the call. Not used for processing. You * can later get this field from the call object. */ metadata?: unknown; /** * Whether this agent opts in for signed URLs for public logs and recordings. When * enabled, the generated URLs will include security signatures that restrict * access and automatically expire after 24 hours. */ opt_in_signed_url?: boolean; /** * Tool call invocations and results of integration tools run after post-call * analysis (post-session). Stored separately from the main transcript. Available * after call ends if post-session integration tools ran. */ post_session_transcript_with_tool_calls?: Array; /** * Tool call invocations and results of integration tools run before the session * started (pre-session). Stored separately from the main transcript. Available * after call ends if pre-session integration tools ran. */ pre_session_transcript_with_tool_calls?: Array; /** * Public log of the call, containing details about all the requests and responses * received in LLM WebSocket, latency tracking for each turntaking, helpful for * debugging and tracing. Available after call ends. */ public_log_url?: string; /** * Recording of the call, with each party's audio stored in a separate channel. * Available after the call ends. */ recording_multi_channel_url?: string; /** * Recording of the call. Available after call ends. */ recording_url?: string; /** * Add optional dynamic variables in key value pairs of string that injects into * your Response Engine prompt and tool description. Only applicable for Response * Engine. */ retell_llm_dynamic_variables?: { [key: string]: string; }; /** * Post-session integration tool call invocations and results, without PII. * Available after call ends if post-session integration tools ran and PII * scrubbing is enabled. */ scrubbed_post_session_transcript_with_tool_calls?: Array; /** * Pre-session integration tool call invocations and results, without PII. * Available after call ends if pre-session integration tools ran and PII scrubbing * is enabled. */ scrubbed_pre_session_transcript_with_tool_calls?: Array; /** * Recording of the call without PII, with each party's audio stored in a separate * channel. Available after the call ends. */ scrubbed_recording_multi_channel_url?: string; /** * Recording of the call without PII. Available after call ends. */ scrubbed_recording_url?: string; /** * Transcript of the call weaved with tool call invocation and results, without * PII. It precisely captures when (at what utterance, which word) the tool was * invoked and what was the result. Available after call ends. */ scrubbed_transcript_with_tool_calls?: Array; /** * Begin timestamp (milliseconds since epoch) of the call. Available after call * starts. */ start_timestamp?: number; /** * Telephony identifier of the call, populated when available. Tracking purposes * only. */ telephony_identifier?: PhoneCallResponse.TelephonyIdentifier; /** * Transcription of the call. Available after call ends. */ transcript?: string; /** * Transcript of the call in the format of a list of utterance, with timestamp. * Available after call ends. */ transcript_object?: Array; /** * Transcript of the call weaved with tool call invocation and results. It * precisely captures when (at what utterance, which word) the tool was invoked and * what was the result. Available after call ends. */ transcript_with_tool_calls?: Array; /** * The destination number or identifier where the call was transferred to. Only * populated when the disconnection reason was `call_transfer`. Can be a phone * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a * ";transport=..." portion (if transport is known) where the transport type can be * "tls", "tcp" or "udp". */ transfer_destination?: string | null; /** * Transfer end timestamp (milliseconds since epoch) of the call. Available after * transfer call ends. */ transfer_end_timestamp?: number; } export declare namespace PhoneCallResponse { /** * Post call analysis that includes information such as sentiment, status, summary, * and custom defined data to extract. Available after call ends. Subscribe to * `call_analyzed` webhook event type to receive it once ready. */ interface CallAnalysis { /** * Whether the agent seems to have a successful call with the user, where the agent * finishes the task, and the call was complete without being cutoff. */ call_successful?: boolean; /** * A high level summary of the call. */ call_summary?: string; /** * Custom analysis data that was extracted based on the schema defined in agent * post call analysis data. Can be empty if nothing is specified. */ custom_analysis_data?: unknown; /** * Whether the call is entered voicemail. */ in_voicemail?: boolean; /** * Sentiment of the user in the call. */ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown'; } /** * Cost of the call, including all the products and their costs and discount. */ interface CallCost { /** * Combined cost of all individual costs in cents */ combined_cost: number; /** * List of products with their unit prices and costs in cents */ product_costs: Array; /** * Total duration of the call in seconds */ total_duration_seconds: number; /** * Total unit duration price of all products in cents per second */ total_duration_unit_price: number; } namespace CallCost { interface ProductCost { /** * Cost for the product in cents for the duration of the call. */ cost: number; /** * Product name that has a cost associated with it. */ product: string; /** * True if this cost item is for a transfer segment. */ is_transfer_leg_cost?: boolean; /** * Unit price of the product in cents per second. */ unit_price?: number; } } /** * Latency tracking of the call, available after call ends. Not all fields here * will be available, as it depends on the type of call and feature used. */ interface Latency { /** * Transcription latency (diff between the duration of the chunks streamed and the * durations of the transcribed part) tracking of the call. */ asr?: Latency.Asr; /** * End to end latency (from user stops talking to agent start talking) tracking of * the call. This latency does not account for the network trip time from Retell * server to user frontend. The latency is tracked every time turn change between * user and agent. */ e2e?: Latency.E2E; /** * Knowledge base latency (from the triggering of knowledge base retrival to all * relevant context received) tracking of the call. Only populated when using * knowledge base feature for the agent of the call. */ knowledge_base?: Latency.KnowledgeBase; /** * LLM latency (from issue of LLM call to first speakable chunk received) tracking * of the call. When using custom LLM. this latency includes LLM websocket * roundtrip time between user server and Retell server. */ llm?: Latency.Llm; /** * LLM websocket roundtrip latency (between user server and Retell server) tracking * of the call. Only populated for calls using custom LLM. */ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt; /** * Speech-to-speech latency (from requesting responses of a S2S model to first byte * received) tracking of the call. Only populated for calls that uses S2S model * like Realtime API. */ s2s?: Latency.S2s; /** * Text-to-speech latency (from the triggering of TTS to first byte received) * tracking of the call. */ tts?: Latency.Tts; } namespace Latency { /** * Transcription latency (diff between the duration of the chunks streamed and the * durations of the transcribed part) tracking of the call. */ interface Asr { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * End to end latency (from user stops talking to agent start talking) tracking of * the call. This latency does not account for the network trip time from Retell * server to user frontend. The latency is tracked every time turn change between * user and agent. */ interface E2E { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Knowledge base latency (from the triggering of knowledge base retrival to all * relevant context received) tracking of the call. Only populated when using * knowledge base feature for the agent of the call. */ interface KnowledgeBase { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * LLM latency (from issue of LLM call to first speakable chunk received) tracking * of the call. When using custom LLM. this latency includes LLM websocket * roundtrip time between user server and Retell server. */ interface Llm { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * LLM websocket roundtrip latency (between user server and Retell server) tracking * of the call. Only populated for calls using custom LLM. */ interface LlmWebsocketNetworkRtt { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Speech-to-speech latency (from requesting responses of a S2S model to first byte * received) tracking of the call. Only populated for calls that uses S2S model * like Realtime API. */ interface S2s { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Text-to-speech latency (from the triggering of TTS to first byte received) * tracking of the call. */ interface Tts { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } } /** * LLM token usage of the call, available after call ends. Not populated if using * custom LLM, realtime API, or no LLM call is made. */ interface LlmTokenUsage { /** * Average token count of the call. */ average: number; /** * Number of requests made to the LLM. */ num_requests: number; /** * All the token count values in the call. */ values: Array; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } /** * Telephony identifier of the call, populated when available. Tracking purposes * only. */ interface TelephonyIdentifier { /** * Twilio call sid. */ twilio_call_sid?: string; } interface TranscriptObject { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: TranscriptObject.Metadata; } namespace TranscriptObject { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } } export interface WebCallResponse { /** * Access token to enter the web call room. This needs to be passed to your * frontend to join the call. */ access_token: string; /** * Corresponding agent id of this call. */ agent_id: string; /** * The version of the agent. */ agent_version: number; /** * Unique id of the call. Used to identify the call in the LLM websocket and used * to authenticate in the audio websocket. */ call_id: string; /** * Status of call. * * - `registered`: Call id issued, starting to make a call using this id. * - `ongoing`: Call connected and ongoing. * - `ended`: The underlying websocket has ended for the call. Either user or agent * hung up, or call transferred. * - `error`: Call encountered error. */ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error'; /** * Type of the call. Used to distinguish between web call and phone call. */ call_type: 'web_call'; /** * Name of the agent. */ agent_name?: string; /** * Tag pointing at the agent version used for this call, captured at call creation * time and frozen thereafter (unaffected by later tag reassignments). Populated * whether the caller dispatched by tag, numeric version, "latest", or * "latest_published" — when the caller specified a tag, that tag wins; otherwise * the most-recently- assigned tag on the resolved version is used. Absent when no * tag points at the resolved version (or for calls created before this field was * introduced). */ agent_tag?: string | null; /** * Post call analysis that includes information such as sentiment, status, summary, * and custom defined data to extract. Available after call ends. Subscribe to * `call_analyzed` webhook event type to receive it once ready. */ call_analysis?: WebCallResponse.CallAnalysis; /** * Cost of the call, including all the products and their costs and discount. */ call_cost?: WebCallResponse.CallCost; /** * Dynamic variables collected from the call. Only available after the call ends. */ collected_dynamic_variables?: { [key: string]: string; }; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Data storage setting for this call's agent. "everything" stores all data, * "everything_except_pii" excludes PII when possible, "basic_attributes_only" * stores only metadata. */ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null; /** * The reason for the disconnection of the call. Read detailed description about * reasons listed here at * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons). */ disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'user_requested_dnc' | 'user_requested_callback' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_concurrency_fallback' | 'no_valid_payment' | 'credit_exhausted' | 'budget_reached' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'network_blocked' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped' | 'call_take_over'; /** * Duration of the call in milliseconds. Available after call ends. */ duration_ms?: number; /** * End timestamp (milliseconds since epoch) of the call. Available after call ends. */ end_timestamp?: number; /** * URL to the knowledge base retrieved contents of the call. Available after call * ends if the call utilizes knowledge base feature. It consists of the respond id * and the retrieved contents related to that response. It's already rendered in * call history tab of dashboard, and you can also manually download and check * against the transcript to view the knowledge base retrieval results. */ knowledge_base_retrieved_contents_url?: string; /** * Latency tracking of the call, available after call ends. Not all fields here * will be available, as it depends on the type of call and feature used. */ latency?: WebCallResponse.Latency; /** * LLM token usage of the call, available after call ends. Not populated if using * custom LLM, realtime API, or no LLM call is made. */ llm_token_usage?: WebCallResponse.LlmTokenUsage; /** * An arbitrary object for storage purpose only. You can put anything here like * your internal customer id associated with the call. Not used for processing. You * can later get this field from the call object. */ metadata?: unknown; /** * Whether this agent opts in for signed URLs for public logs and recordings. When * enabled, the generated URLs will include security signatures that restrict * access and automatically expire after 24 hours. */ opt_in_signed_url?: boolean; /** * Tool call invocations and results of integration tools run after post-call * analysis (post-session). Stored separately from the main transcript. Available * after call ends if post-session integration tools ran. */ post_session_transcript_with_tool_calls?: Array; /** * Tool call invocations and results of integration tools run before the session * started (pre-session). Stored separately from the main transcript. Available * after call ends if pre-session integration tools ran. */ pre_session_transcript_with_tool_calls?: Array; /** * Public log of the call, containing details about all the requests and responses * received in LLM WebSocket, latency tracking for each turntaking, helpful for * debugging and tracing. Available after call ends. */ public_log_url?: string; /** * Recording of the call, with each party's audio stored in a separate channel. * Available after the call ends. */ recording_multi_channel_url?: string; /** * Recording of the call. Available after call ends. */ recording_url?: string; /** * Add optional dynamic variables in key value pairs of string that injects into * your Response Engine prompt and tool description. Only applicable for Response * Engine. */ retell_llm_dynamic_variables?: { [key: string]: string; }; /** * Post-session integration tool call invocations and results, without PII. * Available after call ends if post-session integration tools ran and PII * scrubbing is enabled. */ scrubbed_post_session_transcript_with_tool_calls?: Array; /** * Pre-session integration tool call invocations and results, without PII. * Available after call ends if pre-session integration tools ran and PII scrubbing * is enabled. */ scrubbed_pre_session_transcript_with_tool_calls?: Array; /** * Recording of the call without PII, with each party's audio stored in a separate * channel. Available after the call ends. */ scrubbed_recording_multi_channel_url?: string; /** * Recording of the call without PII. Available after call ends. */ scrubbed_recording_url?: string; /** * Transcript of the call weaved with tool call invocation and results, without * PII. It precisely captures when (at what utterance, which word) the tool was * invoked and what was the result. Available after call ends. */ scrubbed_transcript_with_tool_calls?: Array; /** * Begin timestamp (milliseconds since epoch) of the call. Available after call * starts. */ start_timestamp?: number; /** * Transcription of the call. Available after call ends. */ transcript?: string; /** * Transcript of the call in the format of a list of utterance, with timestamp. * Available after call ends. */ transcript_object?: Array; /** * Transcript of the call weaved with tool call invocation and results. It * precisely captures when (at what utterance, which word) the tool was invoked and * what was the result. Available after call ends. */ transcript_with_tool_calls?: Array; /** * The destination number or identifier where the call was transferred to. Only * populated when the disconnection reason was `call_transfer`. Can be a phone * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a * ";transport=..." portion (if transport is known) where the transport type can be * "tls", "tcp" or "udp". */ transfer_destination?: string | null; /** * Transfer end timestamp (milliseconds since epoch) of the call. Available after * transfer call ends. */ transfer_end_timestamp?: number; } export declare namespace WebCallResponse { /** * Post call analysis that includes information such as sentiment, status, summary, * and custom defined data to extract. Available after call ends. Subscribe to * `call_analyzed` webhook event type to receive it once ready. */ interface CallAnalysis { /** * Whether the agent seems to have a successful call with the user, where the agent * finishes the task, and the call was complete without being cutoff. */ call_successful?: boolean; /** * A high level summary of the call. */ call_summary?: string; /** * Custom analysis data that was extracted based on the schema defined in agent * post call analysis data. Can be empty if nothing is specified. */ custom_analysis_data?: unknown; /** * Whether the call is entered voicemail. */ in_voicemail?: boolean; /** * Sentiment of the user in the call. */ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown'; } /** * Cost of the call, including all the products and their costs and discount. */ interface CallCost { /** * Combined cost of all individual costs in cents */ combined_cost: number; /** * List of products with their unit prices and costs in cents */ product_costs: Array; /** * Total duration of the call in seconds */ total_duration_seconds: number; /** * Total unit duration price of all products in cents per second */ total_duration_unit_price: number; } namespace CallCost { interface ProductCost { /** * Cost for the product in cents for the duration of the call. */ cost: number; /** * Product name that has a cost associated with it. */ product: string; /** * True if this cost item is for a transfer segment. */ is_transfer_leg_cost?: boolean; /** * Unit price of the product in cents per second. */ unit_price?: number; } } /** * Latency tracking of the call, available after call ends. Not all fields here * will be available, as it depends on the type of call and feature used. */ interface Latency { /** * Transcription latency (diff between the duration of the chunks streamed and the * durations of the transcribed part) tracking of the call. */ asr?: Latency.Asr; /** * End to end latency (from user stops talking to agent start talking) tracking of * the call. This latency does not account for the network trip time from Retell * server to user frontend. The latency is tracked every time turn change between * user and agent. */ e2e?: Latency.E2E; /** * Knowledge base latency (from the triggering of knowledge base retrival to all * relevant context received) tracking of the call. Only populated when using * knowledge base feature for the agent of the call. */ knowledge_base?: Latency.KnowledgeBase; /** * LLM latency (from issue of LLM call to first speakable chunk received) tracking * of the call. When using custom LLM. this latency includes LLM websocket * roundtrip time between user server and Retell server. */ llm?: Latency.Llm; /** * LLM websocket roundtrip latency (between user server and Retell server) tracking * of the call. Only populated for calls using custom LLM. */ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt; /** * Speech-to-speech latency (from requesting responses of a S2S model to first byte * received) tracking of the call. Only populated for calls that uses S2S model * like Realtime API. */ s2s?: Latency.S2s; /** * Text-to-speech latency (from the triggering of TTS to first byte received) * tracking of the call. */ tts?: Latency.Tts; } namespace Latency { /** * Transcription latency (diff between the duration of the chunks streamed and the * durations of the transcribed part) tracking of the call. */ interface Asr { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * End to end latency (from user stops talking to agent start talking) tracking of * the call. This latency does not account for the network trip time from Retell * server to user frontend. The latency is tracked every time turn change between * user and agent. */ interface E2E { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Knowledge base latency (from the triggering of knowledge base retrival to all * relevant context received) tracking of the call. Only populated when using * knowledge base feature for the agent of the call. */ interface KnowledgeBase { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * LLM latency (from issue of LLM call to first speakable chunk received) tracking * of the call. When using custom LLM. this latency includes LLM websocket * roundtrip time between user server and Retell server. */ interface Llm { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * LLM websocket roundtrip latency (between user server and Retell server) tracking * of the call. Only populated for calls using custom LLM. */ interface LlmWebsocketNetworkRtt { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Speech-to-speech latency (from requesting responses of a S2S model to first byte * received) tracking of the call. Only populated for calls that uses S2S model * like Realtime API. */ interface S2s { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Text-to-speech latency (from the triggering of TTS to first byte received) * tracking of the call. */ interface Tts { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } } /** * LLM token usage of the call, available after call ends. Not populated if using * custom LLM, realtime API, or no LLM call is made. */ interface LlmTokenUsage { /** * Average token count of the call. */ average: number; /** * Number of requests made to the LLM. */ num_requests: number; /** * All the token count values in the call. */ values: Array; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } interface TranscriptObject { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: TranscriptObject.Metadata; } namespace TranscriptObject { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface Utterance { /** * Transcript of the utterances. */ content: string; /** * Documents whether this utterance is spoken by agent or user. */ role: 'agent' | 'user' | 'transfer_target'; /** * Array of words in the utterance with the word timestamp. Useful for * understanding what word was spoken at what time. Note that the word timestamp is * not guaranteed to be accurate, it's more like an approximation. */ words: Array; metadata?: Utterance.Metadata; } namespace Utterance { interface Word { /** * End time of the word in the call in second. This is relative audio time, not * wall time. */ end?: number; /** * Start time of the word in the call in second. This is relative audio time, not * wall time. */ start?: number; /** * Word transcript (with punctuation if applicable). */ word?: string; } interface Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ backup_model_used?: Metadata.BackupModelUsed; /** * Custom LLM agent interruption identifier, when available. */ interrupt_id?: number; /** * Whether the user cut off this agent utterance before it finished playing. Only * set for Retell LLM and conversation flow agents; absent when the agent was not * interrupted. */ interrupted?: boolean; /** * Whether the utterance is a backchannel acknowledgment. */ is_backchannel?: boolean; /** * Call-scoped agent response identifier, when available. */ response_id?: number; } namespace Metadata { /** * The first backup model used in the Retell-managed response associated with this * utterance, including tool-only requests. Does not imply every word was generated * by the backup model. Absent when no backup was used or for backchannels. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallInvocationUtterance { /** * Arguments for this tool call, it's a stringified JSON object. */ arguments: string; /** * Name of the tool. This is the configured tool name, or the node name for a * built-in conversation flow node, so it can contain spaces and non-ASCII * characters. To identify the kind of tool, use `type`. */ name: string; /** * This is a tool call invocation. */ role: 'tool_call_invocation'; /** * Tool call id, globally unique. */ tool_call_id: string; metadata?: ToolCallInvocationUtterance.Metadata; /** * Optional thought signature from Google Gemini thinking models. This is used * internally to maintain reasoning chain in multi-turn function calling. */ thought_signature?: string; /** * Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, * `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, * `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, * `book_appointment_cal`, and `check_availability_cal`. New values can be added. * Absent on tool calls sent by a custom LLM, and on some older calls and chats. */ type?: string; } namespace ToolCallInvocationUtterance { interface Metadata { /** * Backup model that generated this tool invocation. */ backup_model_used?: Metadata.BackupModelUsed; } namespace Metadata { /** * Backup model that generated this tool invocation. */ interface BackupModelUsed { /** * Backup model configured for this request. */ backup_model: string; /** * Actual selected model after routing and retries. */ model: string; /** * Primary model configured for this request. */ primary_model: string; /** * Why the backup won. primary_failed means primary attempts failed; * preference_expired means backup was ready within the primary preference window; * first_usable means backup became ready after that window and won the race. */ reason: 'primary_failed' | 'preference_expired' | 'first_usable'; /** * Elapsed milliseconds from race start to winner selection. */ selection_latency_ms: number; /** * Elapsed milliseconds until backup produced usable output. Omitted when * unavailable. */ backup_ready_ms?: number; /** * Elapsed milliseconds until primary produced usable output. Omitted if primary * was not ready when the winner was selected. */ primary_ready_ms?: number; } } } interface ToolCallResultUtterance { /** * Result of the tool call, can be a string, a stringified json, etc. */ content: string; /** * This is the result of a tool call. */ role: 'tool_call_result'; /** * Tool call id, globally unique. */ tool_call_id: string; /** * Whether the tool call was successful. */ successful?: boolean; } interface NodeTransitionUtterance { /** * Former node id */ former_node_id: string; /** * Former node name */ former_node_name: string; /** * New node id */ new_node_id: string; /** * New node name */ new_node_name: string; /** * This is result of a node transition */ role: 'node_transition'; /** * How this node was reached. "global" means a global node transition, * "global_go_back" means returning from a global node, "interrupt_go_back" means * going back due to user interruption, and "normal" means a regular edge * transition. */ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal'; } interface DtmfUtterance { /** * The digit pressed by the user. Will be a single digit string like "1", "2", "3", * "\*", "#" etc. */ digit: string; /** * Digit pressed by the user from their phone keypad. */ role: 'dtmf'; } interface SMSUtterance { /** * Text content of the SMS message. */ content: string; /** * SMS message received from the user during the call (for example while the agent * is leaving a voicemail). Not part of the spoken conversation. */ role: 'sms'; /** * Time the SMS was received, in seconds relative to the start of the call. */ time_sec: number; /** * Multimedia attachments (MMS). Display only; not relayed into the spoken * conversation. */ multimedia?: Array; } namespace SMSUtterance { interface Multimedia { /** * URL of the multimedia attachment. */ url: string; /** * Optional textual summary of the attachment. */ summary?: string; } } interface InjectedUtterance { /** * The injected context text. */ content: string; /** * External context injected into the conversation via the update-live-call API. * Not spoken by either party. */ role: 'injected'; /** * Time the context was injected, in seconds relative to the start of the call. */ time_sec: number; } } export interface CallListResponse { /** * Whether more results are available. */ has_more: boolean; items: Array; /** * Pagination key for the next page. */ pagination_key?: string; /** * Total number of calls matching `filter_criteria`. Only present when * `include_total` is true. */ total?: number; } export declare namespace CallListResponse { interface V3WebCallResponse { /** * Access token to enter the web call room. This needs to be passed to your * frontend to join the call. */ access_token: string; /** * Corresponding agent id of this call. */ agent_id: string; /** * The version of the agent. */ agent_version: number; /** * Unique id of the call. Used to identify the call in the LLM websocket and used * to authenticate in the audio websocket. */ call_id: string; /** * Status of call. * * - `registered`: Call id issued, starting to make a call using this id. * - `ongoing`: Call connected and ongoing. * - `ended`: The underlying websocket has ended for the call. Either user or agent * hung up, or call transferred. * - `error`: Call encountered error. */ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error'; /** * Type of the call. Used to distinguish between web call and phone call. */ call_type: 'web_call'; /** * Name of the agent. */ agent_name?: string; /** * Tag pointing at the agent version used for this call, captured at call creation * time and frozen thereafter (unaffected by later tag reassignments). Populated * whether the caller dispatched by tag, numeric version, "latest", or * "latest_published" — when the caller specified a tag, that tag wins; otherwise * the most-recently- assigned tag on the resolved version is used. Absent when no * tag points at the resolved version (or for calls created before this field was * introduced). */ agent_tag?: string | null; /** * Post call analysis that includes information such as sentiment, status, summary, * and custom defined data to extract. Available after call ends. Subscribe to * `call_analyzed` webhook event type to receive it once ready. */ call_analysis?: V3WebCallResponse.CallAnalysis; /** * Cost of the call, including all the products and their costs and discount. */ call_cost?: V3WebCallResponse.CallCost; /** * Dynamic variables collected from the call. Only available after the call ends. */ collected_dynamic_variables?: { [key: string]: string; }; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Data storage setting for this call's agent. "everything" stores all data, * "everything_except_pii" excludes PII when possible, "basic_attributes_only" * stores only metadata. */ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null; /** * The reason for the disconnection of the call. Read detailed description about * reasons listed here at * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons). */ disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'user_requested_dnc' | 'user_requested_callback' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_concurrency_fallback' | 'no_valid_payment' | 'credit_exhausted' | 'budget_reached' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'network_blocked' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped' | 'call_take_over'; /** * Duration of the call in milliseconds. Available after call ends. */ duration_ms?: number; /** * End timestamp (milliseconds since epoch) of the call. Available after call ends. */ end_timestamp?: number; /** * URL to the knowledge base retrieved contents of the call. Available after call * ends if the call utilizes knowledge base feature. It consists of the respond id * and the retrieved contents related to that response. It's already rendered in * call history tab of dashboard, and you can also manually download and check * against the transcript to view the knowledge base retrieval results. */ knowledge_base_retrieved_contents_url?: string; /** * Latency tracking of the call, available after call ends. Not all fields here * will be available, as it depends on the type of call and feature used. */ latency?: V3WebCallResponse.Latency; /** * LLM token usage of the call, available after call ends. Not populated if using * custom LLM, realtime API, or no LLM call is made. */ llm_token_usage?: V3WebCallResponse.LlmTokenUsage; /** * An arbitrary object for storage purpose only. You can put anything here like * your internal customer id associated with the call. Not used for processing. You * can later get this field from the call object. */ metadata?: unknown; /** * Whether this agent opts in for signed URLs for public logs and recordings. When * enabled, the generated URLs will include security signatures that restrict * access and automatically expire after 24 hours. */ opt_in_signed_url?: boolean; /** * Public log of the call, containing details about all the requests and responses * received in LLM WebSocket, latency tracking for each turntaking, helpful for * debugging and tracing. Available after call ends. */ public_log_url?: string; /** * Recording of the call, with each party's audio stored in a separate channel. * Available after the call ends. */ recording_multi_channel_url?: string; /** * Recording of the call. Available after call ends. */ recording_url?: string; /** * Add optional dynamic variables in key value pairs of string that injects into * your Response Engine prompt and tool description. Only applicable for Response * Engine. */ retell_llm_dynamic_variables?: { [key: string]: string; }; /** * Recording of the call without PII, with each party's audio stored in a separate * channel. Available after the call ends. */ scrubbed_recording_multi_channel_url?: string; /** * Recording of the call without PII. Available after call ends. */ scrubbed_recording_url?: string; /** * Begin timestamp (milliseconds since epoch) of the call. Available after call * starts. */ start_timestamp?: number; /** * The destination number or identifier where the call was transferred to. Only * populated when the disconnection reason was `call_transfer`. Can be a phone * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a * ";transport=..." portion (if transport is known) where the transport type can be * "tls", "tcp" or "udp". */ transfer_destination?: string | null; /** * Transfer end timestamp (milliseconds since epoch) of the call. Available after * transfer call ends. */ transfer_end_timestamp?: number; } namespace V3WebCallResponse { /** * Post call analysis that includes information such as sentiment, status, summary, * and custom defined data to extract. Available after call ends. Subscribe to * `call_analyzed` webhook event type to receive it once ready. */ interface CallAnalysis { /** * Whether the agent seems to have a successful call with the user, where the agent * finishes the task, and the call was complete without being cutoff. */ call_successful?: boolean; /** * A high level summary of the call. */ call_summary?: string; /** * Custom analysis data that was extracted based on the schema defined in agent * post call analysis data. Can be empty if nothing is specified. */ custom_analysis_data?: unknown; /** * Whether the call is entered voicemail. */ in_voicemail?: boolean; /** * Sentiment of the user in the call. */ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown'; } /** * Cost of the call, including all the products and their costs and discount. */ interface CallCost { /** * Combined cost of all individual costs in cents */ combined_cost: number; /** * List of products with their unit prices and costs in cents */ product_costs: Array; /** * Total duration of the call in seconds */ total_duration_seconds: number; /** * Total unit duration price of all products in cents per second */ total_duration_unit_price: number; } namespace CallCost { interface ProductCost { /** * Cost for the product in cents for the duration of the call. */ cost: number; /** * Product name that has a cost associated with it. */ product: string; /** * True if this cost item is for a transfer segment. */ is_transfer_leg_cost?: boolean; /** * Unit price of the product in cents per second. */ unit_price?: number; } } /** * Latency tracking of the call, available after call ends. Not all fields here * will be available, as it depends on the type of call and feature used. */ interface Latency { /** * Transcription latency (diff between the duration of the chunks streamed and the * durations of the transcribed part) tracking of the call. */ asr?: Latency.Asr; /** * End to end latency (from user stops talking to agent start talking) tracking of * the call. This latency does not account for the network trip time from Retell * server to user frontend. The latency is tracked every time turn change between * user and agent. */ e2e?: Latency.E2E; /** * Knowledge base latency (from the triggering of knowledge base retrival to all * relevant context received) tracking of the call. Only populated when using * knowledge base feature for the agent of the call. */ knowledge_base?: Latency.KnowledgeBase; /** * LLM latency (from issue of LLM call to first speakable chunk received) tracking * of the call. When using custom LLM. this latency includes LLM websocket * roundtrip time between user server and Retell server. */ llm?: Latency.Llm; /** * LLM websocket roundtrip latency (between user server and Retell server) tracking * of the call. Only populated for calls using custom LLM. */ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt; /** * Speech-to-speech latency (from requesting responses of a S2S model to first byte * received) tracking of the call. Only populated for calls that uses S2S model * like Realtime API. */ s2s?: Latency.S2s; /** * Text-to-speech latency (from the triggering of TTS to first byte received) * tracking of the call. */ tts?: Latency.Tts; } namespace Latency { /** * Transcription latency (diff between the duration of the chunks streamed and the * durations of the transcribed part) tracking of the call. */ interface Asr { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * End to end latency (from user stops talking to agent start talking) tracking of * the call. This latency does not account for the network trip time from Retell * server to user frontend. The latency is tracked every time turn change between * user and agent. */ interface E2E { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Knowledge base latency (from the triggering of knowledge base retrival to all * relevant context received) tracking of the call. Only populated when using * knowledge base feature for the agent of the call. */ interface KnowledgeBase { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * LLM latency (from issue of LLM call to first speakable chunk received) tracking * of the call. When using custom LLM. this latency includes LLM websocket * roundtrip time between user server and Retell server. */ interface Llm { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * LLM websocket roundtrip latency (between user server and Retell server) tracking * of the call. Only populated for calls using custom LLM. */ interface LlmWebsocketNetworkRtt { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Speech-to-speech latency (from requesting responses of a S2S model to first byte * received) tracking of the call. Only populated for calls that uses S2S model * like Realtime API. */ interface S2s { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Text-to-speech latency (from the triggering of TTS to first byte received) * tracking of the call. */ interface Tts { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } } /** * LLM token usage of the call, available after call ends. Not populated if using * custom LLM, realtime API, or no LLM call is made. */ interface LlmTokenUsage { /** * Average token count of the call. */ average: number; /** * Number of requests made to the LLM. */ num_requests: number; /** * All the token count values in the call. */ values: Array; } } interface V3PhoneCallResponse { /** * Corresponding agent id of this call. */ agent_id: string; /** * The version of the agent. */ agent_version: number; /** * Unique id of the call. Used to identify the call in the LLM websocket and used * to authenticate in the audio websocket. */ call_id: string; /** * Status of call. * * - `registered`: Call id issued, starting to make a call using this id. * - `ongoing`: Call connected and ongoing. * - `ended`: The underlying websocket has ended for the call. Either user or agent * hung up, or call transferred. * - `error`: Call encountered error. */ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error'; /** * Type of the call. Used to distinguish between web call and phone call. */ call_type: 'phone_call'; /** * Direction of the phone call. */ direction: 'inbound' | 'outbound'; /** * The caller number. */ from_number: string; /** * The callee number. */ to_number: string; /** * Name of the agent. */ agent_name?: string; /** * Tag pointing at the agent version used for this call, captured at call creation * time and frozen thereafter (unaffected by later tag reassignments). Populated * whether the caller dispatched by tag, numeric version, "latest", or * "latest_published" — when the caller specified a tag, that tag wins; otherwise * the most-recently- assigned tag on the resolved version is used. Absent when no * tag points at the resolved version (or for calls created before this field was * introduced). */ agent_tag?: string | null; /** * Post call analysis that includes information such as sentiment, status, summary, * and custom defined data to extract. Available after call ends. Subscribe to * `call_analyzed` webhook event type to receive it once ready. */ call_analysis?: V3PhoneCallResponse.CallAnalysis; /** * Cost of the call, including all the products and their costs and discount. */ call_cost?: V3PhoneCallResponse.CallCost; /** * Dynamic variables collected from the call. Only available after the call ends. */ collected_dynamic_variables?: { [key: string]: string; }; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Data storage setting for this call's agent. "everything" stores all data, * "everything_except_pii" excludes PII when possible, "basic_attributes_only" * stores only metadata. */ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null; /** * The reason for the disconnection of the call. Read detailed description about * reasons listed here at * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons). */ disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'user_requested_dnc' | 'user_requested_callback' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_concurrency_fallback' | 'no_valid_payment' | 'credit_exhausted' | 'budget_reached' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'network_blocked' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped' | 'call_take_over'; /** * Duration of the call in milliseconds. Available after call ends. */ duration_ms?: number; /** * End timestamp (milliseconds since epoch) of the call. Available after call ends. */ end_timestamp?: number; /** * URL to the knowledge base retrieved contents of the call. Available after call * ends if the call utilizes knowledge base feature. It consists of the respond id * and the retrieved contents related to that response. It's already rendered in * call history tab of dashboard, and you can also manually download and check * against the transcript to view the knowledge base retrieval results. */ knowledge_base_retrieved_contents_url?: string; /** * Latency tracking of the call, available after call ends. Not all fields here * will be available, as it depends on the type of call and feature used. */ latency?: V3PhoneCallResponse.Latency; /** * LLM token usage of the call, available after call ends. Not populated if using * custom LLM, realtime API, or no LLM call is made. */ llm_token_usage?: V3PhoneCallResponse.LlmTokenUsage; /** * An arbitrary object for storage purpose only. You can put anything here like * your internal customer id associated with the call. Not used for processing. You * can later get this field from the call object. */ metadata?: unknown; /** * Whether this agent opts in for signed URLs for public logs and recordings. When * enabled, the generated URLs will include security signatures that restrict * access and automatically expire after 24 hours. */ opt_in_signed_url?: boolean; /** * Public log of the call, containing details about all the requests and responses * received in LLM WebSocket, latency tracking for each turntaking, helpful for * debugging and tracing. Available after call ends. */ public_log_url?: string; /** * Recording of the call, with each party's audio stored in a separate channel. * Available after the call ends. */ recording_multi_channel_url?: string; /** * Recording of the call. Available after call ends. */ recording_url?: string; /** * Add optional dynamic variables in key value pairs of string that injects into * your Response Engine prompt and tool description. Only applicable for Response * Engine. */ retell_llm_dynamic_variables?: { [key: string]: string; }; /** * Recording of the call without PII, with each party's audio stored in a separate * channel. Available after the call ends. */ scrubbed_recording_multi_channel_url?: string; /** * Recording of the call without PII. Available after call ends. */ scrubbed_recording_url?: string; /** * Begin timestamp (milliseconds since epoch) of the call. Available after call * starts. */ start_timestamp?: number; /** * Telephony identifier of the call, populated when available. Tracking purposes * only. */ telephony_identifier?: V3PhoneCallResponse.TelephonyIdentifier; /** * The destination number or identifier where the call was transferred to. Only * populated when the disconnection reason was `call_transfer`. Can be a phone * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a * ";transport=..." portion (if transport is known) where the transport type can be * "tls", "tcp" or "udp". */ transfer_destination?: string | null; /** * Transfer end timestamp (milliseconds since epoch) of the call. Available after * transfer call ends. */ transfer_end_timestamp?: number; } namespace V3PhoneCallResponse { /** * Post call analysis that includes information such as sentiment, status, summary, * and custom defined data to extract. Available after call ends. Subscribe to * `call_analyzed` webhook event type to receive it once ready. */ interface CallAnalysis { /** * Whether the agent seems to have a successful call with the user, where the agent * finishes the task, and the call was complete without being cutoff. */ call_successful?: boolean; /** * A high level summary of the call. */ call_summary?: string; /** * Custom analysis data that was extracted based on the schema defined in agent * post call analysis data. Can be empty if nothing is specified. */ custom_analysis_data?: unknown; /** * Whether the call is entered voicemail. */ in_voicemail?: boolean; /** * Sentiment of the user in the call. */ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown'; } /** * Cost of the call, including all the products and their costs and discount. */ interface CallCost { /** * Combined cost of all individual costs in cents */ combined_cost: number; /** * List of products with their unit prices and costs in cents */ product_costs: Array; /** * Total duration of the call in seconds */ total_duration_seconds: number; /** * Total unit duration price of all products in cents per second */ total_duration_unit_price: number; } namespace CallCost { interface ProductCost { /** * Cost for the product in cents for the duration of the call. */ cost: number; /** * Product name that has a cost associated with it. */ product: string; /** * True if this cost item is for a transfer segment. */ is_transfer_leg_cost?: boolean; /** * Unit price of the product in cents per second. */ unit_price?: number; } } /** * Latency tracking of the call, available after call ends. Not all fields here * will be available, as it depends on the type of call and feature used. */ interface Latency { /** * Transcription latency (diff between the duration of the chunks streamed and the * durations of the transcribed part) tracking of the call. */ asr?: Latency.Asr; /** * End to end latency (from user stops talking to agent start talking) tracking of * the call. This latency does not account for the network trip time from Retell * server to user frontend. The latency is tracked every time turn change between * user and agent. */ e2e?: Latency.E2E; /** * Knowledge base latency (from the triggering of knowledge base retrival to all * relevant context received) tracking of the call. Only populated when using * knowledge base feature for the agent of the call. */ knowledge_base?: Latency.KnowledgeBase; /** * LLM latency (from issue of LLM call to first speakable chunk received) tracking * of the call. When using custom LLM. this latency includes LLM websocket * roundtrip time between user server and Retell server. */ llm?: Latency.Llm; /** * LLM websocket roundtrip latency (between user server and Retell server) tracking * of the call. Only populated for calls using custom LLM. */ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt; /** * Speech-to-speech latency (from requesting responses of a S2S model to first byte * received) tracking of the call. Only populated for calls that uses S2S model * like Realtime API. */ s2s?: Latency.S2s; /** * Text-to-speech latency (from the triggering of TTS to first byte received) * tracking of the call. */ tts?: Latency.Tts; } namespace Latency { /** * Transcription latency (diff between the duration of the chunks streamed and the * durations of the transcribed part) tracking of the call. */ interface Asr { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * End to end latency (from user stops talking to agent start talking) tracking of * the call. This latency does not account for the network trip time from Retell * server to user frontend. The latency is tracked every time turn change between * user and agent. */ interface E2E { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Knowledge base latency (from the triggering of knowledge base retrival to all * relevant context received) tracking of the call. Only populated when using * knowledge base feature for the agent of the call. */ interface KnowledgeBase { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * LLM latency (from issue of LLM call to first speakable chunk received) tracking * of the call. When using custom LLM. this latency includes LLM websocket * roundtrip time between user server and Retell server. */ interface Llm { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * LLM websocket roundtrip latency (between user server and Retell server) tracking * of the call. Only populated for calls using custom LLM. */ interface LlmWebsocketNetworkRtt { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Speech-to-speech latency (from requesting responses of a S2S model to first byte * received) tracking of the call. Only populated for calls that uses S2S model * like Realtime API. */ interface S2s { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } /** * Text-to-speech latency (from the triggering of TTS to first byte received) * tracking of the call. */ interface Tts { /** * Maximum latency in the call, measured in milliseconds. */ max?: number; /** * Minimum latency in the call, measured in milliseconds. */ min?: number; /** * Number of data points (number of times latency is tracked). */ num?: number; /** * 50 percentile of latency, measured in milliseconds. */ p50?: number; /** * 90 percentile of latency, measured in milliseconds. */ p90?: number; /** * 95 percentile of latency, measured in milliseconds. */ p95?: number; /** * 99 percentile of latency, measured in milliseconds. */ p99?: number; /** * All the latency data points in the call, measured in milliseconds. */ values?: Array; } } /** * LLM token usage of the call, available after call ends. Not populated if using * custom LLM, realtime API, or no LLM call is made. */ interface LlmTokenUsage { /** * Average token count of the call. */ average: number; /** * Number of requests made to the LLM. */ num_requests: number; /** * All the token count values in the call. */ values: Array; } /** * Telephony identifier of the call, populated when available. Tracking purposes * only. */ interface TelephonyIdentifier { /** * Twilio call sid. */ twilio_call_sid?: string; } } } export interface CallListenLiveResponse { /** * Subscribe-only JWT scoped to the call's room. Cannot publish. Listener * participant is hidden from other participants. */ access_token: string; /** * Unix epoch ms when the access_token expires. */ expires_at: number; /** * Identity this listener joins as, and the value to hand back to * /v2/take-over-live-call. Returned on both transports; a `livekit` client can * equally read it off its own room object, a `gateway` one has no equivalent to * read. */ participant_id: string; /** * Room name to join. Always the call's original room — does not follow warm * transfers. */ room_name: string; /** * Public side of the gateway instance handling this call, for diagnostics only — * the client's media address comes from the SDP answer's ICE candidates. `gateway` * transport only. */ gateway_ip?: string; /** * ICE servers the client must configure before creating its PeerConnection — they * cannot be added afterwards. `gateway` transport only. */ ice_servers?: Array; /** * Which media stack issued the access_token, and therefore where the client * signals. The two tokens are indistinguishable, so a client must read this rather * than infer it. `gateway` clients address Retell itself; `livekit` clients * connect to the returned `url`. Optional only because a server predating the * field omits it during a rollout; treat absent as `livekit`. */ transport?: 'livekit' | 'gateway'; /** * Server URL the client should connect to with the access_token. Present only when * `transport` is `livekit`; a `gateway` listener signals to Retell and needs no * address. */ url?: string; } export declare namespace CallListenLiveResponse { interface IceServer { urls: string | Array; credential?: string; username?: string; } } export interface CallTakeOverLiveResponse { success: boolean; } export interface CallUpdateLiveResponse { success: boolean; } export interface CallUpdateParams { /** * Custom attributes for the call, as key-value pairs. Each attribute must first be * defined for your organization in the Retell dashboard (Call History → Actions → * Custom attributes) before it can be set here. The object key must match the id * of an existing organization-level custom attribute; keys that do not match a * defined attribute are ignored and will not be saved. Values must be a string, * number, or boolean. */ custom_attributes?: { [key: string]: string | number | boolean; }; /** * Data storage setting for this call. Overrides the agent's default setting. * "everything" stores all data, "everything_except_pii" excludes PII when * possible, "basic_attributes_only" stores only metadata. Cannot be downgraded * from more restrictive to less restrictive settings. */ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only'; /** * An arbitrary object for storage purpose only. You can put anything here like * your internal customer id associated with the call. Not used for processing. You * can later get this field from the call object. Size limited to 50kB max. */ metadata?: unknown; } export interface CallListParams { /** * Filter criteria for calls. All conditions are implicitly connected with AND. */ filter_criteria?: CallListParams.FilterCriteria; /** * Whether to include `total` (count of all calls matching `filter_criteria`, * ignoring `limit`/`skip`/`pagination_key`) in the response. Defaults to false. * Each enabled request triggers an additional aggregate query, so opt in only when * the total is needed. */ include_total?: boolean; /** * Maximum number of calls to return. */ limit?: number; /** * Opaque pagination cursor from a previous response. */ pagination_key?: string; /** * Number of records to skip for pagination. */ skip?: number; /** * Sort calls by `start_timestamp` in ascending or descending order. */ sort_order?: 'ascending' | 'descending'; } export declare namespace CallListParams { /** * Filter criteria for calls. All conditions are implicitly connected with AND. */ interface FilterCriteria { /** * Filter by agent(s). Agent filters are connected by OR. */ agent?: Array; /** * Filter by agent environment tag(s) (e.g. "prod", "staging"). */ agent_tag?: FilterCriteria.AgentTag; /** * Filter by batch call ID. */ batch_call_id?: FilterCriteria.BatchCallID; /** * Filter by call ID. */ call_id?: FilterCriteria.StringFilter | FilterCriteria.EnumFilter; call_status?: FilterCriteria.CallStatus; /** * Filter by whether the call was successful. */ call_successful?: FilterCriteria.CallSuccessful; call_type?: FilterCriteria.CallType; /** * Filter by total call cost in cents. */ combined_cost?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter; /** * Filter by custom post-call analysis outputs. Each filter `key` matches the * configured output's `name`. */ custom_analysis_data?: Array; /** * Filter by organization-level attributes that attach business context to calls, * such as customer tier or campaign, so calls can be organized and filtered * consistently in Call History. Use the attribute ID as `key` and the call's * attribute value as `value`. */ custom_attributes?: Array; data_storage_setting?: FilterCriteria.DataStorageSetting; direction?: FilterCriteria.Direction; disconnection_reason?: FilterCriteria.DisconnectionReason; /** * Filter by call duration in milliseconds. */ duration_ms?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter; /** * Filter by dynamic variables stored on the call. Each filter `key` matches a * dynamic-variable name. */ dynamic_variables?: Array; /** * Filter by per-call p50 end-to-end latency in milliseconds. */ e2e_latency_p50?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter; /** * Filter by call end timestamp (epoch ms). */ end_timestamp?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter; /** * Filter by from number. */ from_number?: FilterCriteria.FromNumber; /** * Filter by whether the call is in voicemail. */ in_voicemail?: FilterCriteria.InVoicemail; /** * Filter by values stored in the call's `metadata`. Each filter `key` matches a * top-level metadata key. */ metadata?: Array; /** * Filter by call start timestamp (epoch ms). */ start_timestamp?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter; /** * Filter by to number. */ to_number?: FilterCriteria.ToNumber; /** * Filter by tool call criteria. Tool call filters are connected by AND. */ tool_calls?: Array; user_sentiment?: FilterCriteria.UserSentiment; } namespace FilterCriteria { interface Agent { /** * The agent ID to filter on. */ agent_id: string; /** * Specific versions to filter on. If omitted or empty, all versions are included. */ version?: Array; } /** * Filter by agent environment tag(s) (e.g. "prod", "staging"). */ interface AgentTag { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array; } /** * Filter by batch call ID. */ interface BatchCallID { /** * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains */ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co'; type: 'string'; value: string; } interface StringFilter { /** * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains */ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co'; type: 'string'; value: string; } interface EnumFilter { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array; } interface CallStatus { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array<'not_connected' | 'ongoing' | 'ended' | 'error'>; } /** * Filter by whether the call was successful. */ interface CallSuccessful { op: 'eq'; type: 'boolean'; value: boolean; } interface CallType { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array<'web_call' | 'phone_call'>; } interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; } interface StringFilter { /** * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains */ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co'; type: 'string'; value: string; /** * The field name to filter on. */ key?: string; } interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; /** * The field name to filter on. */ key?: string; } interface BooleanFilter { op: 'eq'; type: 'boolean'; value: boolean; /** * The field name to filter on. */ key?: string; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; /** * The field name to filter on. */ key?: string; } interface EnumFilter { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array; /** * The field name to filter on. */ key?: string; } interface PresentFilter { /** * pr: present (has value), np: not present */ op: 'pr' | 'np'; type: 'present'; /** * The field name to filter on. */ key?: string; } interface StringFilter { /** * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains */ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co'; type: 'string'; value: string; /** * The field name to filter on. */ key?: string; } interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; /** * The field name to filter on. */ key?: string; } interface BooleanFilter { op: 'eq'; type: 'boolean'; value: boolean; /** * The field name to filter on. */ key?: string; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; /** * The field name to filter on. */ key?: string; } interface EnumFilter { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array; /** * The field name to filter on. */ key?: string; } interface PresentFilter { /** * pr: present (has value), np: not present */ op: 'pr' | 'np'; type: 'present'; /** * The field name to filter on. */ key?: string; } interface DataStorageSetting { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array<'everything' | 'everything_except_pii' | 'basic_attributes_only'>; } interface Direction { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array<'inbound' | 'outbound'>; } interface DisconnectionReason { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array<'user_hangup' | 'agent_hangup' | 'user_requested_dnc' | 'user_requested_callback' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_concurrency_fallback' | 'no_valid_payment' | 'credit_exhausted' | 'budget_reached' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'network_blocked' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped' | 'call_take_over'>; } interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; } interface StringFilter { /** * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains */ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co'; type: 'string'; value: string; /** * The field name to filter on. */ key?: string; } interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; /** * The field name to filter on. */ key?: string; } interface BooleanFilter { op: 'eq'; type: 'boolean'; value: boolean; /** * The field name to filter on. */ key?: string; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; /** * The field name to filter on. */ key?: string; } interface EnumFilter { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array; /** * The field name to filter on. */ key?: string; } interface PresentFilter { /** * pr: present (has value), np: not present */ op: 'pr' | 'np'; type: 'present'; /** * The field name to filter on. */ key?: string; } interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; } interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; } /** * Filter by from number. */ interface FromNumber { /** * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains */ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co'; type: 'string'; value: string; } /** * Filter by whether the call is in voicemail. */ interface InVoicemail { op: 'eq'; type: 'boolean'; value: boolean; } interface StringFilter { /** * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains */ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co'; type: 'string'; value: string; /** * The field name to filter on. */ key?: string; } interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; /** * The field name to filter on. */ key?: string; } interface BooleanFilter { op: 'eq'; type: 'boolean'; value: boolean; /** * The field name to filter on. */ key?: string; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; /** * The field name to filter on. */ key?: string; } interface EnumFilter { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array; /** * The field name to filter on. */ key?: string; } interface PresentFilter { /** * pr: present (has value), np: not present */ op: 'pr' | 'np'; type: 'present'; /** * The field name to filter on. */ key?: string; } interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; } /** * Filter by to number. */ interface ToNumber { /** * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains */ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co'; type: 'string'; value: string; } interface ToolCall { /** * Filter by tool call latency in milliseconds. */ latency_ms?: ToolCall.NumberFilter | ToolCall.RangeFilter; /** * The tool call name to filter on. */ name?: string; /** * Filter by tool call success status. */ success?: ToolCall.Success; /** * The tool call type to filter on. */ type?: string; } namespace ToolCall { interface NumberFilter { /** * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less * than, le: less than or equal */ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le'; type: 'number'; value: number; } interface RangeFilter { /** * bt: between */ op: 'bt'; type: 'range'; /** * [lower_bound, upper_bound] */ value: Array; } /** * Filter by tool call success status. */ interface Success { op: 'eq'; type: 'boolean'; value: boolean; } } interface UserSentiment { /** * in: value is one of the listed values */ op: 'in'; type: 'enum'; value: Array<'Negative' | 'Positive' | 'Neutral' | 'Unknown'>; } } } export interface CallCreatePhoneCallParams { /** * The number you own in E.164 format. Must be a number purchased from Retell or * imported to Retell. */ from_number: string; /** * The number you want to call, in E.164 format. If using a number purchased from * Retell, only US numbers are supported as destination. */ to_number: string; /** * For this particular call, override agent configuration with these settings. This * allows you to customize agent behavior for individual calls without modifying * the base agent. */ agent_override?: CallCreatePhoneCallParams.AgentOverride; /** * Add optional custom SIP headers to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * If true, the call is rejected with a 400 error when the contact for to_number is * marked do_not_call. If omitted, the default value is false. */ honor_internal_dnc?: boolean; /** * Optional key to retry the same request for up to one hour without creating * another call. Use a new key for each new call. */ idempotency_key?: string; /** * If true, the e.164 validation will be ignored for the from_number. This can be * useful when you want to dial to internal pseudo numbers. This only applies when * you are using custom telephony and does not apply when you are using Retell * Telephony. If omitted, the default value is false. */ ignore_e164_validation?: boolean; /** * An arbitrary object for storage purpose only. You can put anything here like * your internal customer id associated with the call. Not used for processing. You * can later get this field from the call object. */ metadata?: unknown; /** * For this particular call, override the agent used with this agent id. This does * not bind the agent to this number, this is for one time override. */ override_agent_id?: string; /** * For this particular call, override the agent version used with this version. * This does not bind the agent version to this number, this is for one time * override. */ override_agent_version?: string | number; /** * Add optional dynamic variables in key value pairs of string that injects into * your Response Engine prompt and tool description. Only applicable for Response * Engine. */ retell_llm_dynamic_variables?: { [key: string]: string; }; } export declare namespace CallCreatePhoneCallParams { /** * For this particular call, override agent configuration with these settings. This * allows you to customize agent behavior for individual calls without modifying * the base agent. */ interface AgentOverride { /** * Override agent configuration settings. Any properties specified here will * override the base agent configuration for this call. If a Retell LLM or * Conversation Flow response engine is specified without a version, it uses the * latest version. */ agent?: AgentOverride.Agent; /** * Override conversation flow configuration settings. Only applicable when using * conversation flow as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms. A * model_config override can set backup to null to remove it for this call. */ conversation_flow?: AgentOverride.ConversationFlow; /** * Override Retell LLM configuration settings. Only applicable when using Retell * LLM as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms, * begin_message. A model_config override can set backup to null to remove it for * this call, but cannot switch a speech-to-speech LLM to a cascading model. */ retell_llm?: AgentOverride.RetellLlm; } namespace AgentOverride { /** * Override agent configuration settings. Any properties specified here will * override the base agent configuration for this call. If a Retell LLM or * Conversation Flow response engine is specified without a version, it uses the * latest version. */ interface Agent { /** * The name of the agent. Only used for your own reference. */ agent_name?: string | null; /** * If set to true, DTMF input will interrupt the agent even when * interruption_sensitivity is 0. Can be overridden per conversation or subagent * node. Default to false. */ allow_dtmf_interruption?: boolean; /** * If set to true, DTMF input will be accepted and processed. If false, any DTMF * input will be ignored. Default to true. */ allow_user_dtmf?: boolean; /** * If set, will add ambient environment sound to the call to make experience more * realistic. Currently supports the following options: * * - `coffee-shop`: Coffee shop ambience with people chatting in background. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/coffee-shop.wav) * - `convention-hall`: Convention hall ambience, with some echo and people * chatting in background. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/convention-hall.wav) * - `summer-outdoor`: Summer outdoor ambience with cicada chirping. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/summer-outdoor.wav) * - `mountain-outdoor`: Mountain outdoor ambience with birds singing. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/mountain-outdoor.wav) * - `static-noise`: Constant static noise. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/static-noise.wav) * - `call-center`: Call center work noise. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/call-center.wav) * Set to `null` to remove ambient sound from this agent. */ ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'static-noise' | 'call-center' | null; /** * If set, will control the volume of the ambient sound. Value ranging from [0,2]. * Lower value means quieter ambient sound, while higher value means louder ambient * sound. If unset, default value 1 will apply. */ ambient_sound_volume?: number; /** * Only applicable when enable_backchannel is true. Controls how often the agent * would backchannel when a backchannel is possible. Value ranging from [0,1]. * Lower value means less frequent backchannel, while higher value means more * frequent backchannel. If unset, default value 0.8 will apply. */ backchannel_frequency?: number; /** * Only applicable when enable_backchannel is true. A list of words that the agent * would use as backchannel. If not set, default backchannel words will apply. * Check out * [backchannel default words](/agent/interaction-configuration#backchannel) for * more details. Note that certain voices do not work too well with certain words, * so it's recommended to experiment before adding any words. */ backchannel_words?: Array | null; /** * If set, will delay the first message by the specified amount of milliseconds, so * that it gives user more time to prepare to take the call. Valid range is [0, * 5000]. If not set or set to 0, agent will speak immediately. Only applicable * when agent speaks first. */ begin_message_delay_ms?: number; /** * Provide a customized list of keywords to bias the transcriber model, so that * these words are more likely to get transcribed. Commonly used for names, brands, * street, etc. Entries may reference dynamic variables with `{{variable}}` syntax. */ boosted_keywords?: Array | null; /** * If this option is set, the agent prompt will include call screen handling * instructions for identity and call purpose questions. Set this to null to * disable call screen prompt instructions. */ call_screening_option?: Agent.CallScreeningOption | null; /** * Contact memory settings for phone calls and SMS chats. Creating an agent * defaults enable_update to false and enable_read to true. Updates only change the * supplied flags; omitted flags stay unchanged and an empty object has no effect. * Set a flag to false to disable it. The configuration cannot be cleared. Existing * agents without this configuration have both disabled. */ contact_memory_config?: Agent.ContactMemoryConfig; /** * Custom STT configuration. Only used when stt_mode is set to custom. */ custom_stt_config?: Agent.CustomSttConfig | null; /** * Number of days to retain call/chat data before automatic deletion. Must be * between 1 and 730 days. If not set, data is retained forever (no automatic * deletion). */ data_storage_retention_days?: number | null; /** * Granular setting to manage how Retell stores sensitive data (transcripts, * recordings, logs, etc.). This replaces the deprecated * `opt_out_sensitive_data_storage` field. * * - `everything`: Store all data including transcripts, recordings, and logs. * - `everything_except_pii`: Store data without PII when PII is detected. * - `basic_attributes_only`: Store only basic attributes; no * transcripts/recordings/logs. If not set, default value of "everything" will * apply. */ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only'; /** * Controls the enhancement level for background voice cancellation. Set to 0 to * bypass background voice cancellation without BVC charges. Value ranging from * [0,1]. Only applicable when denoising_mode is * noise-and-background-speech-cancellation. Defaults to 0.8 if no value is * configured. Set to null to clear the configured value. Omitting this field * preserves the existing value. */ denoising_enhancement_level?: number | null; /** * If set, determines what denoising mode to use. Use "no-denoise" to bypass all * audio denoising. Default to noise-cancellation. */ denoising_mode?: 'no-denoise' | 'noise-cancellation' | 'noise-and-background-speech-cancellation'; /** * Controls whether the agent would backchannel (agent interjects the speaker with * phrases like "yeah", "uh-huh" to signify interest and engagement). Backchannel * when enabled tends to show up more in longer user utterances. If not set, agent * will not backchannel. */ enable_backchannel?: boolean; /** * Whether to rewrite generated responses with the separately billed colloquial * model. This setting is independent of handbook selection and is not supported * for speech-to-speech response engines. Defaults to false. */ enable_colloquial_model?: boolean; /** * If set to true, the agent recognizes requests to stop calling or contacting the * user, confirms once, and on a clear yes ends the call with disconnection reason * user_requested_dnc and sets do_not_call to true on the contact for the user's * phone number. If unset, default value false will apply. */ enable_dnc_detection?: boolean; /** * If set to true, the agent will dynamically adjust how quickly it responds based * on the user's speech rate and past turn-taking behavior in the call. If unset, * default value false will apply. */ enable_dynamic_responsiveness?: boolean; /** * If set to true, will enable dynamic voice speed adjustment based on the user's * speech rate and conversation context. If unset, default value false will apply. */ enable_dynamic_voice_speed?: boolean; /** * Master toggle for expressive mode. When true, the agent may add expressive voice * tags to the audio it generates. Only applicable for platform voices. If unset, * defaults to false. */ enable_expressive_mode?: boolean; /** * If users stay silent for a period after agent speech, end the call. The minimum * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). */ end_call_after_silence_ms?: number; /** * The expressive voice tags Retell pre-teaches the model to use when * enable_expressive_mode is true. Custom tags defined in the system prompt are * still allowed. If empty, the agent follows general expressive guidance without a * fixed tag set. */ expressive_emotion_tags?: Array<'empathetic' | 'excited' | 'happy' | 'curious' | 'surprised' | 'sigh' | 'clear throat' | 'pause' | 'long pause' | 'emphasis'>; /** * Custom expressive voice guidance to use instead of the default Retell expressive * prompt when enable_expressive_mode is true. If omitted or blank, the default * expressive prompt will be used. */ expressive_mode_prompt?: string | null; /** * When TTS provider for the selected voice is experiencing outages, we would use * fallback voices listed here for the agent. Voice id and the fallback voice ids * must be from different TTS providers. The system would go through the list in * order, if the first one in the list is also having outage, it would use the next * one. Set to null to remove voice fallback for the agent. */ fallback_voice_ids?: Array | null; /** * Configuration for guardrail checks to detect and prevent prohibited topics in * agent output and user input. */ guardrail_config?: Agent.GuardrailConfig; /** * Enable and customize handbook prompts. Sending this field replaces the complete * handbook configuration. */ handbook_config?: Agent.HandbookConfig; /** * Controls how sensitive the agent is to user interruptions. Value ranging from * [0,1]. Lower value means it will take longer / more words for user to interrupt * agent, while higher value means it's easier for user to interrupt agent. If * unset, default value 1 will apply. When this is set to 0, agent would never be * interrupted. */ interruption_sensitivity?: number; /** * If this option is set, the call will try to detect IVR in the first 3 minutes of * the call. Actions defined will be applied when the IVR is detected. Set this to * null to disable IVR detection. */ ivr_option?: Agent.IvrOption | null; /** * Specifies what language(s) the agent will operate in. Accepts either a single * locale (e.g. `en-US`) or an array of locales for multilingual agents (e.g. * `["en-US","es-ES"]`). If unset, defaults to `en-US`. */ language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | Array<'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA'>; /** * Maximum allowed length for the call, will force end the call if reached. The * minimum value allowed is 60,000 ms (1 min), and maximum value allowed is * 7,200,000 (2 hours). By default, this is set to 3,600,000 (1 hour). */ max_call_duration_ms?: number; /** * Whether this agent opts in for signed URLs for public logs and recordings. When * enabled, the generated URLs will include security signatures that restrict * access and automatically expire after 24 hours. */ opt_in_signed_url?: boolean; /** * Configuration for PII scrubbing from transcripts and recordings. */ pii_config?: Agent.PiiConfig; /** * Post call analysis data to extract from the call. This data will augment the * pre-defined variables extracted in the call analysis. This will be available * after the call ends. */ post_call_analysis_data?: Array | null; /** * The model to use for post call analysis. Default to gpt-5.6-terra. */ post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon' | null; /** * Integration (Agent Functions) tools run as a dependency graph during teardown, * after post-call analysis. Each tool can be gated by a condition. On calls the * graph is stopped after five minutes so teardown can finish. Set to null to * clear. */ post_session_tools?: Array | null; /** * Integration (Agent Functions) tools run as a dependency graph during session * setup, before the agent's first message. Outputs are injected as dynamic * variables. On calls the graph gets one minute unless an outbound caller will be * dialed after setup, in which case it gets five minutes. Past that session * initialization continues and any remaining tools finish in the background, so * their outputs no longer reach the agent's prompt. Set to null to clear. */ pre_session_tools?: Array | null; /** * A list of words / phrases and their pronunciation to be used to guide the audio * synthesize for consistent pronunciation. Check the dashboard to see what * provider supports this feature. Set to null to remove pronunciation dictionary * from this agent. */ pronunciation_dictionary?: Array | null; /** * If set, controls how many times agent would remind user when user is * unresponsive. Must be a non negative integer. If unset, default value of 1 will * apply (remind once). Set to 0 to disable agent from reminding. */ reminder_max_count?: number; /** * If set (in milliseconds), will trigger a reminder to the agent to speak if the * user has been silent for the specified duration after some agent speech. Must be * a positive number. If unset, default value of 10000 ms (10 s) will apply. */ reminder_trigger_ms?: number; /** * The Response Engine to attach to the agent. It is used to generate responses for * the agent. You need to create a Response Engine first before attaching it to an * agent. */ response_engine?: Agent.ResponseEngineRetellLm | Agent.ResponseEngineCustomLm | Agent.ResponseEngineConversationFlow; /** * Controls how responsive is the agent. Value ranging from [0,1]. Lower value * means less responsive agent (wait more, respond slower), while higher value * means faster exchanges (respond when it can). If unset, default value 1 will * apply. */ responsiveness?: number; /** * If set, the phone ringing will last for the specified amount of milliseconds. * This applies for both outbound call ringtime, and call transfer ringtime. * Default to 30000 (30 s). Valid range is [5000, 300000]. */ ring_duration_ms?: number; /** * The expiration time for the signed url in milliseconds. Only applicable when * opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will * apply. */ signed_url_expiration_ms?: number | null; /** * If set, determines whether speech to text should focus on latency or accuracy. * Default to fast mode. When set to custom, custom_stt_config must be provided. */ stt_mode?: 'fast' | 'accurate' | 'custom'; /** * IANA timezone for the agent (e.g. America/New_York). Defaults to * America/Los_Angeles if not set. */ timezone?: string | null; user_dtmf_options?: Agent.UserDtmfOptions | null; /** * Optional description of the agent version. Used for your own reference and * documentation. */ version_description?: string | null; /** * Optional title of the agent version. Used for your own reference. */ version_title?: string | null; /** * If set, determines the vocabulary set to use for transcription. This setting * only applies for English agents, for non English agent, this setting is a no-op. * Default to general. */ vocab_specialization?: 'general' | 'medical'; /** * Unique voice id used for the agent. Find list of available voices and their * preview in Dashboard. */ voice_id?: string; /** * Select the voice model used for the selected voice. Each provider has a set of * available voice models. Set to null to remove voice model selection, and default * ones will apply. Check out dashboard for more details of each voice model. */ voice_model?: 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'eleven_v3_conversational' | 'eleven_v4' | 'eleven_v4_turbo' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'sonic-3.6' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | 'drama-3' | 'inworld-tts-2' | 'inworld-tts-2-flash' | null; /** * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower * speech, while higher value means faster speech rate. If unset, default value 1 * will apply. */ voice_speed?: number; /** * Controls how stable the voice is. Value ranging from [0,2]. Lower value means * more stable, and higher value means more variant speech generation. Check the * dashboard to see what provider supports this feature. If unset, default value 1 * will apply. */ voice_temperature?: number; /** * If this option is set, the call will try to detect voicemail in the first 3 * minutes of the call. Actions defined (hangup, or leave a message) will be * applied when the voicemail is detected. Set this to null to disable voicemail * detection. */ voicemail_option?: Agent.VoicemailOption | null; /** * If set, will control the volume of the agent. Value ranging from [0,2]. Lower * value means quieter agent speech, while higher value means louder agent speech. * If unset, default value 1 will apply. */ volume?: number; /** * Which webhook events this agent should receive. If not set, defaults to * call_started, call_ended, call_analyzed. */ webhook_events?: Array<'call_started' | 'call_ended' | 'call_analyzed' | 'transcript_updated' | 'transfer_started' | 'transfer_bridged' | 'transfer_cancelled' | 'transfer_ended'> | null; /** * The timeout for the webhook in milliseconds. If not set, default value of 10000 * will apply. */ webhook_timeout_ms?: number; /** * The webhook for agent to listen to call events. See what events it would get at * [webhook doc](/features/webhook). If set, will binds webhook events for this * agent to the specified url, and will ignore the account level webhook for this * agent. Set to `null` to remove webhook url from this agent. */ webhook_url?: string | null; } namespace Agent { /** * If this option is set, the agent prompt will include call screen handling * instructions for identity and call purpose questions. Set this to null to * disable call screen prompt instructions. */ interface CallScreeningOption { /** * Identity the agent should provide when a call screen asks who is calling. * Dynamic variables are supported. */ agent_identity: string; /** * Purpose the agent should provide when a call screen asks why it is calling. * Dynamic variables are supported. */ call_purpose: string; } /** * Contact memory settings for phone calls and SMS chats. Creating an agent * defaults enable_update to false and enable_read to true. Updates only change the * supplied flags; omitted flags stay unchanged and an empty object has no effect. * Set a flag to false to disable it. The configuration cannot be cleared. Existing * agents without this configuration have both disabled. */ interface ContactMemoryConfig { /** * Automatically add saved contact memory to the agent prompt. Skippable nodes can * use answers from the current conversation even when this setting is disabled. * Contact dynamic variables, including contact_memory, remain available regardless * of this setting. */ enable_read?: boolean; /** * Rewrite the contact memory after each conversation. Cannot be enabled for * payment agents. Requires storing conversation data. Chat agents must also have * end_chat_after_silence_ms set. */ enable_update?: boolean; } /** * Custom STT configuration. Only used when stt_mode is set to custom. */ interface CustomSttConfig { /** * Endpointing timeout in milliseconds. Minimum is 100 for Azure, 10 for Deepgram, * 500 for Soniox, 100 for AssemblyAI, 100 for Muse. For AssemblyAI, this sets * min_turn_silence (100-3000 ms). max_turn_silence adds half of this value, * rounded to the nearest millisecond and bounded to 500-1000 ms, with a total cap * of 3000 ms. Muse detects turn ends itself and ignores this value. */ endpointing_ms: number; /** * ASR provider name. */ provider: 'azure' | 'deepgram' | 'soniox' | 'assemblyai' | 'muse'; } /** * Configuration for guardrail checks to detect and prevent prohibited topics in * agent output and user input. */ interface GuardrailConfig { /** * Selected prohibited user topic categories to check. When user messages contain * these topics, the agent will respond with a placeholder message instead of * processing the request. */ input_topics?: Array<'platform_integrity_jailbreaking'> | null; /** * Selected prohibited agent topic categories to check. When agent messages contain * these topics, they will be replaced with a placeholder message. */ output_topics?: Array<'harassment' | 'self_harm' | 'sexual_exploitation' | 'violence' | 'defense_and_national_security' | 'illicit_and_harmful_activity' | 'gambling' | 'regulated_professional_advice' | 'child_safety_and_exploitation'> | null; } /** * Enable and customize handbook prompts. Sending this field replaces the complete * handbook configuration. */ interface HandbookConfig { /** * When asked, acknowledge being a virtual assistant. */ ai_disclosure?: boolean | HandbookConfig.HandbookEntryConfig; /** * Conversational handbook. */ conversational?: HandbookConfig.Conversational; /** * Legacy name for conversational. Cannot be sent together with conversational. For * compatibility, true also enables enable_colloquial_model when that field is * omitted. */ conversational_personality?: boolean; /** * Customer Support handbook. */ customer_support?: HandbookConfig.CustomerSupport; /** * Legacy name for customer_support. Cannot be sent together with customer_support. */ default_personality?: boolean; /** * Repeat back and confirm important details (voice only). */ echo_verification?: boolean | HandbookConfig.HandbookEntryConfig; /** * Warm acknowledgment of caller concerns. */ high_empathy?: boolean | HandbookConfig.HandbookEntryConfig; /** * Spell using NATO phonetic alphabet style (voice only). */ nato_phonetic_alphabet?: boolean | HandbookConfig.HandbookEntryConfig; /** * Sprinkle natural speech fillers like "um", "you know" for a more human, * conversational tone. */ natural_filler_words?: boolean | HandbookConfig.HandbookEntryConfig; /** * Stay within prompt/context scope, don't invent details. */ scope_boundaries?: boolean | HandbookConfig.HandbookEntryConfig; /** * Treat near-match similar words as same entity to reduce impact of transcription * error (voice only). */ smart_matching?: boolean | HandbookConfig.HandbookEntryConfig; /** * Convert numbers/dates/currency to spoken forms (voice only). */ speech_normalization?: boolean | HandbookConfig.HandbookEntryConfig; } namespace HandbookConfig { /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Conversational handbook. */ interface Conversational { custom_prompt?: string | null; } /** * Customer Support handbook. */ interface CustomerSupport { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } } /** * If this option is set, the call will try to detect IVR in the first 3 minutes of * the call. Actions defined will be applied when the IVR is detected. Set this to * null to disable IVR detection. */ interface IvrOption { action: IvrOption.Action; /** * Optionally describe what should be treated as an IVR. Leave as null to use the * default definition. */ detection_prompt?: string | null; } namespace IvrOption { interface Action { type: 'hangup'; } } /** * Configuration for PII scrubbing from transcripts and recordings. */ interface PiiConfig { /** * List of PII categories to scrub from transcripts and recordings. PII redaction * is only active when this list is non-empty; an empty array means no PII * scrubbing is performed. */ categories: Array<'person_name' | 'address' | 'email' | 'phone_number' | 'ssn' | 'passport' | 'driver_license' | 'credit_card' | 'bank_account' | 'password' | 'pin' | 'medical_id' | 'date_of_birth' | 'customer_account_number'>; /** * The processing mode for PII scrubbing. Currently only post-call is supported. */ mode: 'post_call'; } interface StringAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'string'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Examples of the variable value to teach model the style and syntax. */ examples?: Array; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface EnumAnalysisData { /** * The possible values of the variable, must be non empty array. */ choices: Array; /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'enum'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface BooleanAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'boolean'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface NumberAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'number'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } /** * System preset for post-call analysis (voice agents). Use in * post_call_analysis_data to override prompts or mark fields optional. */ interface CallPresetAnalysisData { /** * Preset identifier for voice agent analysis. */ name: 'call_summary' | 'call_successful' | 'user_sentiment'; /** * Identifies this item as a system preset. */ type: 'system-presets'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Prompt or description for this preset. */ description?: string; /** * If false, this field is optional in the analysis. If true or unset, the field is * required. */ required?: boolean; } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: AppTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: CustomTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: CodeTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } namespace CodeTool { /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } } interface SendSMSTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate; type: 'send_sms'; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: SendSMSTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say before sending the SMS. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * SMS destination number configuration. If omitted, the message is sent to the * customer number on the call. */ sms_destination?: SendSMSTool.DestinationCustomerNumber | SendSMSTool.DestinationPhoneNumber | unknown; /** * SMS sender number configuration. If omitted, the message is sent from the * agent's phone number. */ sms_sender?: SendSMSTool.SenderCurrentNumber | SendSMSTool.SenderRetellLongCode | unknown; /** * Whether the agent should speak after the SMS tool finishes execution. */ speak_after_execution?: boolean; /** * If true, the agent will speak a short line before sending the SMS. If omitted, * defaults to true (same as end_call / transfer_call tools). */ speak_during_execution?: boolean; } namespace SendSMSTool { interface SMSContentPredefined { /** * The static message to be sent in the SMS. Can contain dynamic variables. */ text?: string; type?: 'predefined'; } interface SMSContentInferred { /** * The prompt to be used to help infer the SMS content. The model will take the * global prompt, the call transcript, and this prompt together to deduce the right * message to send. Can contain dynamic variables. */ prompt?: string; type?: 'inferred'; } interface SMSContentTemplate { /** * The template to use for the SMS content. "info_collection" sends a predefined * message requesting information from the user. */ template: 'info_collection'; type: 'template'; } /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } interface DestinationCustomerNumber { type: 'customer_number'; } interface DestinationPhoneNumber { /** * Destination phone number in E.164 format. */ phone_number: string; type: 'phone_number'; /** * If true, skip E.164 validation for this phone number (same semantics as * transfer_call ignore_e164_validation). */ ignore_e164_validation?: boolean; } interface SenderCurrentNumber { type: 'current_number'; } interface SenderRetellLongCode { type: 'retell_long_code'; } } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } interface PronunciationDictionary { /** * The phonetic alphabet to use. MiniMax speech-02-turbo supports IPA and Pinyin. * MiniMax speech-2.8-turbo also supports Jyutping. Support for other alphabets * depends on the selected voice provider and model. */ alphabet: 'ipa' | 'cmu' | 'pinyin' | 'jyutping'; /** * Pronunciation of the word in the format of the selected phonetic alphabet. */ phoneme: string; /** * The string of word / phrase to be annotated with pronunciation. */ word: string; } interface ResponseEngineRetellLm { /** * id of the Retell LLM Response Engine. */ llm_id: string; /** * type of the Response Engine. */ type: 'retell-llm'; /** * Version of the Retell LLM Response Engine. */ version?: number | null; } interface ResponseEngineCustomLm { /** * LLM websocket url of the custom LLM. */ llm_websocket_url: string; /** * type of the Response Engine. */ type: 'custom-llm'; } interface ResponseEngineConversationFlow { /** * ID of the Conversation Flow Response Engine. */ conversation_flow_id: string; /** * type of the Response Engine. */ type: 'conversation-flow'; /** * Version of the Conversation Flow Response Engine. */ version?: number | null; } interface UserDtmfOptions { /** * The maximum number of digits allowed in the user's DTMF (Dual-Tone * Multi-Frequency) input per turn. Once this limit is reached, the input is * considered complete and a response will be generated immediately. */ digit_limit?: number | null; /** * A single key that signals the end of DTMF input. Acceptable values include any * digit (0-9), the pound/hash symbol (#), or the asterisk (\*). */ termination_key?: string | null; /** * The time (in milliseconds) to wait for user DTMF input before timing out. The * timer resets with each digit received. */ timeout_ms?: number; } /** * If this option is set, the call will try to detect voicemail in the first 3 * minutes of the call. Actions defined (hangup, or leave a message) will be * applied when the voicemail is detected. Set this to null to disable voicemail * detection. */ interface VoicemailOption { action: VoicemailOption.VoicemailActionPrompt | VoicemailOption.VoicemailActionStaticText | VoicemailOption.VoicemailActionHangup | VoicemailOption.VoicemailActionBridgeTransfer; /** * Optionally describe what should be treated as voicemail. Leave as null to use * the default definition. */ detection_prompt?: string | null; } namespace VoicemailOption { interface VoicemailActionPrompt { /** * The prompt used to generate the text to be spoken when the call is detected to * be in voicemail. */ text: string; type: 'prompt'; } interface VoicemailActionStaticText { /** * The text to be spoken when the call is detected to be in voicemail. */ text: string; type: 'static_text'; } interface VoicemailActionHangup { type: 'hangup'; } interface VoicemailActionBridgeTransfer { type: 'bridge_transfer'; } } } /** * Override conversation flow configuration settings. Only applicable when using * conversation flow as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms. A * model_config override can set backup to null to remove it for this call. */ interface ConversationFlow { /** * Replace backup model configuration for this call only. Omit to inherit the saved * configuration, or set null to disable backup. An omitted backup_kick_in_timeout * in a supplied configuration defaults to 1500 milliseconds. */ backup_model?: ConversationFlow.BackupModelChoice | unknown; /** * If set, the AI will begin the conversation after waiting for the user for the * duration (in milliseconds) specified by this attribute. This only applies if the * agent is configured to wait for the user to speak first. If not set, the agent * will wait indefinitely for the user to speak. */ begin_after_user_silence_ms?: number | null; /** * Knowledge base configuration for RAG retrieval. */ kb_config?: ConversationFlow.KBConfig; /** * Knowledge base IDs for RAG (Retrieval-Augmented Generation). */ knowledge_base_ids?: Array | null; /** * @deprecated Deprecated, use model_config. Ignored when model_config is set. */ model_choice?: ConversationFlow.ModelChoiceCascading | ConversationFlow.ModelChoiceS2S; /** * Model settings for the response engine. type decides which models primary and * backup accept. On update, each top-level key replaces the current one and * omitted keys are kept; set backup to null to remove it. Changing type requires * primary and clears backup, while temperature carries over. In agent_override, * type is required whenever primary is set; setting backup to null disables it for * that call only. */ model_config?: ConversationFlow.CascadingModelConfig | ConversationFlow.S2SModelConfig | ConversationFlow.DuplexModelConfig; /** * @deprecated Deprecated, use model_config.temperature. Ignored when model_config * is set. */ model_temperature?: number | null; /** * Who starts the conversation - user or agent. */ start_speaker?: 'user' | 'agent'; } namespace ConversationFlow { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelChoice { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Duration in milliseconds to prefer primary model output while both models run * concurrently. Must be between 300 and 60000 milliseconds, inclusive. Defaults to * 1500 when omitted. */ backup_kick_in_timeout?: number; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } /** * Knowledge base configuration for RAG retrieval. */ interface KBConfig { /** * Similarity threshold for filtering search results */ filter_score?: number; /** * Max number of knowledge base chunks to retrieve */ top_k?: number; } interface ModelChoiceCascading { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } interface ModelChoiceS2S { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; /** * Type of model choice */ type: 's2s'; } interface CascadingModelConfig { /** * A text LLM that runs alongside the primary and takes over when the primary is * slow. */ backup?: CascadingModelConfig.BackupModelRef | unknown; primary?: CascadingModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a text LLM with a separate voice. This is the default type. */ type?: 'cascading'; } namespace CascadingModelConfig { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } } interface S2SModelConfig { primary?: S2SModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a speech-to-speech model. */ type?: 's2s'; } namespace S2SModelConfig { interface Primary { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; } } /** * Retell LLMs only. A full-duplex voice model talks to the user and delegates to a * cascading backend model, which runs the LLM's prompt, tools and knowledge base. * Requires backend, and the Retell LLM's voice_prompt. Tools' * speak_during_execution is ignored, since the voice model covers the wait itself, * and speak_after_execution is always on. */ interface DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ backend?: DuplexModelConfig.Backend; /** * A backup for the backend model. */ backup?: DuplexModelConfig.BackupModelRef | unknown; primary?: DuplexModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a full-duplex voice model with a cascading backend. */ type?: 'duplex'; } namespace DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ interface Backend { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { model: 'gpt-live-1'; } } } /** * Override Retell LLM configuration settings. Only applicable when using Retell * LLM as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms, * begin_message. A model_config override can set backup to null to remove it for * this call, but cannot switch a speech-to-speech LLM to a cascading model. */ interface RetellLlm { /** * Replace backup model configuration for this call only. Omit to inherit the saved * configuration, or set null to disable backup. An omitted backup_kick_in_timeout * in a supplied configuration defaults to 1500 milliseconds. */ backup_model?: RetellLlm.BackupModelChoice | unknown; /** * If set, the AI will begin the conversation after waiting for the user for the * duration (in milliseconds) specified by this attribute. This only applies if the * agent is configured to wait for the user to speak first. If not set, the agent * will wait indefinitely for the user to speak. */ begin_after_user_silence_ms?: number | null; /** * First utterance said by the agent in the call. If not set, LLM will dynamically * generate a message. If set to "", agent will wait for user to speak first. */ begin_message?: string | null; /** * Knowledge base configuration for RAG retrieval. */ kb_config?: RetellLlm.KBConfig | null; /** * A list of knowledge base ids to use for this resource. */ knowledge_base_ids?: Array | null; /** * @deprecated Available LLM models for agents. */ model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon' | null; /** * Model settings for the response engine. type decides which models primary and * backup accept. On update, each top-level key replaces the current one and * omitted keys are kept; set backup to null to remove it. Changing type requires * primary and clears backup, while temperature carries over. In agent_override, * type is required whenever primary is set; setting backup to null disables it for * that call only. */ model_config?: RetellLlm.CascadingModelConfig | RetellLlm.S2SModelConfig | RetellLlm.DuplexModelConfig; /** * @deprecated Deprecated, use model_config.primary.tier fast. Ignored when * model_config is set. */ model_high_priority?: boolean | null; /** * @deprecated Deprecated, use model_config.temperature. Ignored when model_config * is set. */ model_temperature?: number; /** * @deprecated Deprecated, use model_config.primary.tier ultrafast. Ignored when * model_config is set. */ model_ultrafast?: boolean | null; /** * @deprecated The speech-to-speech model to use */ s2s_model?: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0' | null; /** * The speaker who starts the conversation. Required. Must be either 'user' or * 'agent'. */ start_speaker?: 'user' | 'agent'; } namespace RetellLlm { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelChoice { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Duration in milliseconds to prefer primary model output while both models run * concurrently. Must be between 300 and 60000 milliseconds, inclusive. Defaults to * 1500 when omitted. */ backup_kick_in_timeout?: number; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } /** * Knowledge base configuration for RAG retrieval. */ interface KBConfig { /** * Similarity threshold for filtering search results */ filter_score?: number; /** * Max number of knowledge base chunks to retrieve */ top_k?: number; } interface CascadingModelConfig { /** * A text LLM that runs alongside the primary and takes over when the primary is * slow. */ backup?: CascadingModelConfig.BackupModelRef | unknown; primary?: CascadingModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a text LLM with a separate voice. This is the default type. */ type?: 'cascading'; } namespace CascadingModelConfig { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } } interface S2SModelConfig { primary?: S2SModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a speech-to-speech model. */ type?: 's2s'; } namespace S2SModelConfig { interface Primary { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; } } /** * Retell LLMs only. A full-duplex voice model talks to the user and delegates to a * cascading backend model, which runs the LLM's prompt, tools and knowledge base. * Requires backend, and the Retell LLM's voice_prompt. Tools' * speak_during_execution is ignored, since the voice model covers the wait itself, * and speak_after_execution is always on. */ interface DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ backend?: DuplexModelConfig.Backend; /** * A backup for the backend model. */ backup?: DuplexModelConfig.BackupModelRef | unknown; primary?: DuplexModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a full-duplex voice model with a cascading backend. */ type?: 'duplex'; } namespace DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ interface Backend { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { model: 'gpt-live-1'; } } } } } export interface CallCreateWebCallParams { /** * Unique id of agent used for the call. Your agent would contain the LLM Websocket * url used for this call. A payment agent starts an isolated PCI test call that * ends when payment completes. */ agent_id: string; /** * For this particular call, override agent configuration with these settings. This * allows you to customize agent behavior for individual calls without modifying * the base agent. */ agent_override?: CallCreateWebCallParams.AgentOverride; /** * The version of the agent to use for the call. */ agent_version?: string | number; /** * Start the call at this conversation flow node (stage). Must be a valid node id * in the agent's conversation flow. Only applicable when the agent uses * conversation flow as the response engine. For a payment agent, the node belongs * to its own conversation flow. Ignored for retell-llm agents. */ current_node_id?: string | null; /** * Start the conversation in this state (stage). Must be a valid state name in the * agent's Retell LLM. Only applicable when the agent uses Retell LLM with states. * Ignored for conversation-flow agents. */ current_state?: string | null; /** * An arbitrary object for storage purpose only. You can put anything here like * your internal customer id associated with the call. Not used for processing. You * can later get this field from the call object. */ metadata?: unknown; /** * Add optional dynamic variables in key value pairs of string that injects into * your Response Engine prompt and tool description. Only applicable for Response * Engine. */ retell_llm_dynamic_variables?: { [key: string]: string; }; } export declare namespace CallCreateWebCallParams { /** * For this particular call, override agent configuration with these settings. This * allows you to customize agent behavior for individual calls without modifying * the base agent. */ interface AgentOverride { /** * Override agent configuration settings. Any properties specified here will * override the base agent configuration for this call. If a Retell LLM or * Conversation Flow response engine is specified without a version, it uses the * latest version. */ agent?: AgentOverride.Agent; /** * Override conversation flow configuration settings. Only applicable when using * conversation flow as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms. A * model_config override can set backup to null to remove it for this call. */ conversation_flow?: AgentOverride.ConversationFlow; /** * Override Retell LLM configuration settings. Only applicable when using Retell * LLM as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms, * begin_message. A model_config override can set backup to null to remove it for * this call, but cannot switch a speech-to-speech LLM to a cascading model. */ retell_llm?: AgentOverride.RetellLlm; } namespace AgentOverride { /** * Override agent configuration settings. Any properties specified here will * override the base agent configuration for this call. If a Retell LLM or * Conversation Flow response engine is specified without a version, it uses the * latest version. */ interface Agent { /** * The name of the agent. Only used for your own reference. */ agent_name?: string | null; /** * If set to true, DTMF input will interrupt the agent even when * interruption_sensitivity is 0. Can be overridden per conversation or subagent * node. Default to false. */ allow_dtmf_interruption?: boolean; /** * If set to true, DTMF input will be accepted and processed. If false, any DTMF * input will be ignored. Default to true. */ allow_user_dtmf?: boolean; /** * If set, will add ambient environment sound to the call to make experience more * realistic. Currently supports the following options: * * - `coffee-shop`: Coffee shop ambience with people chatting in background. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/coffee-shop.wav) * - `convention-hall`: Convention hall ambience, with some echo and people * chatting in background. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/convention-hall.wav) * - `summer-outdoor`: Summer outdoor ambience with cicada chirping. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/summer-outdoor.wav) * - `mountain-outdoor`: Mountain outdoor ambience with birds singing. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/mountain-outdoor.wav) * - `static-noise`: Constant static noise. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/static-noise.wav) * - `call-center`: Call center work noise. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/call-center.wav) * Set to `null` to remove ambient sound from this agent. */ ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'static-noise' | 'call-center' | null; /** * If set, will control the volume of the ambient sound. Value ranging from [0,2]. * Lower value means quieter ambient sound, while higher value means louder ambient * sound. If unset, default value 1 will apply. */ ambient_sound_volume?: number; /** * Only applicable when enable_backchannel is true. Controls how often the agent * would backchannel when a backchannel is possible. Value ranging from [0,1]. * Lower value means less frequent backchannel, while higher value means more * frequent backchannel. If unset, default value 0.8 will apply. */ backchannel_frequency?: number; /** * Only applicable when enable_backchannel is true. A list of words that the agent * would use as backchannel. If not set, default backchannel words will apply. * Check out * [backchannel default words](/agent/interaction-configuration#backchannel) for * more details. Note that certain voices do not work too well with certain words, * so it's recommended to experiment before adding any words. */ backchannel_words?: Array | null; /** * If set, will delay the first message by the specified amount of milliseconds, so * that it gives user more time to prepare to take the call. Valid range is [0, * 5000]. If not set or set to 0, agent will speak immediately. Only applicable * when agent speaks first. */ begin_message_delay_ms?: number; /** * Provide a customized list of keywords to bias the transcriber model, so that * these words are more likely to get transcribed. Commonly used for names, brands, * street, etc. Entries may reference dynamic variables with `{{variable}}` syntax. */ boosted_keywords?: Array | null; /** * If this option is set, the agent prompt will include call screen handling * instructions for identity and call purpose questions. Set this to null to * disable call screen prompt instructions. */ call_screening_option?: Agent.CallScreeningOption | null; /** * Contact memory settings for phone calls and SMS chats. Creating an agent * defaults enable_update to false and enable_read to true. Updates only change the * supplied flags; omitted flags stay unchanged and an empty object has no effect. * Set a flag to false to disable it. The configuration cannot be cleared. Existing * agents without this configuration have both disabled. */ contact_memory_config?: Agent.ContactMemoryConfig; /** * Custom STT configuration. Only used when stt_mode is set to custom. */ custom_stt_config?: Agent.CustomSttConfig | null; /** * Number of days to retain call/chat data before automatic deletion. Must be * between 1 and 730 days. If not set, data is retained forever (no automatic * deletion). */ data_storage_retention_days?: number | null; /** * Granular setting to manage how Retell stores sensitive data (transcripts, * recordings, logs, etc.). This replaces the deprecated * `opt_out_sensitive_data_storage` field. * * - `everything`: Store all data including transcripts, recordings, and logs. * - `everything_except_pii`: Store data without PII when PII is detected. * - `basic_attributes_only`: Store only basic attributes; no * transcripts/recordings/logs. If not set, default value of "everything" will * apply. */ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only'; /** * Controls the enhancement level for background voice cancellation. Set to 0 to * bypass background voice cancellation without BVC charges. Value ranging from * [0,1]. Only applicable when denoising_mode is * noise-and-background-speech-cancellation. Defaults to 0.8 if no value is * configured. Set to null to clear the configured value. Omitting this field * preserves the existing value. */ denoising_enhancement_level?: number | null; /** * If set, determines what denoising mode to use. Use "no-denoise" to bypass all * audio denoising. Default to noise-cancellation. */ denoising_mode?: 'no-denoise' | 'noise-cancellation' | 'noise-and-background-speech-cancellation'; /** * Controls whether the agent would backchannel (agent interjects the speaker with * phrases like "yeah", "uh-huh" to signify interest and engagement). Backchannel * when enabled tends to show up more in longer user utterances. If not set, agent * will not backchannel. */ enable_backchannel?: boolean; /** * Whether to rewrite generated responses with the separately billed colloquial * model. This setting is independent of handbook selection and is not supported * for speech-to-speech response engines. Defaults to false. */ enable_colloquial_model?: boolean; /** * If set to true, the agent recognizes requests to stop calling or contacting the * user, confirms once, and on a clear yes ends the call with disconnection reason * user_requested_dnc and sets do_not_call to true on the contact for the user's * phone number. If unset, default value false will apply. */ enable_dnc_detection?: boolean; /** * If set to true, the agent will dynamically adjust how quickly it responds based * on the user's speech rate and past turn-taking behavior in the call. If unset, * default value false will apply. */ enable_dynamic_responsiveness?: boolean; /** * If set to true, will enable dynamic voice speed adjustment based on the user's * speech rate and conversation context. If unset, default value false will apply. */ enable_dynamic_voice_speed?: boolean; /** * Master toggle for expressive mode. When true, the agent may add expressive voice * tags to the audio it generates. Only applicable for platform voices. If unset, * defaults to false. */ enable_expressive_mode?: boolean; /** * If users stay silent for a period after agent speech, end the call. The minimum * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). */ end_call_after_silence_ms?: number; /** * The expressive voice tags Retell pre-teaches the model to use when * enable_expressive_mode is true. Custom tags defined in the system prompt are * still allowed. If empty, the agent follows general expressive guidance without a * fixed tag set. */ expressive_emotion_tags?: Array<'empathetic' | 'excited' | 'happy' | 'curious' | 'surprised' | 'sigh' | 'clear throat' | 'pause' | 'long pause' | 'emphasis'>; /** * Custom expressive voice guidance to use instead of the default Retell expressive * prompt when enable_expressive_mode is true. If omitted or blank, the default * expressive prompt will be used. */ expressive_mode_prompt?: string | null; /** * When TTS provider for the selected voice is experiencing outages, we would use * fallback voices listed here for the agent. Voice id and the fallback voice ids * must be from different TTS providers. The system would go through the list in * order, if the first one in the list is also having outage, it would use the next * one. Set to null to remove voice fallback for the agent. */ fallback_voice_ids?: Array | null; /** * Configuration for guardrail checks to detect and prevent prohibited topics in * agent output and user input. */ guardrail_config?: Agent.GuardrailConfig; /** * Enable and customize handbook prompts. Sending this field replaces the complete * handbook configuration. */ handbook_config?: Agent.HandbookConfig; /** * Controls how sensitive the agent is to user interruptions. Value ranging from * [0,1]. Lower value means it will take longer / more words for user to interrupt * agent, while higher value means it's easier for user to interrupt agent. If * unset, default value 1 will apply. When this is set to 0, agent would never be * interrupted. */ interruption_sensitivity?: number; /** * If this option is set, the call will try to detect IVR in the first 3 minutes of * the call. Actions defined will be applied when the IVR is detected. Set this to * null to disable IVR detection. */ ivr_option?: Agent.IvrOption | null; /** * Specifies what language(s) the agent will operate in. Accepts either a single * locale (e.g. `en-US`) or an array of locales for multilingual agents (e.g. * `["en-US","es-ES"]`). If unset, defaults to `en-US`. */ language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | Array<'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA'>; /** * Maximum allowed length for the call, will force end the call if reached. The * minimum value allowed is 60,000 ms (1 min), and maximum value allowed is * 7,200,000 (2 hours). By default, this is set to 3,600,000 (1 hour). */ max_call_duration_ms?: number; /** * Whether this agent opts in for signed URLs for public logs and recordings. When * enabled, the generated URLs will include security signatures that restrict * access and automatically expire after 24 hours. */ opt_in_signed_url?: boolean; /** * Configuration for PII scrubbing from transcripts and recordings. */ pii_config?: Agent.PiiConfig; /** * Post call analysis data to extract from the call. This data will augment the * pre-defined variables extracted in the call analysis. This will be available * after the call ends. */ post_call_analysis_data?: Array | null; /** * The model to use for post call analysis. Default to gpt-5.6-terra. */ post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon' | null; /** * Integration (Agent Functions) tools run as a dependency graph during teardown, * after post-call analysis. Each tool can be gated by a condition. On calls the * graph is stopped after five minutes so teardown can finish. Set to null to * clear. */ post_session_tools?: Array | null; /** * Integration (Agent Functions) tools run as a dependency graph during session * setup, before the agent's first message. Outputs are injected as dynamic * variables. On calls the graph gets one minute unless an outbound caller will be * dialed after setup, in which case it gets five minutes. Past that session * initialization continues and any remaining tools finish in the background, so * their outputs no longer reach the agent's prompt. Set to null to clear. */ pre_session_tools?: Array | null; /** * A list of words / phrases and their pronunciation to be used to guide the audio * synthesize for consistent pronunciation. Check the dashboard to see what * provider supports this feature. Set to null to remove pronunciation dictionary * from this agent. */ pronunciation_dictionary?: Array | null; /** * If set, controls how many times agent would remind user when user is * unresponsive. Must be a non negative integer. If unset, default value of 1 will * apply (remind once). Set to 0 to disable agent from reminding. */ reminder_max_count?: number; /** * If set (in milliseconds), will trigger a reminder to the agent to speak if the * user has been silent for the specified duration after some agent speech. Must be * a positive number. If unset, default value of 10000 ms (10 s) will apply. */ reminder_trigger_ms?: number; /** * The Response Engine to attach to the agent. It is used to generate responses for * the agent. You need to create a Response Engine first before attaching it to an * agent. */ response_engine?: Agent.ResponseEngineRetellLm | Agent.ResponseEngineCustomLm | Agent.ResponseEngineConversationFlow; /** * Controls how responsive is the agent. Value ranging from [0,1]. Lower value * means less responsive agent (wait more, respond slower), while higher value * means faster exchanges (respond when it can). If unset, default value 1 will * apply. */ responsiveness?: number; /** * If set, the phone ringing will last for the specified amount of milliseconds. * This applies for both outbound call ringtime, and call transfer ringtime. * Default to 30000 (30 s). Valid range is [5000, 300000]. */ ring_duration_ms?: number; /** * The expiration time for the signed url in milliseconds. Only applicable when * opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will * apply. */ signed_url_expiration_ms?: number | null; /** * If set, determines whether speech to text should focus on latency or accuracy. * Default to fast mode. When set to custom, custom_stt_config must be provided. */ stt_mode?: 'fast' | 'accurate' | 'custom'; /** * IANA timezone for the agent (e.g. America/New_York). Defaults to * America/Los_Angeles if not set. */ timezone?: string | null; user_dtmf_options?: Agent.UserDtmfOptions | null; /** * Optional description of the agent version. Used for your own reference and * documentation. */ version_description?: string | null; /** * Optional title of the agent version. Used for your own reference. */ version_title?: string | null; /** * If set, determines the vocabulary set to use for transcription. This setting * only applies for English agents, for non English agent, this setting is a no-op. * Default to general. */ vocab_specialization?: 'general' | 'medical'; /** * Unique voice id used for the agent. Find list of available voices and their * preview in Dashboard. */ voice_id?: string; /** * Select the voice model used for the selected voice. Each provider has a set of * available voice models. Set to null to remove voice model selection, and default * ones will apply. Check out dashboard for more details of each voice model. */ voice_model?: 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'eleven_v3_conversational' | 'eleven_v4' | 'eleven_v4_turbo' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'sonic-3.6' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | 'drama-3' | 'inworld-tts-2' | 'inworld-tts-2-flash' | null; /** * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower * speech, while higher value means faster speech rate. If unset, default value 1 * will apply. */ voice_speed?: number; /** * Controls how stable the voice is. Value ranging from [0,2]. Lower value means * more stable, and higher value means more variant speech generation. Check the * dashboard to see what provider supports this feature. If unset, default value 1 * will apply. */ voice_temperature?: number; /** * If this option is set, the call will try to detect voicemail in the first 3 * minutes of the call. Actions defined (hangup, or leave a message) will be * applied when the voicemail is detected. Set this to null to disable voicemail * detection. */ voicemail_option?: Agent.VoicemailOption | null; /** * If set, will control the volume of the agent. Value ranging from [0,2]. Lower * value means quieter agent speech, while higher value means louder agent speech. * If unset, default value 1 will apply. */ volume?: number; /** * Which webhook events this agent should receive. If not set, defaults to * call_started, call_ended, call_analyzed. */ webhook_events?: Array<'call_started' | 'call_ended' | 'call_analyzed' | 'transcript_updated' | 'transfer_started' | 'transfer_bridged' | 'transfer_cancelled' | 'transfer_ended'> | null; /** * The timeout for the webhook in milliseconds. If not set, default value of 10000 * will apply. */ webhook_timeout_ms?: number; /** * The webhook for agent to listen to call events. See what events it would get at * [webhook doc](/features/webhook). If set, will binds webhook events for this * agent to the specified url, and will ignore the account level webhook for this * agent. Set to `null` to remove webhook url from this agent. */ webhook_url?: string | null; } namespace Agent { /** * If this option is set, the agent prompt will include call screen handling * instructions for identity and call purpose questions. Set this to null to * disable call screen prompt instructions. */ interface CallScreeningOption { /** * Identity the agent should provide when a call screen asks who is calling. * Dynamic variables are supported. */ agent_identity: string; /** * Purpose the agent should provide when a call screen asks why it is calling. * Dynamic variables are supported. */ call_purpose: string; } /** * Contact memory settings for phone calls and SMS chats. Creating an agent * defaults enable_update to false and enable_read to true. Updates only change the * supplied flags; omitted flags stay unchanged and an empty object has no effect. * Set a flag to false to disable it. The configuration cannot be cleared. Existing * agents without this configuration have both disabled. */ interface ContactMemoryConfig { /** * Automatically add saved contact memory to the agent prompt. Skippable nodes can * use answers from the current conversation even when this setting is disabled. * Contact dynamic variables, including contact_memory, remain available regardless * of this setting. */ enable_read?: boolean; /** * Rewrite the contact memory after each conversation. Cannot be enabled for * payment agents. Requires storing conversation data. Chat agents must also have * end_chat_after_silence_ms set. */ enable_update?: boolean; } /** * Custom STT configuration. Only used when stt_mode is set to custom. */ interface CustomSttConfig { /** * Endpointing timeout in milliseconds. Minimum is 100 for Azure, 10 for Deepgram, * 500 for Soniox, 100 for AssemblyAI, 100 for Muse. For AssemblyAI, this sets * min_turn_silence (100-3000 ms). max_turn_silence adds half of this value, * rounded to the nearest millisecond and bounded to 500-1000 ms, with a total cap * of 3000 ms. Muse detects turn ends itself and ignores this value. */ endpointing_ms: number; /** * ASR provider name. */ provider: 'azure' | 'deepgram' | 'soniox' | 'assemblyai' | 'muse'; } /** * Configuration for guardrail checks to detect and prevent prohibited topics in * agent output and user input. */ interface GuardrailConfig { /** * Selected prohibited user topic categories to check. When user messages contain * these topics, the agent will respond with a placeholder message instead of * processing the request. */ input_topics?: Array<'platform_integrity_jailbreaking'> | null; /** * Selected prohibited agent topic categories to check. When agent messages contain * these topics, they will be replaced with a placeholder message. */ output_topics?: Array<'harassment' | 'self_harm' | 'sexual_exploitation' | 'violence' | 'defense_and_national_security' | 'illicit_and_harmful_activity' | 'gambling' | 'regulated_professional_advice' | 'child_safety_and_exploitation'> | null; } /** * Enable and customize handbook prompts. Sending this field replaces the complete * handbook configuration. */ interface HandbookConfig { /** * When asked, acknowledge being a virtual assistant. */ ai_disclosure?: boolean | HandbookConfig.HandbookEntryConfig; /** * Conversational handbook. */ conversational?: HandbookConfig.Conversational; /** * Legacy name for conversational. Cannot be sent together with conversational. For * compatibility, true also enables enable_colloquial_model when that field is * omitted. */ conversational_personality?: boolean; /** * Customer Support handbook. */ customer_support?: HandbookConfig.CustomerSupport; /** * Legacy name for customer_support. Cannot be sent together with customer_support. */ default_personality?: boolean; /** * Repeat back and confirm important details (voice only). */ echo_verification?: boolean | HandbookConfig.HandbookEntryConfig; /** * Warm acknowledgment of caller concerns. */ high_empathy?: boolean | HandbookConfig.HandbookEntryConfig; /** * Spell using NATO phonetic alphabet style (voice only). */ nato_phonetic_alphabet?: boolean | HandbookConfig.HandbookEntryConfig; /** * Sprinkle natural speech fillers like "um", "you know" for a more human, * conversational tone. */ natural_filler_words?: boolean | HandbookConfig.HandbookEntryConfig; /** * Stay within prompt/context scope, don't invent details. */ scope_boundaries?: boolean | HandbookConfig.HandbookEntryConfig; /** * Treat near-match similar words as same entity to reduce impact of transcription * error (voice only). */ smart_matching?: boolean | HandbookConfig.HandbookEntryConfig; /** * Convert numbers/dates/currency to spoken forms (voice only). */ speech_normalization?: boolean | HandbookConfig.HandbookEntryConfig; } namespace HandbookConfig { /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Conversational handbook. */ interface Conversational { custom_prompt?: string | null; } /** * Customer Support handbook. */ interface CustomerSupport { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } } /** * If this option is set, the call will try to detect IVR in the first 3 minutes of * the call. Actions defined will be applied when the IVR is detected. Set this to * null to disable IVR detection. */ interface IvrOption { action: IvrOption.Action; /** * Optionally describe what should be treated as an IVR. Leave as null to use the * default definition. */ detection_prompt?: string | null; } namespace IvrOption { interface Action { type: 'hangup'; } } /** * Configuration for PII scrubbing from transcripts and recordings. */ interface PiiConfig { /** * List of PII categories to scrub from transcripts and recordings. PII redaction * is only active when this list is non-empty; an empty array means no PII * scrubbing is performed. */ categories: Array<'person_name' | 'address' | 'email' | 'phone_number' | 'ssn' | 'passport' | 'driver_license' | 'credit_card' | 'bank_account' | 'password' | 'pin' | 'medical_id' | 'date_of_birth' | 'customer_account_number'>; /** * The processing mode for PII scrubbing. Currently only post-call is supported. */ mode: 'post_call'; } interface StringAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'string'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Examples of the variable value to teach model the style and syntax. */ examples?: Array; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface EnumAnalysisData { /** * The possible values of the variable, must be non empty array. */ choices: Array; /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'enum'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface BooleanAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'boolean'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface NumberAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'number'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } /** * System preset for post-call analysis (voice agents). Use in * post_call_analysis_data to override prompts or mark fields optional. */ interface CallPresetAnalysisData { /** * Preset identifier for voice agent analysis. */ name: 'call_summary' | 'call_successful' | 'user_sentiment'; /** * Identifies this item as a system preset. */ type: 'system-presets'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Prompt or description for this preset. */ description?: string; /** * If false, this field is optional in the analysis. If true or unset, the field is * required. */ required?: boolean; } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: AppTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: CustomTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: CodeTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } namespace CodeTool { /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } } interface SendSMSTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate; type: 'send_sms'; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: SendSMSTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say before sending the SMS. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * SMS destination number configuration. If omitted, the message is sent to the * customer number on the call. */ sms_destination?: SendSMSTool.DestinationCustomerNumber | SendSMSTool.DestinationPhoneNumber | unknown; /** * SMS sender number configuration. If omitted, the message is sent from the * agent's phone number. */ sms_sender?: SendSMSTool.SenderCurrentNumber | SendSMSTool.SenderRetellLongCode | unknown; /** * Whether the agent should speak after the SMS tool finishes execution. */ speak_after_execution?: boolean; /** * If true, the agent will speak a short line before sending the SMS. If omitted, * defaults to true (same as end_call / transfer_call tools). */ speak_during_execution?: boolean; } namespace SendSMSTool { interface SMSContentPredefined { /** * The static message to be sent in the SMS. Can contain dynamic variables. */ text?: string; type?: 'predefined'; } interface SMSContentInferred { /** * The prompt to be used to help infer the SMS content. The model will take the * global prompt, the call transcript, and this prompt together to deduce the right * message to send. Can contain dynamic variables. */ prompt?: string; type?: 'inferred'; } interface SMSContentTemplate { /** * The template to use for the SMS content. "info_collection" sends a predefined * message requesting information from the user. */ template: 'info_collection'; type: 'template'; } /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } interface DestinationCustomerNumber { type: 'customer_number'; } interface DestinationPhoneNumber { /** * Destination phone number in E.164 format. */ phone_number: string; type: 'phone_number'; /** * If true, skip E.164 validation for this phone number (same semantics as * transfer_call ignore_e164_validation). */ ignore_e164_validation?: boolean; } interface SenderCurrentNumber { type: 'current_number'; } interface SenderRetellLongCode { type: 'retell_long_code'; } } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } interface PronunciationDictionary { /** * The phonetic alphabet to use. MiniMax speech-02-turbo supports IPA and Pinyin. * MiniMax speech-2.8-turbo also supports Jyutping. Support for other alphabets * depends on the selected voice provider and model. */ alphabet: 'ipa' | 'cmu' | 'pinyin' | 'jyutping'; /** * Pronunciation of the word in the format of the selected phonetic alphabet. */ phoneme: string; /** * The string of word / phrase to be annotated with pronunciation. */ word: string; } interface ResponseEngineRetellLm { /** * id of the Retell LLM Response Engine. */ llm_id: string; /** * type of the Response Engine. */ type: 'retell-llm'; /** * Version of the Retell LLM Response Engine. */ version?: number | null; } interface ResponseEngineCustomLm { /** * LLM websocket url of the custom LLM. */ llm_websocket_url: string; /** * type of the Response Engine. */ type: 'custom-llm'; } interface ResponseEngineConversationFlow { /** * ID of the Conversation Flow Response Engine. */ conversation_flow_id: string; /** * type of the Response Engine. */ type: 'conversation-flow'; /** * Version of the Conversation Flow Response Engine. */ version?: number | null; } interface UserDtmfOptions { /** * The maximum number of digits allowed in the user's DTMF (Dual-Tone * Multi-Frequency) input per turn. Once this limit is reached, the input is * considered complete and a response will be generated immediately. */ digit_limit?: number | null; /** * A single key that signals the end of DTMF input. Acceptable values include any * digit (0-9), the pound/hash symbol (#), or the asterisk (\*). */ termination_key?: string | null; /** * The time (in milliseconds) to wait for user DTMF input before timing out. The * timer resets with each digit received. */ timeout_ms?: number; } /** * If this option is set, the call will try to detect voicemail in the first 3 * minutes of the call. Actions defined (hangup, or leave a message) will be * applied when the voicemail is detected. Set this to null to disable voicemail * detection. */ interface VoicemailOption { action: VoicemailOption.VoicemailActionPrompt | VoicemailOption.VoicemailActionStaticText | VoicemailOption.VoicemailActionHangup | VoicemailOption.VoicemailActionBridgeTransfer; /** * Optionally describe what should be treated as voicemail. Leave as null to use * the default definition. */ detection_prompt?: string | null; } namespace VoicemailOption { interface VoicemailActionPrompt { /** * The prompt used to generate the text to be spoken when the call is detected to * be in voicemail. */ text: string; type: 'prompt'; } interface VoicemailActionStaticText { /** * The text to be spoken when the call is detected to be in voicemail. */ text: string; type: 'static_text'; } interface VoicemailActionHangup { type: 'hangup'; } interface VoicemailActionBridgeTransfer { type: 'bridge_transfer'; } } } /** * Override conversation flow configuration settings. Only applicable when using * conversation flow as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms. A * model_config override can set backup to null to remove it for this call. */ interface ConversationFlow { /** * Replace backup model configuration for this call only. Omit to inherit the saved * configuration, or set null to disable backup. An omitted backup_kick_in_timeout * in a supplied configuration defaults to 1500 milliseconds. */ backup_model?: ConversationFlow.BackupModelChoice | unknown; /** * If set, the AI will begin the conversation after waiting for the user for the * duration (in milliseconds) specified by this attribute. This only applies if the * agent is configured to wait for the user to speak first. If not set, the agent * will wait indefinitely for the user to speak. */ begin_after_user_silence_ms?: number | null; /** * Knowledge base configuration for RAG retrieval. */ kb_config?: ConversationFlow.KBConfig; /** * Knowledge base IDs for RAG (Retrieval-Augmented Generation). */ knowledge_base_ids?: Array | null; /** * @deprecated Deprecated, use model_config. Ignored when model_config is set. */ model_choice?: ConversationFlow.ModelChoiceCascading | ConversationFlow.ModelChoiceS2S; /** * Model settings for the response engine. type decides which models primary and * backup accept. On update, each top-level key replaces the current one and * omitted keys are kept; set backup to null to remove it. Changing type requires * primary and clears backup, while temperature carries over. In agent_override, * type is required whenever primary is set; setting backup to null disables it for * that call only. */ model_config?: ConversationFlow.CascadingModelConfig | ConversationFlow.S2SModelConfig | ConversationFlow.DuplexModelConfig; /** * @deprecated Deprecated, use model_config.temperature. Ignored when model_config * is set. */ model_temperature?: number | null; /** * Who starts the conversation - user or agent. */ start_speaker?: 'user' | 'agent'; } namespace ConversationFlow { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelChoice { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Duration in milliseconds to prefer primary model output while both models run * concurrently. Must be between 300 and 60000 milliseconds, inclusive. Defaults to * 1500 when omitted. */ backup_kick_in_timeout?: number; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } /** * Knowledge base configuration for RAG retrieval. */ interface KBConfig { /** * Similarity threshold for filtering search results */ filter_score?: number; /** * Max number of knowledge base chunks to retrieve */ top_k?: number; } interface ModelChoiceCascading { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } interface ModelChoiceS2S { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; /** * Type of model choice */ type: 's2s'; } interface CascadingModelConfig { /** * A text LLM that runs alongside the primary and takes over when the primary is * slow. */ backup?: CascadingModelConfig.BackupModelRef | unknown; primary?: CascadingModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a text LLM with a separate voice. This is the default type. */ type?: 'cascading'; } namespace CascadingModelConfig { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } } interface S2SModelConfig { primary?: S2SModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a speech-to-speech model. */ type?: 's2s'; } namespace S2SModelConfig { interface Primary { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; } } /** * Retell LLMs only. A full-duplex voice model talks to the user and delegates to a * cascading backend model, which runs the LLM's prompt, tools and knowledge base. * Requires backend, and the Retell LLM's voice_prompt. Tools' * speak_during_execution is ignored, since the voice model covers the wait itself, * and speak_after_execution is always on. */ interface DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ backend?: DuplexModelConfig.Backend; /** * A backup for the backend model. */ backup?: DuplexModelConfig.BackupModelRef | unknown; primary?: DuplexModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a full-duplex voice model with a cascading backend. */ type?: 'duplex'; } namespace DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ interface Backend { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { model: 'gpt-live-1'; } } } /** * Override Retell LLM configuration settings. Only applicable when using Retell * LLM as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms, * begin_message. A model_config override can set backup to null to remove it for * this call, but cannot switch a speech-to-speech LLM to a cascading model. */ interface RetellLlm { /** * Replace backup model configuration for this call only. Omit to inherit the saved * configuration, or set null to disable backup. An omitted backup_kick_in_timeout * in a supplied configuration defaults to 1500 milliseconds. */ backup_model?: RetellLlm.BackupModelChoice | unknown; /** * If set, the AI will begin the conversation after waiting for the user for the * duration (in milliseconds) specified by this attribute. This only applies if the * agent is configured to wait for the user to speak first. If not set, the agent * will wait indefinitely for the user to speak. */ begin_after_user_silence_ms?: number | null; /** * First utterance said by the agent in the call. If not set, LLM will dynamically * generate a message. If set to "", agent will wait for user to speak first. */ begin_message?: string | null; /** * Knowledge base configuration for RAG retrieval. */ kb_config?: RetellLlm.KBConfig | null; /** * A list of knowledge base ids to use for this resource. */ knowledge_base_ids?: Array | null; /** * @deprecated Available LLM models for agents. */ model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon' | null; /** * Model settings for the response engine. type decides which models primary and * backup accept. On update, each top-level key replaces the current one and * omitted keys are kept; set backup to null to remove it. Changing type requires * primary and clears backup, while temperature carries over. In agent_override, * type is required whenever primary is set; setting backup to null disables it for * that call only. */ model_config?: RetellLlm.CascadingModelConfig | RetellLlm.S2SModelConfig | RetellLlm.DuplexModelConfig; /** * @deprecated Deprecated, use model_config.primary.tier fast. Ignored when * model_config is set. */ model_high_priority?: boolean | null; /** * @deprecated Deprecated, use model_config.temperature. Ignored when model_config * is set. */ model_temperature?: number; /** * @deprecated Deprecated, use model_config.primary.tier ultrafast. Ignored when * model_config is set. */ model_ultrafast?: boolean | null; /** * @deprecated The speech-to-speech model to use */ s2s_model?: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0' | null; /** * The speaker who starts the conversation. Required. Must be either 'user' or * 'agent'. */ start_speaker?: 'user' | 'agent'; } namespace RetellLlm { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelChoice { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Duration in milliseconds to prefer primary model output while both models run * concurrently. Must be between 300 and 60000 milliseconds, inclusive. Defaults to * 1500 when omitted. */ backup_kick_in_timeout?: number; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } /** * Knowledge base configuration for RAG retrieval. */ interface KBConfig { /** * Similarity threshold for filtering search results */ filter_score?: number; /** * Max number of knowledge base chunks to retrieve */ top_k?: number; } interface CascadingModelConfig { /** * A text LLM that runs alongside the primary and takes over when the primary is * slow. */ backup?: CascadingModelConfig.BackupModelRef | unknown; primary?: CascadingModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a text LLM with a separate voice. This is the default type. */ type?: 'cascading'; } namespace CascadingModelConfig { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } } interface S2SModelConfig { primary?: S2SModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a speech-to-speech model. */ type?: 's2s'; } namespace S2SModelConfig { interface Primary { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; } } /** * Retell LLMs only. A full-duplex voice model talks to the user and delegates to a * cascading backend model, which runs the LLM's prompt, tools and knowledge base. * Requires backend, and the Retell LLM's voice_prompt. Tools' * speak_during_execution is ignored, since the voice model covers the wait itself, * and speak_after_execution is always on. */ interface DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ backend?: DuplexModelConfig.Backend; /** * A backup for the backend model. */ backup?: DuplexModelConfig.BackupModelRef | unknown; primary?: DuplexModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a full-duplex voice model with a cascading backend. */ type?: 'duplex'; } namespace DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ interface Backend { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { model: 'gpt-live-1'; } } } } } export interface CallRegisterPhoneCallParams { /** * The agent to use for the call. */ agent_id: string; /** * For this particular call, override agent configuration with these settings. This * allows you to customize agent behavior for individual calls without modifying * the base agent. */ agent_override?: CallRegisterPhoneCallParams.AgentOverride; /** * The version of the agent to use for the call. */ agent_version?: string | number; /** * Direction of the phone call. Stored for tracking purpose. */ direction?: 'inbound' | 'outbound'; /** * The number you own in E.164 format. Stored for tracking purpose. */ from_number?: string; /** * An arbitrary object for storage purpose only. You can put anything here like * your internal customer id associated with the call. Not used for processing. You * can later get this field from the call object. */ metadata?: unknown; /** * Add optional dynamic variables in key value pairs of string that injects into * your Response Engine prompt and tool description. Only applicable for Response * Engine. */ retell_llm_dynamic_variables?: { [key: string]: string; }; /** * The number you want to call, in E.164 format. Stored for tracking purpose. */ to_number?: string; } export declare namespace CallRegisterPhoneCallParams { /** * For this particular call, override agent configuration with these settings. This * allows you to customize agent behavior for individual calls without modifying * the base agent. */ interface AgentOverride { /** * Override agent configuration settings. Any properties specified here will * override the base agent configuration for this call. If a Retell LLM or * Conversation Flow response engine is specified without a version, it uses the * latest version. */ agent?: AgentOverride.Agent; /** * Override conversation flow configuration settings. Only applicable when using * conversation flow as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms. A * model_config override can set backup to null to remove it for this call. */ conversation_flow?: AgentOverride.ConversationFlow; /** * Override Retell LLM configuration settings. Only applicable when using Retell * LLM as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms, * begin_message. A model_config override can set backup to null to remove it for * this call, but cannot switch a speech-to-speech LLM to a cascading model. */ retell_llm?: AgentOverride.RetellLlm; } namespace AgentOverride { /** * Override agent configuration settings. Any properties specified here will * override the base agent configuration for this call. If a Retell LLM or * Conversation Flow response engine is specified without a version, it uses the * latest version. */ interface Agent { /** * The name of the agent. Only used for your own reference. */ agent_name?: string | null; /** * If set to true, DTMF input will interrupt the agent even when * interruption_sensitivity is 0. Can be overridden per conversation or subagent * node. Default to false. */ allow_dtmf_interruption?: boolean; /** * If set to true, DTMF input will be accepted and processed. If false, any DTMF * input will be ignored. Default to true. */ allow_user_dtmf?: boolean; /** * If set, will add ambient environment sound to the call to make experience more * realistic. Currently supports the following options: * * - `coffee-shop`: Coffee shop ambience with people chatting in background. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/coffee-shop.wav) * - `convention-hall`: Convention hall ambience, with some echo and people * chatting in background. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/convention-hall.wav) * - `summer-outdoor`: Summer outdoor ambience with cicada chirping. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/summer-outdoor.wav) * - `mountain-outdoor`: Mountain outdoor ambience with birds singing. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/mountain-outdoor.wav) * - `static-noise`: Constant static noise. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/static-noise.wav) * - `call-center`: Call center work noise. * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/call-center.wav) * Set to `null` to remove ambient sound from this agent. */ ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'static-noise' | 'call-center' | null; /** * If set, will control the volume of the ambient sound. Value ranging from [0,2]. * Lower value means quieter ambient sound, while higher value means louder ambient * sound. If unset, default value 1 will apply. */ ambient_sound_volume?: number; /** * Only applicable when enable_backchannel is true. Controls how often the agent * would backchannel when a backchannel is possible. Value ranging from [0,1]. * Lower value means less frequent backchannel, while higher value means more * frequent backchannel. If unset, default value 0.8 will apply. */ backchannel_frequency?: number; /** * Only applicable when enable_backchannel is true. A list of words that the agent * would use as backchannel. If not set, default backchannel words will apply. * Check out * [backchannel default words](/agent/interaction-configuration#backchannel) for * more details. Note that certain voices do not work too well with certain words, * so it's recommended to experiment before adding any words. */ backchannel_words?: Array | null; /** * If set, will delay the first message by the specified amount of milliseconds, so * that it gives user more time to prepare to take the call. Valid range is [0, * 5000]. If not set or set to 0, agent will speak immediately. Only applicable * when agent speaks first. */ begin_message_delay_ms?: number; /** * Provide a customized list of keywords to bias the transcriber model, so that * these words are more likely to get transcribed. Commonly used for names, brands, * street, etc. Entries may reference dynamic variables with `{{variable}}` syntax. */ boosted_keywords?: Array | null; /** * If this option is set, the agent prompt will include call screen handling * instructions for identity and call purpose questions. Set this to null to * disable call screen prompt instructions. */ call_screening_option?: Agent.CallScreeningOption | null; /** * Contact memory settings for phone calls and SMS chats. Creating an agent * defaults enable_update to false and enable_read to true. Updates only change the * supplied flags; omitted flags stay unchanged and an empty object has no effect. * Set a flag to false to disable it. The configuration cannot be cleared. Existing * agents without this configuration have both disabled. */ contact_memory_config?: Agent.ContactMemoryConfig; /** * Custom STT configuration. Only used when stt_mode is set to custom. */ custom_stt_config?: Agent.CustomSttConfig | null; /** * Number of days to retain call/chat data before automatic deletion. Must be * between 1 and 730 days. If not set, data is retained forever (no automatic * deletion). */ data_storage_retention_days?: number | null; /** * Granular setting to manage how Retell stores sensitive data (transcripts, * recordings, logs, etc.). This replaces the deprecated * `opt_out_sensitive_data_storage` field. * * - `everything`: Store all data including transcripts, recordings, and logs. * - `everything_except_pii`: Store data without PII when PII is detected. * - `basic_attributes_only`: Store only basic attributes; no * transcripts/recordings/logs. If not set, default value of "everything" will * apply. */ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only'; /** * Controls the enhancement level for background voice cancellation. Set to 0 to * bypass background voice cancellation without BVC charges. Value ranging from * [0,1]. Only applicable when denoising_mode is * noise-and-background-speech-cancellation. Defaults to 0.8 if no value is * configured. Set to null to clear the configured value. Omitting this field * preserves the existing value. */ denoising_enhancement_level?: number | null; /** * If set, determines what denoising mode to use. Use "no-denoise" to bypass all * audio denoising. Default to noise-cancellation. */ denoising_mode?: 'no-denoise' | 'noise-cancellation' | 'noise-and-background-speech-cancellation'; /** * Controls whether the agent would backchannel (agent interjects the speaker with * phrases like "yeah", "uh-huh" to signify interest and engagement). Backchannel * when enabled tends to show up more in longer user utterances. If not set, agent * will not backchannel. */ enable_backchannel?: boolean; /** * Whether to rewrite generated responses with the separately billed colloquial * model. This setting is independent of handbook selection and is not supported * for speech-to-speech response engines. Defaults to false. */ enable_colloquial_model?: boolean; /** * If set to true, the agent recognizes requests to stop calling or contacting the * user, confirms once, and on a clear yes ends the call with disconnection reason * user_requested_dnc and sets do_not_call to true on the contact for the user's * phone number. If unset, default value false will apply. */ enable_dnc_detection?: boolean; /** * If set to true, the agent will dynamically adjust how quickly it responds based * on the user's speech rate and past turn-taking behavior in the call. If unset, * default value false will apply. */ enable_dynamic_responsiveness?: boolean; /** * If set to true, will enable dynamic voice speed adjustment based on the user's * speech rate and conversation context. If unset, default value false will apply. */ enable_dynamic_voice_speed?: boolean; /** * Master toggle for expressive mode. When true, the agent may add expressive voice * tags to the audio it generates. Only applicable for platform voices. If unset, * defaults to false. */ enable_expressive_mode?: boolean; /** * If users stay silent for a period after agent speech, end the call. The minimum * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). */ end_call_after_silence_ms?: number; /** * The expressive voice tags Retell pre-teaches the model to use when * enable_expressive_mode is true. Custom tags defined in the system prompt are * still allowed. If empty, the agent follows general expressive guidance without a * fixed tag set. */ expressive_emotion_tags?: Array<'empathetic' | 'excited' | 'happy' | 'curious' | 'surprised' | 'sigh' | 'clear throat' | 'pause' | 'long pause' | 'emphasis'>; /** * Custom expressive voice guidance to use instead of the default Retell expressive * prompt when enable_expressive_mode is true. If omitted or blank, the default * expressive prompt will be used. */ expressive_mode_prompt?: string | null; /** * When TTS provider for the selected voice is experiencing outages, we would use * fallback voices listed here for the agent. Voice id and the fallback voice ids * must be from different TTS providers. The system would go through the list in * order, if the first one in the list is also having outage, it would use the next * one. Set to null to remove voice fallback for the agent. */ fallback_voice_ids?: Array | null; /** * Configuration for guardrail checks to detect and prevent prohibited topics in * agent output and user input. */ guardrail_config?: Agent.GuardrailConfig; /** * Enable and customize handbook prompts. Sending this field replaces the complete * handbook configuration. */ handbook_config?: Agent.HandbookConfig; /** * Controls how sensitive the agent is to user interruptions. Value ranging from * [0,1]. Lower value means it will take longer / more words for user to interrupt * agent, while higher value means it's easier for user to interrupt agent. If * unset, default value 1 will apply. When this is set to 0, agent would never be * interrupted. */ interruption_sensitivity?: number; /** * If this option is set, the call will try to detect IVR in the first 3 minutes of * the call. Actions defined will be applied when the IVR is detected. Set this to * null to disable IVR detection. */ ivr_option?: Agent.IvrOption | null; /** * Specifies what language(s) the agent will operate in. Accepts either a single * locale (e.g. `en-US`) or an array of locales for multilingual agents (e.g. * `["en-US","es-ES"]`). If unset, defaults to `en-US`. */ language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | Array<'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA'>; /** * Maximum allowed length for the call, will force end the call if reached. The * minimum value allowed is 60,000 ms (1 min), and maximum value allowed is * 7,200,000 (2 hours). By default, this is set to 3,600,000 (1 hour). */ max_call_duration_ms?: number; /** * Whether this agent opts in for signed URLs for public logs and recordings. When * enabled, the generated URLs will include security signatures that restrict * access and automatically expire after 24 hours. */ opt_in_signed_url?: boolean; /** * Configuration for PII scrubbing from transcripts and recordings. */ pii_config?: Agent.PiiConfig; /** * Post call analysis data to extract from the call. This data will augment the * pre-defined variables extracted in the call analysis. This will be available * after the call ends. */ post_call_analysis_data?: Array | null; /** * The model to use for post call analysis. Default to gpt-5.6-terra. */ post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon' | null; /** * Integration (Agent Functions) tools run as a dependency graph during teardown, * after post-call analysis. Each tool can be gated by a condition. On calls the * graph is stopped after five minutes so teardown can finish. Set to null to * clear. */ post_session_tools?: Array | null; /** * Integration (Agent Functions) tools run as a dependency graph during session * setup, before the agent's first message. Outputs are injected as dynamic * variables. On calls the graph gets one minute unless an outbound caller will be * dialed after setup, in which case it gets five minutes. Past that session * initialization continues and any remaining tools finish in the background, so * their outputs no longer reach the agent's prompt. Set to null to clear. */ pre_session_tools?: Array | null; /** * A list of words / phrases and their pronunciation to be used to guide the audio * synthesize for consistent pronunciation. Check the dashboard to see what * provider supports this feature. Set to null to remove pronunciation dictionary * from this agent. */ pronunciation_dictionary?: Array | null; /** * If set, controls how many times agent would remind user when user is * unresponsive. Must be a non negative integer. If unset, default value of 1 will * apply (remind once). Set to 0 to disable agent from reminding. */ reminder_max_count?: number; /** * If set (in milliseconds), will trigger a reminder to the agent to speak if the * user has been silent for the specified duration after some agent speech. Must be * a positive number. If unset, default value of 10000 ms (10 s) will apply. */ reminder_trigger_ms?: number; /** * The Response Engine to attach to the agent. It is used to generate responses for * the agent. You need to create a Response Engine first before attaching it to an * agent. */ response_engine?: Agent.ResponseEngineRetellLm | Agent.ResponseEngineCustomLm | Agent.ResponseEngineConversationFlow; /** * Controls how responsive is the agent. Value ranging from [0,1]. Lower value * means less responsive agent (wait more, respond slower), while higher value * means faster exchanges (respond when it can). If unset, default value 1 will * apply. */ responsiveness?: number; /** * If set, the phone ringing will last for the specified amount of milliseconds. * This applies for both outbound call ringtime, and call transfer ringtime. * Default to 30000 (30 s). Valid range is [5000, 300000]. */ ring_duration_ms?: number; /** * The expiration time for the signed url in milliseconds. Only applicable when * opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will * apply. */ signed_url_expiration_ms?: number | null; /** * If set, determines whether speech to text should focus on latency or accuracy. * Default to fast mode. When set to custom, custom_stt_config must be provided. */ stt_mode?: 'fast' | 'accurate' | 'custom'; /** * IANA timezone for the agent (e.g. America/New_York). Defaults to * America/Los_Angeles if not set. */ timezone?: string | null; user_dtmf_options?: Agent.UserDtmfOptions | null; /** * Optional description of the agent version. Used for your own reference and * documentation. */ version_description?: string | null; /** * Optional title of the agent version. Used for your own reference. */ version_title?: string | null; /** * If set, determines the vocabulary set to use for transcription. This setting * only applies for English agents, for non English agent, this setting is a no-op. * Default to general. */ vocab_specialization?: 'general' | 'medical'; /** * Unique voice id used for the agent. Find list of available voices and their * preview in Dashboard. */ voice_id?: string; /** * Select the voice model used for the selected voice. Each provider has a set of * available voice models. Set to null to remove voice model selection, and default * ones will apply. Check out dashboard for more details of each voice model. */ voice_model?: 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'eleven_v3_conversational' | 'eleven_v4' | 'eleven_v4_turbo' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'sonic-3.6' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | 'drama-3' | 'inworld-tts-2' | 'inworld-tts-2-flash' | null; /** * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower * speech, while higher value means faster speech rate. If unset, default value 1 * will apply. */ voice_speed?: number; /** * Controls how stable the voice is. Value ranging from [0,2]. Lower value means * more stable, and higher value means more variant speech generation. Check the * dashboard to see what provider supports this feature. If unset, default value 1 * will apply. */ voice_temperature?: number; /** * If this option is set, the call will try to detect voicemail in the first 3 * minutes of the call. Actions defined (hangup, or leave a message) will be * applied when the voicemail is detected. Set this to null to disable voicemail * detection. */ voicemail_option?: Agent.VoicemailOption | null; /** * If set, will control the volume of the agent. Value ranging from [0,2]. Lower * value means quieter agent speech, while higher value means louder agent speech. * If unset, default value 1 will apply. */ volume?: number; /** * Which webhook events this agent should receive. If not set, defaults to * call_started, call_ended, call_analyzed. */ webhook_events?: Array<'call_started' | 'call_ended' | 'call_analyzed' | 'transcript_updated' | 'transfer_started' | 'transfer_bridged' | 'transfer_cancelled' | 'transfer_ended'> | null; /** * The timeout for the webhook in milliseconds. If not set, default value of 10000 * will apply. */ webhook_timeout_ms?: number; /** * The webhook for agent to listen to call events. See what events it would get at * [webhook doc](/features/webhook). If set, will binds webhook events for this * agent to the specified url, and will ignore the account level webhook for this * agent. Set to `null` to remove webhook url from this agent. */ webhook_url?: string | null; } namespace Agent { /** * If this option is set, the agent prompt will include call screen handling * instructions for identity and call purpose questions. Set this to null to * disable call screen prompt instructions. */ interface CallScreeningOption { /** * Identity the agent should provide when a call screen asks who is calling. * Dynamic variables are supported. */ agent_identity: string; /** * Purpose the agent should provide when a call screen asks why it is calling. * Dynamic variables are supported. */ call_purpose: string; } /** * Contact memory settings for phone calls and SMS chats. Creating an agent * defaults enable_update to false and enable_read to true. Updates only change the * supplied flags; omitted flags stay unchanged and an empty object has no effect. * Set a flag to false to disable it. The configuration cannot be cleared. Existing * agents without this configuration have both disabled. */ interface ContactMemoryConfig { /** * Automatically add saved contact memory to the agent prompt. Skippable nodes can * use answers from the current conversation even when this setting is disabled. * Contact dynamic variables, including contact_memory, remain available regardless * of this setting. */ enable_read?: boolean; /** * Rewrite the contact memory after each conversation. Cannot be enabled for * payment agents. Requires storing conversation data. Chat agents must also have * end_chat_after_silence_ms set. */ enable_update?: boolean; } /** * Custom STT configuration. Only used when stt_mode is set to custom. */ interface CustomSttConfig { /** * Endpointing timeout in milliseconds. Minimum is 100 for Azure, 10 for Deepgram, * 500 for Soniox, 100 for AssemblyAI, 100 for Muse. For AssemblyAI, this sets * min_turn_silence (100-3000 ms). max_turn_silence adds half of this value, * rounded to the nearest millisecond and bounded to 500-1000 ms, with a total cap * of 3000 ms. Muse detects turn ends itself and ignores this value. */ endpointing_ms: number; /** * ASR provider name. */ provider: 'azure' | 'deepgram' | 'soniox' | 'assemblyai' | 'muse'; } /** * Configuration for guardrail checks to detect and prevent prohibited topics in * agent output and user input. */ interface GuardrailConfig { /** * Selected prohibited user topic categories to check. When user messages contain * these topics, the agent will respond with a placeholder message instead of * processing the request. */ input_topics?: Array<'platform_integrity_jailbreaking'> | null; /** * Selected prohibited agent topic categories to check. When agent messages contain * these topics, they will be replaced with a placeholder message. */ output_topics?: Array<'harassment' | 'self_harm' | 'sexual_exploitation' | 'violence' | 'defense_and_national_security' | 'illicit_and_harmful_activity' | 'gambling' | 'regulated_professional_advice' | 'child_safety_and_exploitation'> | null; } /** * Enable and customize handbook prompts. Sending this field replaces the complete * handbook configuration. */ interface HandbookConfig { /** * When asked, acknowledge being a virtual assistant. */ ai_disclosure?: boolean | HandbookConfig.HandbookEntryConfig; /** * Conversational handbook. */ conversational?: HandbookConfig.Conversational; /** * Legacy name for conversational. Cannot be sent together with conversational. For * compatibility, true also enables enable_colloquial_model when that field is * omitted. */ conversational_personality?: boolean; /** * Customer Support handbook. */ customer_support?: HandbookConfig.CustomerSupport; /** * Legacy name for customer_support. Cannot be sent together with customer_support. */ default_personality?: boolean; /** * Repeat back and confirm important details (voice only). */ echo_verification?: boolean | HandbookConfig.HandbookEntryConfig; /** * Warm acknowledgment of caller concerns. */ high_empathy?: boolean | HandbookConfig.HandbookEntryConfig; /** * Spell using NATO phonetic alphabet style (voice only). */ nato_phonetic_alphabet?: boolean | HandbookConfig.HandbookEntryConfig; /** * Sprinkle natural speech fillers like "um", "you know" for a more human, * conversational tone. */ natural_filler_words?: boolean | HandbookConfig.HandbookEntryConfig; /** * Stay within prompt/context scope, don't invent details. */ scope_boundaries?: boolean | HandbookConfig.HandbookEntryConfig; /** * Treat near-match similar words as same entity to reduce impact of transcription * error (voice only). */ smart_matching?: boolean | HandbookConfig.HandbookEntryConfig; /** * Convert numbers/dates/currency to spoken forms (voice only). */ speech_normalization?: boolean | HandbookConfig.HandbookEntryConfig; } namespace HandbookConfig { /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Conversational handbook. */ interface Conversational { custom_prompt?: string | null; } /** * Customer Support handbook. */ interface CustomerSupport { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } /** * Configuration for an enabled handbook. Omit custom_prompt or set it to null to * use the Retell-provided prompt. An empty string intentionally injects no prompt * for this handbook. */ interface HandbookEntryConfig { custom_prompt?: string | null; } } /** * If this option is set, the call will try to detect IVR in the first 3 minutes of * the call. Actions defined will be applied when the IVR is detected. Set this to * null to disable IVR detection. */ interface IvrOption { action: IvrOption.Action; /** * Optionally describe what should be treated as an IVR. Leave as null to use the * default definition. */ detection_prompt?: string | null; } namespace IvrOption { interface Action { type: 'hangup'; } } /** * Configuration for PII scrubbing from transcripts and recordings. */ interface PiiConfig { /** * List of PII categories to scrub from transcripts and recordings. PII redaction * is only active when this list is non-empty; an empty array means no PII * scrubbing is performed. */ categories: Array<'person_name' | 'address' | 'email' | 'phone_number' | 'ssn' | 'passport' | 'driver_license' | 'credit_card' | 'bank_account' | 'password' | 'pin' | 'medical_id' | 'date_of_birth' | 'customer_account_number'>; /** * The processing mode for PII scrubbing. Currently only post-call is supported. */ mode: 'post_call'; } interface StringAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'string'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Examples of the variable value to teach model the style and syntax. */ examples?: Array; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface EnumAnalysisData { /** * The possible values of the variable, must be non empty array. */ choices: Array; /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'enum'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface BooleanAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'boolean'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface NumberAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'number'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } /** * System preset for post-call analysis (voice agents). Use in * post_call_analysis_data to override prompts or mark fields optional. */ interface CallPresetAnalysisData { /** * Preset identifier for voice agent analysis. */ name: 'call_summary' | 'call_successful' | 'user_sentiment'; /** * Identifies this item as a system preset. */ type: 'system-presets'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Prompt or description for this preset. */ description?: string; /** * If false, this field is optional in the analysis. If true or unset, the field is * required. */ required?: boolean; } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: AppTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: CustomTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: CodeTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } namespace CodeTool { /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } } interface SendSMSTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate; type: 'send_sms'; /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ condition?: SendSMSTool.Condition; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say before sending the SMS. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * SMS destination number configuration. If omitted, the message is sent to the * customer number on the call. */ sms_destination?: SendSMSTool.DestinationCustomerNumber | SendSMSTool.DestinationPhoneNumber | unknown; /** * SMS sender number configuration. If omitted, the message is sent from the * agent's phone number. */ sms_sender?: SendSMSTool.SenderCurrentNumber | SendSMSTool.SenderRetellLongCode | unknown; /** * Whether the agent should speak after the SMS tool finishes execution. */ speak_after_execution?: boolean; /** * If true, the agent will speak a short line before sending the SMS. If omitted, * defaults to true (same as end_call / transfer_call tools). */ speak_during_execution?: boolean; } namespace SendSMSTool { interface SMSContentPredefined { /** * The static message to be sent in the SMS. Can contain dynamic variables. */ text?: string; type?: 'predefined'; } interface SMSContentInferred { /** * The prompt to be used to help infer the SMS content. The model will take the * global prompt, the call transcript, and this prompt together to deduce the right * message to send. Can contain dynamic variables. */ prompt?: string; type?: 'inferred'; } interface SMSContentTemplate { /** * The template to use for the SMS content. "info_collection" sends a predefined * message requesting information from the user. */ template: 'info_collection'; type: 'template'; } /** * Optional gate; the step only runs when the condition holds. Defaults to always * running. */ interface Condition { equations: Array; operator: '||' | '&&'; type: 'equation'; } namespace Condition { interface Equation { /** * Left side of the equation */ left: string; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist'; /** * Right side of the equation. The right side of the equation not required when * "exists" or "not_exist" are selected. */ right?: string; } } interface DestinationCustomerNumber { type: 'customer_number'; } interface DestinationPhoneNumber { /** * Destination phone number in E.164 format. */ phone_number: string; type: 'phone_number'; /** * If true, skip E.164 validation for this phone number (same semantics as * transfer_call ignore_e164_validation). */ ignore_e164_validation?: boolean; } interface SenderCurrentNumber { type: 'current_number'; } interface SenderRetellLongCode { type: 'retell_long_code'; } } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Names of tools that must run before this one. */ depends_on?: Array; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } interface PronunciationDictionary { /** * The phonetic alphabet to use. MiniMax speech-02-turbo supports IPA and Pinyin. * MiniMax speech-2.8-turbo also supports Jyutping. Support for other alphabets * depends on the selected voice provider and model. */ alphabet: 'ipa' | 'cmu' | 'pinyin' | 'jyutping'; /** * Pronunciation of the word in the format of the selected phonetic alphabet. */ phoneme: string; /** * The string of word / phrase to be annotated with pronunciation. */ word: string; } interface ResponseEngineRetellLm { /** * id of the Retell LLM Response Engine. */ llm_id: string; /** * type of the Response Engine. */ type: 'retell-llm'; /** * Version of the Retell LLM Response Engine. */ version?: number | null; } interface ResponseEngineCustomLm { /** * LLM websocket url of the custom LLM. */ llm_websocket_url: string; /** * type of the Response Engine. */ type: 'custom-llm'; } interface ResponseEngineConversationFlow { /** * ID of the Conversation Flow Response Engine. */ conversation_flow_id: string; /** * type of the Response Engine. */ type: 'conversation-flow'; /** * Version of the Conversation Flow Response Engine. */ version?: number | null; } interface UserDtmfOptions { /** * The maximum number of digits allowed in the user's DTMF (Dual-Tone * Multi-Frequency) input per turn. Once this limit is reached, the input is * considered complete and a response will be generated immediately. */ digit_limit?: number | null; /** * A single key that signals the end of DTMF input. Acceptable values include any * digit (0-9), the pound/hash symbol (#), or the asterisk (\*). */ termination_key?: string | null; /** * The time (in milliseconds) to wait for user DTMF input before timing out. The * timer resets with each digit received. */ timeout_ms?: number; } /** * If this option is set, the call will try to detect voicemail in the first 3 * minutes of the call. Actions defined (hangup, or leave a message) will be * applied when the voicemail is detected. Set this to null to disable voicemail * detection. */ interface VoicemailOption { action: VoicemailOption.VoicemailActionPrompt | VoicemailOption.VoicemailActionStaticText | VoicemailOption.VoicemailActionHangup | VoicemailOption.VoicemailActionBridgeTransfer; /** * Optionally describe what should be treated as voicemail. Leave as null to use * the default definition. */ detection_prompt?: string | null; } namespace VoicemailOption { interface VoicemailActionPrompt { /** * The prompt used to generate the text to be spoken when the call is detected to * be in voicemail. */ text: string; type: 'prompt'; } interface VoicemailActionStaticText { /** * The text to be spoken when the call is detected to be in voicemail. */ text: string; type: 'static_text'; } interface VoicemailActionHangup { type: 'hangup'; } interface VoicemailActionBridgeTransfer { type: 'bridge_transfer'; } } } /** * Override conversation flow configuration settings. Only applicable when using * conversation flow as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms. A * model_config override can set backup to null to remove it for this call. */ interface ConversationFlow { /** * Replace backup model configuration for this call only. Omit to inherit the saved * configuration, or set null to disable backup. An omitted backup_kick_in_timeout * in a supplied configuration defaults to 1500 milliseconds. */ backup_model?: ConversationFlow.BackupModelChoice | unknown; /** * If set, the AI will begin the conversation after waiting for the user for the * duration (in milliseconds) specified by this attribute. This only applies if the * agent is configured to wait for the user to speak first. If not set, the agent * will wait indefinitely for the user to speak. */ begin_after_user_silence_ms?: number | null; /** * Knowledge base configuration for RAG retrieval. */ kb_config?: ConversationFlow.KBConfig; /** * Knowledge base IDs for RAG (Retrieval-Augmented Generation). */ knowledge_base_ids?: Array | null; /** * @deprecated Deprecated, use model_config. Ignored when model_config is set. */ model_choice?: ConversationFlow.ModelChoiceCascading | ConversationFlow.ModelChoiceS2S; /** * Model settings for the response engine. type decides which models primary and * backup accept. On update, each top-level key replaces the current one and * omitted keys are kept; set backup to null to remove it. Changing type requires * primary and clears backup, while temperature carries over. In agent_override, * type is required whenever primary is set; setting backup to null disables it for * that call only. */ model_config?: ConversationFlow.CascadingModelConfig | ConversationFlow.S2SModelConfig | ConversationFlow.DuplexModelConfig; /** * @deprecated Deprecated, use model_config.temperature. Ignored when model_config * is set. */ model_temperature?: number | null; /** * Who starts the conversation - user or agent. */ start_speaker?: 'user' | 'agent'; } namespace ConversationFlow { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelChoice { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Duration in milliseconds to prefer primary model output while both models run * concurrently. Must be between 300 and 60000 milliseconds, inclusive. Defaults to * 1500 when omitted. */ backup_kick_in_timeout?: number; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } /** * Knowledge base configuration for RAG retrieval. */ interface KBConfig { /** * Similarity threshold for filtering search results */ filter_score?: number; /** * Max number of knowledge base chunks to retrieve */ top_k?: number; } interface ModelChoiceCascading { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } interface ModelChoiceS2S { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; /** * Type of model choice */ type: 's2s'; } interface CascadingModelConfig { /** * A text LLM that runs alongside the primary and takes over when the primary is * slow. */ backup?: CascadingModelConfig.BackupModelRef | unknown; primary?: CascadingModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a text LLM with a separate voice. This is the default type. */ type?: 'cascading'; } namespace CascadingModelConfig { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } } interface S2SModelConfig { primary?: S2SModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a speech-to-speech model. */ type?: 's2s'; } namespace S2SModelConfig { interface Primary { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; } } /** * Retell LLMs only. A full-duplex voice model talks to the user and delegates to a * cascading backend model, which runs the LLM's prompt, tools and knowledge base. * Requires backend, and the Retell LLM's voice_prompt. Tools' * speak_during_execution is ignored, since the voice model covers the wait itself, * and speak_after_execution is always on. */ interface DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ backend?: DuplexModelConfig.Backend; /** * A backup for the backend model. */ backup?: DuplexModelConfig.BackupModelRef | unknown; primary?: DuplexModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a full-duplex voice model with a cascading backend. */ type?: 'duplex'; } namespace DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ interface Backend { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { model: 'gpt-live-1'; } } } /** * Override Retell LLM configuration settings. Only applicable when using Retell * LLM as the response engine. Supported attributes - model_config, * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms, * begin_message. A model_config override can set backup to null to remove it for * this call, but cannot switch a speech-to-speech LLM to a cascading model. */ interface RetellLlm { /** * Replace backup model configuration for this call only. Omit to inherit the saved * configuration, or set null to disable backup. An omitted backup_kick_in_timeout * in a supplied configuration defaults to 1500 milliseconds. */ backup_model?: RetellLlm.BackupModelChoice | unknown; /** * If set, the AI will begin the conversation after waiting for the user for the * duration (in milliseconds) specified by this attribute. This only applies if the * agent is configured to wait for the user to speak first. If not set, the agent * will wait indefinitely for the user to speak. */ begin_after_user_silence_ms?: number | null; /** * First utterance said by the agent in the call. If not set, LLM will dynamically * generate a message. If set to "", agent will wait for user to speak first. */ begin_message?: string | null; /** * Knowledge base configuration for RAG retrieval. */ kb_config?: RetellLlm.KBConfig | null; /** * A list of knowledge base ids to use for this resource. */ knowledge_base_ids?: Array | null; /** * @deprecated Available LLM models for agents. */ model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon' | null; /** * Model settings for the response engine. type decides which models primary and * backup accept. On update, each top-level key replaces the current one and * omitted keys are kept; set backup to null to remove it. Changing type requires * primary and clears backup, while temperature carries over. In agent_override, * type is required whenever primary is set; setting backup to null disables it for * that call only. */ model_config?: RetellLlm.CascadingModelConfig | RetellLlm.S2SModelConfig | RetellLlm.DuplexModelConfig; /** * @deprecated Deprecated, use model_config.primary.tier fast. Ignored when * model_config is set. */ model_high_priority?: boolean | null; /** * @deprecated Deprecated, use model_config.temperature. Ignored when model_config * is set. */ model_temperature?: number; /** * @deprecated Deprecated, use model_config.primary.tier ultrafast. Ignored when * model_config is set. */ model_ultrafast?: boolean | null; /** * @deprecated The speech-to-speech model to use */ s2s_model?: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0' | null; /** * The speaker who starts the conversation. Required. Must be either 'user' or * 'agent'. */ start_speaker?: 'user' | 'agent'; } namespace RetellLlm { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelChoice { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Duration in milliseconds to prefer primary model output while both models run * concurrently. Must be between 300 and 60000 milliseconds, inclusive. Defaults to * 1500 when omitted. */ backup_kick_in_timeout?: number; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } /** * Knowledge base configuration for RAG retrieval. */ interface KBConfig { /** * Similarity threshold for filtering search results */ filter_score?: number; /** * Max number of knowledge base chunks to retrieve */ top_k?: number; } interface CascadingModelConfig { /** * A text LLM that runs alongside the primary and takes over when the primary is * slow. */ backup?: CascadingModelConfig.BackupModelRef | unknown; primary?: CascadingModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a text LLM with a separate voice. This is the default type. */ type?: 'cascading'; } namespace CascadingModelConfig { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } } interface S2SModelConfig { primary?: S2SModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a speech-to-speech model. */ type?: 's2s'; } namespace S2SModelConfig { interface Primary { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; } } /** * Retell LLMs only. A full-duplex voice model talks to the user and delegates to a * cascading backend model, which runs the LLM's prompt, tools and knowledge base. * Requires backend, and the Retell LLM's voice_prompt. Tools' * speak_during_execution is ignored, since the voice model covers the wait itself, * and speak_after_execution is always on. */ interface DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ backend?: DuplexModelConfig.Backend; /** * A backup for the backend model. */ backup?: DuplexModelConfig.BackupModelRef | unknown; primary?: DuplexModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a full-duplex voice model with a cascading backend. */ type?: 'duplex'; } namespace DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ interface Backend { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { model: 'gpt-live-1'; } } } } } export interface CallTakeOverLiveParams { /** * The id of the live-listen participant to upgrade, obtained when joining via * /v2/listen-live-call. */ participant_id: string; } export interface CallUpdateLiveParams { /** * Live agent control. At least one of `additional_context` or `trigger_response` * should be supplied; an empty object is a no-op. */ call_control?: CallUpdateLiveParams.CallControl; /** * Call fields to override on the running call. Each field is applied to the live * call immediately; omitted fields are left unchanged. */ fields_to_override?: CallUpdateLiveParams.FieldsToOverride; } export declare namespace CallUpdateLiveParams { /** * Live agent control. At least one of `additional_context` or `trigger_response` * should be supplied; an empty object is a no-op. */ interface CallControl { /** * Free-form text appended to the call transcript with role "injected" and injected * into the next agent response context. Must be non-empty. */ additional_context?: string; /** * Only `true` has an effect. When set, if the agent is currently speaking the * response is interrupted and a new one is generated. If the agent has already * finished speaking and is waiting silently for the user, the agent is nudged to * produce another response. If the user is currently speaking, this field is a * no-op so the agent does not talk over them. This field respects the agent's * `interruption_sensitivity`: when sensitivity is `0` the agent's current speech * is treated as uninterruptible, so `trigger_response` is a no-op while the agent * is speaking. Omitting or setting `false` leaves the call untouched. */ trigger_response?: boolean; } /** * Call fields to override on the running call. Each field is applied to the live * call immediately; omitted fields are left unchanged. */ interface FieldsToOverride { /** * Data storage setting for this call. Overrides the agent's default setting. * "everything" stores all data, "everything_except_pii" excludes PII when * possible, "basic_attributes_only" stores only metadata. Cannot be downgraded * from more restrictive to less restrictive settings. */ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only'; /** * An arbitrary object for storage purpose only. Overrides the metadata on the * call. Size limited to 50kB max. */ metadata?: unknown; /** * Override dynamic variables represented as key-value pairs of strings. Setting * this will override or add the dynamic variables set in the agent during the * call. Only need to set the delta where you want to override, no need to set the * entire dynamic variables object. Setting this to null will remove any existing * override. */ override_dynamic_variables?: { [key: string]: string; } | null; } } export declare namespace Call { export { type CallResponse as CallResponse, type CreateWebCallResponse as CreateWebCallResponse, type PhoneCallResponse as PhoneCallResponse, type WebCallResponse as WebCallResponse, type CallListResponse as CallListResponse, type CallListenLiveResponse as CallListenLiveResponse, type CallTakeOverLiveResponse as CallTakeOverLiveResponse, type CallUpdateLiveResponse as CallUpdateLiveResponse, type CallUpdateParams as CallUpdateParams, type CallListParams as CallListParams, type CallCreatePhoneCallParams as CallCreatePhoneCallParams, type CallCreateWebCallParams as CallCreateWebCallParams, type CallRegisterPhoneCallParams as CallRegisterPhoneCallParams, type CallTakeOverLiveParams as CallTakeOverLiveParams, type CallUpdateLiveParams as CallUpdateLiveParams, }; } //# sourceMappingURL=call.d.mts.map