Skip to main content

Transcription

The <Transcription> verb enables real-time speech-to-text transcription for the call.

Attributes

ATTRIBUTEDESCRIPTIONOPTIONSDEFAULT
language Language to use for speech recognition. See languages in transcription_engine_config. en
interimResults Whether to send also interim results. If set to false, only final results will be sent. Applies to transcriptionEngine A only. false
transcriptionEngine Engine to use for speech recognition. Available engines: Google (default), Telnyx, Deepgram. Each engine supports different models and languages - see model attribute and examples below. Legacy values "A" (maps to Google) and "B" (maps to Telnyx) are supported for backward compatibility. Google, Telnyx, Deepgram, A, BGoogle
transcriptionTracks Indicates which leg of the call will be transcribed. Use inbound for the leg that requested the transcription, outbound for the other leg, and both for both legs of the call. inbound, outbound, bothinbound
transcriptionCallback URL that tells Telnyx where to make its GET or POST requests with transcription data. -
transcriptionCallbackMethod HTTP request type used for transcriptionCallback. GET, POSTPOST
model Optional model to use with the specified transcription engine. If not specified, the engine's default model will be used. See transcription models in transcription_engine_config. -

Examples

Example 1: Basic transcription using Google (default)

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Start>
<Transcription language="en" interimResults="true" transcriptionCallback="/transcription" />
</Start>
</Response>

Example 2: Google with phone call optimized model

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Start>
<Transcription
transcriptionEngine="Google"
model="phone_call"
language="en-US"
interimResults="true"
transcriptionCallback="/transcription" />
</Start>
</Response>

Example 3: Telnyx engine with Whisper model

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Start>
<Transcription
transcriptionEngine="Telnyx"
model="openai/whisper-large-v3-turbo"
language="es"
transcriptionCallback="/transcription" />
</Start>
</Response>

Example 4: Deepgram with Nova-3 model

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Start>
<Transcription
transcriptionEngine="Deepgram"
model="deepgram/nova-3"
language="fr"
transcriptionCallback="/transcription" />
</Start>
</Response>

Expected callbacks

transcription-callback

{
"AccountSid": params.user_id,
"CallSid" => call_sid,
"CallSidLegacy" => call_sid,
"Transcript" => params.transcript,
"IsFinal" => params.is_final,
"Confidence" => params.confidence
}

Status callback HTTP attributes

ATTRIBUTEDESCRIPTION
AccountSidA unique identifier for the account generating this call.
CallSidA unique identifier for this call, generated by Telnyx.
CallSidLegacyA unique identifier for the call sent to keep backward compatibility.
TranscriptThe result of the transcription.
IsFinalIndicates if the provided transcription is final, supported by engine A only
ConfidenceIndicates the level of confidence in the accuracy of the transcription. Possible value 1 (high confidence) - 0 (low confidence), supported by engine A only