Body
Required
-
The audio format for streaming. Specifies container, codec, and encoding parameters. Supported formats include PCM (recommended), OPUS (recommended for low bandwidth), FLAC, MP3, and AAC. PCM formats require explicit sample rate. Mono audio only.
Values are
audio/auto,audio/flac,audio/mpeg,audio/ogg,audio/webm,audio/x-matroska,audio/ogg; codecs=flac,audio/ogg; codecs=opus,audio/pcm; encoding=s16le; rate=8000,audio/pcm; encoding=s16le; rate=16000,audio/pcm; encoding=s16le; rate=44100,audio/pcm; encoding=s16le; rate=48000,audio/webm; codecs=opus,audio/x-matroska; codecs=aac,audio/x-matroska; codecs=flac,audio/x-matroska; codecs=mp3, oraudio/x-matroska; codecs=opus. -
Source language of the audio stream. Must be one of the supported Voice API source languages. Language identifier must comply with IETF BCP 47 language tags.
Values are
zh,nl,en,fr,de,id,it,ja,ko,pl,pt,ro,ru,es,sv,tr, oruk. -
Controls how the source_language value is used.
auto: Treats source language as a hint; server can overridefixed: Treats source language as mandatory; server must use this language
Values are
autoorfixed. Default value isauto. -
List of target languages for translation. The stream will emit translations for each language. Maximum 5 target languages per stream. Language identifiers must comply with IETF BCP 47.
Not more than
5elements. -
A unique ID assigned to a glossary.
-
Sets whether the translated text should lean towards formal or informal language. Possible options are:
default- use the default formality for the target languageformal/more- for a more formal languageinformal/less- for a more informal language
Values are
default,formal,more,informal, orless. Default value isdefault.
Responses
-
Successfully obtained streaming URL and token
-
Bad request. Please check error message and your parameters.
-
Authorization failed. Please supply a valid
DeepL-Auth-Keyvia theAuthorizationheader. -
Authorization failed. Please supply a valid
DeepL-Auth-Keyvia theAuthorizationheader. -
Too many requests. Please wait and resend your request.
-
Quota exceeded. The character limit has been reached.
-
Internal error.
-
Resource currently unavailable. Try again later.
curl \
--request POST 'https://api.deepl.com/v3/voice/realtime' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"source_media_content_type":"audio/ogg; codecs=opus","source_language":"en","source_language_mode":"auto","target_languages":["de","fr","es"]}'
{
"source_media_content_type": "audio/ogg; codecs=opus",
"source_language": "en",
"source_language_mode": "auto",
"target_languages": [
"de",
"fr",
"es"
]
}
{
"source_media_content_type": "audio/pcm; encoding=s16le; rate=16000",
"source_language": "en",
"source_language_mode": "fixed",
"target_languages": [
"de",
"fr"
],
"glossary_id": "def3a26b-3e84-45b3-84ae-0c0aaf3525f7",
"formality": "formal"
}
{
"streaming_url": "wss://api.deepl.com/v3/voice/realtime/connect",
"token": "VGhpcyBpcyBhIGZha2UgdG9rZW4K"
}