Skip to navigation
RelayCall

live_transcribe

View as MarkdownOpen in Claude

Start, summarize, or stop live transcription on the call. Unlike transcribe(), which provides a post-call result, live transcription sends each utterance to your webhook as it is spoken. The action dictionary takes the same shape as the live_transcribe SWML method: a single start, summarize, or stop key.

See also live_translate() for real-time translation, and the transcribe calls guide for the webhook events.

Parameters

action
dictRequired

The action to perform. Set exactly one of start, summarize, or stop.

action.start
dict

Start a live transcription session.

action.start.lang
strRequired

The language to transcribe, such as "en-US".

action.start.direction
list[str]Required

The sides of the call to transcribe: "remote-caller", "local-caller", or both.

action.start.webhook
str

The URL that receives transcription events as HTTP POST requests.

action.start.live_events
boolDefaults to False

Whether to send each utterance to the webhook as it is transcribed.

action.start.ai_summary
boolDefaults to False

Whether to send an AI summary of the conversation to the webhook when the session ends.

action.start.ai_summary_prompt
str

The prompt that tells the AI how to summarize the conversation when ai_summary is enabled.

action.start.speech_engine
strDefaults to deepgram

The speech recognition engine: "deepgram" or "google".

action.start.speech_timeout
intDefaults to 60000

The timeout for speech recognition, in milliseconds.

action.start.vad_silence_ms
intDefaults to 700 | 500

Voice activity detection silence time, in milliseconds. The default depends on the speech engine: 700 for Deepgram, 500 for Google. Omitting the value or setting it to 0 uses the engine default.

action.start.vad_thresh
intDefaults to 400

Voice activity detection threshold, from 0 to 1800.

action.start.hints
list[str]

Words or phrases that help speech recognition pick out specific terms, such as product names or industry jargon. Empty strings are ignored.

action.summarize
dict

Request an AI summary of the conversation so far, while transcription continues. Pass an empty dictionary to send the summary to the webhook from start with the default summary prompt. ai_summary_prompt applies only to the summary sent when the session ends.

action.summarize.webhook
str

The URL that receives the summary.

action.summarize.prompt
str

The prompt that tells the AI how to summarize the conversation.

action.stop
dict

Stop the live transcription session. Pass an empty dictionary.

Returns

dict — Server response confirming the operation.

Example

from signalwire.relay import RelayClient
client = RelayClient(
project="your-project-id",
token="your-api-token",
contexts=["default"],
)
@client.on_call
async def handle_call(call):
await call.answer()
# Start live transcription
result = await call.live_transcribe({
"start": {
"lang": "en-US",
"direction": ["remote-caller", "local-caller"],
"webhook": "https://example.com/transcription-events",
"live_events": True,
}
})
print(f"Live transcription started: {result}")
# Let the call proceed...
await call.wait_for_ended()
client.run()