Skip to main content

Create a Broadcaster via API

This guide walks you through the process of setting up a broadcaster using the Palabra API.

By setting up a broadcaster, you can programmatically stream live audio or video to Palabra and enable real-time translation and multilingual broadcasting for your events.


Step 1: Get API Credentials

To authenticate your API requests, you need a Client ID and Client Secret.

Visit the Palabra API Keys page to generate your credentials.

Step 2: Prepare Your Configuration

Create a JSON payload that defines your broadcast configuration.

Below is an example payload:

{
"title": "My broadcast",
"translation_settings": {
"preprocessing": {
"enable_vad": true,
"vad_threshold": 0.5,
"vad_left_padding": 1,
"vad_right_padding": 1,
"pre_vad_denoise": false,
"pre_vad_dsp": true
},
"transcription": {
"source_language": "en",
"detectable_languages": [],
"asr_model": "auto",
"denoise": "none",
"allow_hotwords_glossaries": true,
"suppress_numeral_tokens": false,
"diarize_speakers": false,
"priority": "normal",
"min_alignment_score": 0.15,
"max_alignment_cer": 0.8,
"segment_confirmation_silence_threshold": 0.7,
"only_confirm_by_silence": false,
"batched_inference": false,
"force_detect_language": false,
"sentence_splitter": {
"enabled": true,
"splitter_model": "auto",
"advanced": {
"min_sentence_characters": 80,
"min_sentence_seconds": 4,
"min_split_interval": 0.6
}
},
"verification": {
"verification_model": "auto",
"allow_verification_glossaries": true,
"auto_transcription_correction": false,
"transcription_correction_style": null
},
"advanced": {}
},
"translations": [
{
"target_language": "es",
"allowed_source_languages": [],
"translation_model": "auto",
"translate_partial_transcriptions": false,
"allow_translation_glossaries": true,
"style": null,
"speech_generation": {
"tts_model": "auto",
"voice_cloning": false,
"voice_id": "default_low",
"voice_timbre_detection": {
"enabled": true,
"high_timbre_voices": ["default_high"],
"low_timbre_voices": ["default_low"]
},
"denoise_voice_samples": false,
"speech_tempo_auto": true,
"speech_tempo_timings_factor": 0,
"speech_tempo_adjustment_factor": 0.77
},
"advanced": {
"ignore_languages": []
}
}
],
"translation_queue_configs": {
"global": {
"desired_queue_level_ms": 8000,
"max_queue_level_ms": 24000,
"auto_tempo": true
}
},
"allowed_message_types": [
"partial_transcription",
"validated_transcription",
"translated_transcription",
"partial_translated_transcription"
]
},
"original_delay_seconds": 3,
"original_volume": 0.2,
"inputs": [
{
"protocol": "rtmp_push"
}
],
"outputs": [
{
"protocol": "rtmp_push",
"url": "rtmp://ny.castr.io/static",
"stream_key": "live_be5e5710dff511ef98df6fdds2sx33?password=50assdkf3",
"lang_code": ["es"]
}
]
}

Step 3: Send a Request to the API

Make a POST request to https://api.palabra.ai/broadcast/live with your configuration and credentials:

const data = { /* your broadcast config as shown in the Step 2  */ };

fetch("https://api.palabra.ai/broadcast/live", {
method: "POST",
headers: {
"Content-Type": "application/json",
"ClientId": "<YOUR_CLIENT_ID>",
"ClientSecret": "<YOUR_CLIENT_SECRET>"
},
body: JSON.stringify(data)
})
.then(response => {
if (!response.ok) {
throw new Error(`Server responded with ${response.status}`);
}
return response.json();
})
.then(result => {
console.log("Broadcast created successfully:", result);
})
.catch(error => {
console.error("Failed to create broadcast:", error);
});

Response example:

