RelayCall

live_translate

View as MarkdownOpen in Claude

Start or stop live translation on the call. Translates spoken audio into another language in real-time.

Parameters

action
dictRequired

Action configuration for the live translation.

action.action
strRequired

The action to perform.

  • "start" — begin live translation
  • "stop" — end live translation
action.source_language
str

Source language code (e.g., "en-US").

action.target_language
str

Target language code (e.g., "es-ES").

status_url
str | NoneDefaults to None

URL to receive translation results via webhook.

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 translation from English to Spanish
await call.live_translate({
"action": "start",
"source_language": "en-US",
"target_language": "es-ES",
})
# Let the call proceed...
await call.wait_for_ended()
client.run()