{
"ok": true,
"data": [
{
"title": "My broadcast ",
"id": "a554841e-4e71-441c-bd79-5232f0a6e534",
"instance_id": "f79976cb-d3c7-46f4-8709-41bd69d2dc04",
"utc_created_at": "2025-07-11 11:42:46.079753627 +0000 UTC",
"status": "paused",
"error_code": null,
"error_desc": null,
"input_bitrate": 0,
"user": {
"id": "a0e5263c-4782-4155-b3ae-ea0a1e694dd7"
},
"translation_settings": {
"allowed_message_types": [
"partial_transcription",
"validated_transcription",
"translated_transcription",
"partial_translated_transcription"
],
"preprocessing": {
"enable_vad": true,
"pre_vad_denoise": false,
"pre_vad_dsp": true,
"vad_left_padding": 1,
"vad_right_padding": 1,
"vad_threshold": 0.5
},
"transcription": {
"advanced": {},
"allow_hotwords_glossaries": true,
"asr_model": "auto",
"batched_inference": false,
"denoise": "none",
"detectable_languages": [],
"diarize_speakers": false,
"force_detect_language": false,
"max_alignment_cer": 0.8,
"min_alignment_score": 0.15,
"only_confirm_by_silence": false,
"priority": "normal",
"segment_confirmation_silence_threshold": 0.7,
"sentence_splitter": {
"advanced": {
"min_sentence_characters": 80,
"min_sentence_seconds": 4,
"min_split_interval": 0.6
},
"enabled": true,
"splitter_model": "auto"
},
"source_language": "en",
"suppress_numeral_tokens": false,
"verification": {
"allow_verification_glossaries": true,
"auto_transcription_correction": false,
"transcription_correction_style": null,
"verification_model": "auto"
}
},
"translation_queue_configs": {
"global": {
"auto_tempo": true,
"desired_queue_level_ms": 8000,
"max_queue_level_ms": 24000
}
},
"translations": [
{
"advanced": {
"ignore_languages": []
},
"allow_translation_glossaries": true,
"allowed_source_languages": [],
"speech_generation": {
"denoise_voice_samples": false,
"speech_tempo_adjustment_factor": 0.77,
"speech_tempo_auto": true,
"speech_tempo_timings_factor": 0,
"tts_model": "auto",
"voice_cloning": false,
"voice_id": "default_low",
"voice_timbre_detection": {
"enabled": true,
"high_timbre_voices": [
"default_high"
],
"low_timbre_voices": [
"default_low"
]
}
},
"style": null,
"target_language": "es",
"translate_partial_transcriptions": false,
"translation_model": "auto"
}
]
},
"original_delay_seconds": 3,
"original_volume": 0.2,
"fade_factor": 0.07,
"disable_synchronization": false,
"enable_echo": false,
"inputs": [
{
"protocol": "rtmp_push",
"endpoint": "rtmp://rtmp.palabra.ai:1935/live/6232ceec166cc888",
"url": "rtmp://rtmp.palabra.ai:1935/live",
"stream_key": "6232ceec166cc888"
}
],
"outputs": [
{
"protocol": "rtmp_push",
"url": "rtmp://ny.castr.io/static",
"stream_key": "live_be5e5710dff511ef98df6fdds2sx33?password=50assdkf3",
"lang_code": [
"es"
]
}
]
}
]
}

Step 4: Manage your broadcasts

After the broadcast is created, you can use the id returned in the response to manage it further via the API.

Check ongoing broadcasts

fetch('https://api.palabra.ai/live/ongoing', {
headers: {
"ClientId": "<YOUR_CLIENT_ID>",
"ClientSecret": "<YOUR_CLIENT_SECRET>"
}
})
.then(response => response.json())
.then(result => {
console.log("Ongoing broadcasts:", result);
})
.catch(error => {
console.error("Failed to get ongoing broadcasts:", error);
});

Delete a broadcast

fetch(`https://api.palabra.ai/broadcast/live/${id}/terminate`, {
method: 'DELETE',
headers: {
"ClientId": "<YOUR_CLIENT_ID>",
"ClientSecret": "<YOUR_CLIENT_SECRET>"
}
})
.then(response => {
if (!response.ok) {
throw new Error(`Server responded with ${response.status}`);
}
console.log("Broadcast deleted successfully");
})
.catch(error => {
console.error("Failed to delete broadcast:", error);
});

Update a broadcast

const data = { /* your full broadcast config as shown in the Step 2 */ };

fetch(`https://api.palabra.ai/broadcast/live/${id}`, {
method: 'PUT',
headers: {
"Content-Type": "application/json",
"ClientId": "<YOUR_CLIENT_ID>",
"ClientSecret": "<YOUR_CLIENT_SECRET>"
},
body: JSON.stringify(data)
})
.then(response => {
if (!response.ok) {
throw new Error(`Server responded with ${response.status}`);
}
return response.json();
})
.then(result => {
console.log("Broadcast updated successfully:", result);
})
.catch(error => {
console.error("Failed to update broadcast:", error);
});