API Keys

Creating API Keys

To create an API key:
  1. Sign in to your account and navigate to the Dashboard.
  2. Click Create New, enter a name for your new API key, then click Create.
Your API key should be kept secure. It is generally a good practice to create a separate key for each project, so you can remove the key in case of leakage.
The API key is a unique identifier that authenticates your API requests. An API key must be supplied in the API request to use most of XL8's APIs. Please note that you need to be on the Advanced plan or Enterprise plan to create an API key.

Using API Keys

This API Key is used for Bearer Authentication. Simply pass your API key as a bearer token in Authorizationheader in your API request.
Terminal
$
curl "https://api.xl8.ai/v1/user" --header "Authorization: Bearer <API_KEY>"
Output
>
{"status": 0, "email": "contact@xl8.ai", "first_name": "Contact", "last_name": "XL8", "date_joined": "2019-10-01 00:00:00.000000", "email_notification": true, "user_id": 1, "translated_words": 0, "translated_documents": 0}

Text Translation

Supported languages

Before requesting a text/file translation or a file translation, use the /v1/trans/languages API to get a list of supported language pairs. The result contains a dictionary mapping of source language codes to arrays of target language codes.
The API accepts two parameters:
  1. source_language: Specify this parameter to retrieve a list of target languages. By default, the API returns every source and target language pair.
  2. realtime_only: Set it to true to retrieve a list of language pairs that support real-time translation.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/trans/languages"
Output
>
{"status": 0, "languages": {"da": ["en", "fi", "no", "sv"], "en": ["ar", "cs", "da", "de", "el", "es", "es-419", "fi", "fr", "he", "hu", "id", "it", "ja", "ko", "ms", "my", "my-zawgyi", "nl", "no", "pl", "pt", "pt-BR", "ro", "ru", "sv", "th", "tr", "vi", "zh-Hans", "zh-Hant"], "fi": ["da", "en", "no", "sv"], "fr": ["en"], "ko": ["en", "ja", "th", "zh-Hans"], "nl": ["en"], "no": ["da", "en", "fi", "sv"], "sv": ["da", "en", "fi", "no"], "th": ["en"], "zh-Hant": ["en"], "zh-Hans": ["en"], "es": ["en"], "ar": ["en"]}}
Terminal
$
curl -X GET "https://api.xl8.ai/v1/trans/languages?realtime_only=true"
Output
>
{"status": 0, "languages": {"ko": ["en", "ja", "zh-Hans"], "en": ["ar", "cs", "da", "de", "el", "es", "es-419", "fi", "fr", "he", "hu", "id", "it", "ja", "ko", "ms", "nl", "no", "pl", "pt", "pt-BR", "ro", "ru", "sv", "th", "tr", "vi", "zh-Hans", "zh-Hant"], "zh-Hans": ["en"], "th": ["en"], "zh-Hant": ["en"], "es": ["en"], "ar": ["en"]}}
Terminal
$
curl -X GET "https://api.xl8.ai/v1/trans/languages?source_language=en"
Output
>
{"status": 0, "languages": {"en": ["ar", "cs", "da", "de", "el", "es", "es-419", "fi", "fr", "he", "hu", "id", "it", "ja", "ko", "ms", "my", "my-zawgyi", "nl", "no", "pl", "pt", "pt-BR", "ro", "ru", "sv", "th", "tr", "vi", "zh-Hans", "zh-Hant"]}}

Options

Some language pairs provide additional options, such as genre and formality. Use this API to get the lists of supported option values for a given language pair. If the list is empty, it indicates that the language pair does not support the option.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/trans/languages/options/en/ko"
Output
>
{"status": 0, "formality": ["HAPSYO", "HAO", "HAEYO", "HAGAE", "HAE", "HAERA", "OTHER"], "genre": []}

Requesting Translations

Use this API to request a translation for a list of sentences. This API is asynchronous and returns a request_id, with which you can query your request's status and translation results. You can also pass a callback URL if you'd like to be notified when the translation status is updated. This API requires an API key.
Example
Terminal
$
curl -X POST 'https://api.xl8.ai/v1/trans/request' --header 'Content-Type: application/json' --header 'Authorization: Bearer <API_KEY>' --data-raw '{"source_language": "en", "target_language": "ko", "sentences": ["Accelerate your Translation with XL8.", "We believe that technology is key to building a better, more prosperous world and new efficient business models for all.", "Here is by far the most humane machine translation."]}'
Output
>
{"status": 0, "request_id": "4e2d83f8b9aabbccddeeff0123456789"}

Retrieving Translation Results

Use this API to retrieve the status and the translation results after requesting a translation. The result contains status , which will be one of the following values: -1 (initializing), 0 (processing), 1 (successful), 2 (error), or 3 (partial error). If successful, the result will contain the translated sentences in the sentences field. You may also download the result using the URL in the download_url field. This API requires an API key.
Example
Terminal
$
curl -X GET 'https://api.xl8.ai/v1/trans/requests/4e2d83f8b9aabbccddeeff0123456789' --header 'Authorization: Bearer <API_KEY>'
Output
>
{"status": 1, "request_id": "4e2d83f8b9aabbccddeeff0123456789", "sentences": ["XL8로 번역을 가속하십시오", "우리는 기술이 더 발전하고 더 번영하는 세계와 모두를 위한 효율적인 새 비즈니스 모델을 만드는 데 핵심이라고 믿습니다", "이게 가장 인간적인 기계 번역입니다"], "alternate_sentences": {}, "download_url": "...", "source_language": "en", "target_language": "ko", "created_at": "2021-11-15T11:00:00.000000Z", "client_context": {}}

Real-time Translations

The real-time translation API immediately returns the translated sentences in its result, instead of translating it asynchronously. Not every language pair supports the real-time translation, so please refer to/v1/trans/languages?realtime_only=true API's result to see the supported language pairs. It can take up to 2000 characters per request. This requires an API key.
Example
Terminal
$
curl -X POST 'https://api.xl8.ai/v1/trans/request/rt' --header 'Authorization: Bearer <API_KEY>' --header 'Content-Type: application/json' --data-raw '{"source_language": "en", "target_language": "ko", "sentences": ["The quick brown fox jumps over the lazy dog."], "options":{"formality":["HAEYO"]}}'
Output
>
{"status": 1, "sentences": ["날쌘 갈색 여우가 게으른 개를 뛰어넘네요"]}

File Translation

Supported languages

Before requesting a text/file translation or a file translation, use the /v1/trans/languages API to get a list of supported language pairs. The result contains a dictionary mapping of source language codes to arrays of target language codes.
The API accepts two parameters:
  1. source_language: Specify this parameter to retrieve a list of target languages. By default, the API returns every source and target language pair.
  2. realtime_only: Set it to true to retrieve a list of language pairs that support real-time translation.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/trans/languages"
Output
>
{"status": 0, "languages": {"da": ["en", "fi", "no", "sv"], "en": ["ar", "cs", "da", "de", "el", "es", "es-419", "fi", "fr", "he", "hu", "id", "it", "ja", "ko", "ms", "my", "my-zawgyi", "nl", "no", "pl", "pt", "pt-BR", "ro", "ru", "sv", "th", "tr", "vi", "zh-Hans", "zh-Hant"], "fi": ["da", "en", "no", "sv"], "fr": ["en"], "ko": ["en", "ja", "th", "zh-Hans"], "nl": ["en"], "no": ["da", "en", "fi", "sv"], "sv": ["da", "en", "fi", "no"], "th": ["en"], "zh-Hant": ["en"], "zh-Hans": ["en"], "es": ["en"], "ar": ["en"]}}
Terminal
$
curl -X GET "https://api.xl8.ai/v1/trans/languages?realtime_only=true"
Output
>
{"status": 0, "languages": {"ko": ["en", "ja", "zh-Hans"], "en": ["ar", "cs", "da", "de", "el", "es", "es-419", "fi", "fr", "he", "hu", "id", "it", "ja", "ko", "ms", "nl", "no", "pl", "pt", "pt-BR", "ro", "ru", "sv", "th", "tr", "vi", "zh-Hans", "zh-Hant"], "zh-Hans": ["en"], "th": ["en"], "zh-Hant": ["en"], "es": ["en"], "ar": ["en"]}}
Terminal
$
curl -X GET "https://api.xl8.ai/v1/trans/languages?source_language=en"
Output
>
{"status": 0, "languages": {"en": ["ar", "cs", "da", "de", "el", "es", "es-419", "fi", "fr", "he", "hu", "id", "it", "ja", "ko", "ms", "my", "my-zawgyi", "nl", "no", "pl", "pt", "pt-BR", "ro", "ru", "sv", "th", "tr", "vi", "zh-Hans", "zh-Hant"]}}

Options

Some language pairs provide additional options, such as genre and formality. Use this API to get the lists of supported option values for a given language pair. If the list is empty, it indicates that the language pair does not support the option.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/trans/languages/options/en/ko"
Output
>
{"status": 0, "formality": ["HAPSYO", "HAO", "HAEYO", "HAGAE", "HAE", "HAERA", "OTHER"], "genre": []}

Uploading Files

This API allows you to upload a file to translate before requesting a file translation. It will generate an S3 presigned URL, to which you can upload your file directly. Once the upload is complete, you can pass the resulted key to the file translation API below. The following example shows the process of uploading a file namedexample.json. This API requires an API key.
Example
Terminal
$
cat example.json
Output
>
{ "sentences": [ "This is an example of JSON input format.", "Sentences in this array will be translated.", "You can add more sentences into this JSON array." ] }
Terminal
$
curl -X POST "https://api.xl8.ai/v1/file/upload" -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" --data '{"filename": "example.json"}'
Output
>
{ "status": 0, "presigned_url": { "url": "https://s3.amazonaws.com/public.upload.xl8", "fields": { "key": "prod/your@email.com/2021-11-1/xshyn_example.json", "AWSAccessKeyId": "AWS_ACCESS_KEY_ID_STRING", "x-amz-security-token": "X_AMZ_SECURITY_TOKEN_STRING" "policy": "POLICY_STRING", "signature": "SIGNATURE_STRING" } } }
Terminal
$
curl -X POST "https://s3.amazonaws.com/public.upload.xl8" -F "key=prod/your@email.com/2020-11-1/xshyn_example.json" -F "AWSAccessKeyId=AWS_ACCESS_KEY_ID_STRING" -F "x-amz-security-token=X_AMZ_SECURITY_TOKEN_STRING" -F "policy=POLICY_STRING" -F "signature=SIGNATURE_STRING" -F "file=@example.json"
Once the upload is complete, you can pass the generated key ("prod/your@email.com/2021-11-1/xshyn_example.json" in this example) as the s3_key parameter to the file translation API.

File Translations

To translate a file, either pass the uploaded key from the file upload API as s3_keyparameter, or encode your file to Base64 and include it in the request body as encoded_subtitle parameter. You also need to specify the subtitle_type parameter. We support various subtitle formats, such as srt, ttml, and vtt. Refer to the API reference for the full list of supported formats. This API is asynchronous and returns a request_id, which you can pass to the same API as the text translations to retrieve your request's status and translation results. You can also pass a callback URL if you'd like to be notified when the translation status is updated. This API requires an API key.
Example
Terminal
$
curl -X POST "https://api.xl8.ai/v1/trans/request/file" --header 'Authorization: Bearer <API_KEY>' --header 'Content-Type: application/json' --data-raw '{"source_language":"en", "target_language":"ko", "subtitle_type":"json", "s3_key":"your\/email.com\/2021-11-15/cgeyw_example.json","options":{"formality":["HAEYO"]}}'
Output
>
{"status": 0, "request_id": "4e2d83f8b9aabbccddeeff0123456789"}
Terminal
$
curl -X POST "https://api.xl8.ai/v1/trans/request/file" --header 'Authorization: Bearer <API_KEY>' --header 'Content-Type: application/json' --data-raw '{"source_language":"en", "target_language":"ko", "subtitle_type":"json", "encoded_subtitle": "'"$(cat example.json | base64)"'"}'
Output
>
{"status": 0, "request_id": "4e2d83f8b9aabbccddeeff0123456789"}

Retrieving Translated Files

Use this API to download the translated results in subtitle formats you want. It outputs a file in the specified subtitle format, encoded to Base64. You can also use /v1/trans/requests/:request_id API to retrieve the request's status and related information. This API requires an API key.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/trans/requests/file/4e2d83f8b9aabbccddeeff0123456789?subtitle_type=srt" --header "Authorization: Bearer <API_KEY>"
Output
>
{"status": 1, "encoded_subtitle": "...."}

Create New Glossary

The glossary feature allows you to specify translations for words and phrases, and for now, this glossary feature is available only in the file translation. To use the glossary feature, you need to prepare a glossary CSV file. The CSV file requires three columns without the header. You need to add the term which should be replaced (source text) to the first column, and add your preferred way of translation (target text) to the second column. The third column indicates the case sensitive or the case insensitive. This case sensitivity option value would be "cs" for the case-sensitive case and "ci" for the case-insensitive case. This API requires an API key.
Example
Terminal
$
cat glossary.csv
Output
>
Spider Man,Spider Man,cs
Terminal
$
curl -X POST "https://api.xl8.ai/v1/file/upload" -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" --data '{"filename": "glossary.csv"}'
Output
>
{ "status": 0, "presigned_url": { "url": "https://s3.amazonaws.com/public.upload.xl8", "fields": { "key": "prod/your@email.com/2022-3-8/munvj_glossary.csv", "AWSAccessKeyId": "AWS_ACCESS_KEY_ID_STRING", "x-amz-security-token": "X_AMZ_SECURITY_TOKEN_STRING" "policy": "POLICY_STRING", "signature": "SIGNATURE_STRING" } } }
Terminal
$
curl -X POST "https://api.xl8.ai/v1/glossary" -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" --data '{"name": "en-kr-glossary", "source_language":"en", "target_language":"ko", "s3_path": "prod/your@email.com/2022-3-8/munvj_glossary.csv" }'
Output
>
{"status": 0, "glossary_id": 200}

List All Glossaries

Use this API to get the list of glossaries. You will get each glossary's name, source_language, target_language, download_url and glossary_id. You need to pass glossary_id to the file translation request to apply the given glossary. This requires an API key.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/glossary" --header "Authorization: Bearer <API_KEY>"
Output
>
{"status": 0, "glossaries": [{"glossary_id": 200, "name": "en-kr-glossary", "source_language": "en", "target_language": "ko", "download_url": "..." }]}

Use glossary

To use the glossary in the file translation request, pass the glossary_id to theglossary_idparameter of the file translation request.
Example
Terminal
$
curl -X POST "https://api.xl8.ai/v1/trans/request/file" --header 'Authorization: Bearer <API_KEY>' --header 'Content-Type: application/json' --data-raw '{"glossary_id":"200", "source_language":"en", "target_language":"ko", "subtitle_type":"json", "encoded_subtitle": "'"$(cat example.json | base64)"'"}'
Output
>
{"status": 0, "request_id": "5k2d83f8b9aabb..."}

Sync

Supported languages for Sync

This API retrieves the list of languages supported by Sync.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/autotemplate/languages" --header 'Authorization: Bearer <API_KEY>'
Output
>
{"status": 0, "languages": ["en-US", "ko-KR", "ar-SA", "de-DE", "es-ES", "fr-FR", "it-IT", "ja-JP", "nl-NL", "zh", "zh-TW"]}

Requesting Auto Subtitling

This API creates a request to generate a subtitle of a video via Sync. Before making a request, upload your video and transcript files to /v1/file/upload API. A transcript file is optional and it should be a simple text file where each line contains a speaker name and a sentence separated by a tab.
The API accepts following parameters:
  1. language: the language of the video to transcribe.
  2. media_s3_key: the key of the video file you have uploaded.
  3. transcript_s3_key: (optional) the key of the transcript file you have uploaded.
The API returns a request_id, with which you can retrieve the request's status and download the generated subtitle. Optionally, you can pass a callback URL and be notified when the request status changes. This API requires an API key.
Example
Terminal
$
curl -X POST "https://api.xl8.ai/v1/file/upload" -H "Content-Type: application/json" -H "Authorization: Bearer <API_KEY>" --data '{"filename": "video.mp4"}'
Output
>
{ "status": 0, "presigned_url": { "url": "https://s3.amazonaws.com/public.upload.xl8", "fields": { "key": "prod/your@email.com/2021-11-1/nimou_video.mp4", "AWSAccessKeyId": "AWS_ACCESS_KEY_ID_STRING", "x-amz-security-token": "X_AMZ_SECURITY_TOKEN_STRING" "policy": "POLICY_STRING", "signature": "SIGNATURE_STRING" } } }
Terminal
$
curl -F "key=prod/your@email.com/2021-11-1/nimou_video.mp4" -F "AWSAccessKeyId=AWS_ACCESS_KEY_ID_STRING" -F "x-amz-security-token=X_AMZ_SECURITY_TOKEN_STRING" -F "policy=POLICY_STRING" -F "signature=SIGNATURE_STRING" -F "file=@video.mp4" https://s3.amazonaws.com/public.upload.xl8
Terminal
$
curl -X POST "https://api.xl8.ai/v1/autotemplate/request" --header 'Authorization: Bearer <API_KEY>' --header 'Content-Type: application/json' --data-raw '{"language":"en", "media_s3_key":"prod/your@email.com/2021-11-1/nimou_video.mp4"}'
Output
>
{"status": 0, "request_id": "e05aadf8b9aabbccddeeff0123456789"}

Retrieving Status

Use this API to retrieve the status of your auto-subtitling request. The result contains status , which will be one of the following values: -1 (initializing), 0 (processing), 1 (succeesful), 2 (error), or 3 (partial error). This API requires an API key.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/autotemplate/requests/e05aadf8b9aabbccddeeff0123456789" --header "Authorization: Bearer <API_KEY>"
Output
>
{"status": 1, "request_id": "e05aadf8b9aabbccddeeff0123456789", "callback_url": null, "media_filename": "video.mp4", "transcript_filename": "", "media_duration": 36.37, "language": "en", "created_at": "2021-11-16T07:06:07.357368Z", "updated_at": "2021-11-16T07:11:42.442996Z", "error_msg": null}

Downloading Subtitles

Once your Sync request is complete, use this API to download the resulted subtitle. Supported file formats include srt, ttml, vtt, xif, json and more. Please refer to the API reference for advanced options, such as maximum number of characters per line. The response contains the subtitle file encoded to Base64 in encoded_subtitle field. This API requires an API key.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/autotemplate/request/file/srt/e05aadf8b9aabbccddeeff0123456789" --header "Authorization: Bearer <API_KEY>"
Output
>
{"status": 0, "encoded_subtitle": "MQ0KMDA6MDA6MDAsMDAwIC0tPiAwMDowMDowMiwwMDANCk1lZXQgeGw4IHNjcm9s..."}

Dubbing

Supported languages for Dubbing

This API retrieves the list of languages supported in the Dubbing task, and the available voices for each language. The output also contains a URL to sample MP3 audio for each voice.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/dubbing/languages" --header 'Authorization: Bearer <API_KEY>'
Output
>
{"status": 0, "voices": {"en-US": [{"voice_name": "en-US-F001", "display_name": "Female 1", "gender": "Female", "sample_url": "https://static.xl8.ai/voices/en-US/en-US-F001.mp3"}, {"voice_name": "en-US-M001", "display_name": "Male 1", "gender": "Male", "sample_url": "https://static.xl8.ai/voices/en-US/en-US-M001.mp3"}]}}

Request Dubbing

This API creates a request to dub a video using the synchronized subtitle in the requested language. Use /v1/file/upload API to upload your media file and subtitle file first, and pass their keys to this API with the language and voice you want to use.
The API accepts following parameters:
  1. language: the language code of your subtitle.
  2. voice_name: the voice name. (e.g. "en-US-F001")
  3. subtitle_s3_key: the key of subtitle file you have uploaded.
  4. subtitle_type: the subtitle format you have uploaded, such as srt, ttml or vtt. Refer to the API reference for the full list of supported formats.
  5. media_s3_key: the key of media file you have uploaded. The mp4 file is preferred. If not supplied, only the audio file will be generated.
By default, the synthesized audio will be overlayed on the original audio track. You can adjust the original audio track's volume with original_audio_gain parameter. If you would like to return only the synthesized voice, set dubbing_type parameter to "dubbing". The API returns a request_id, with which you can retrieve the request's status and get the generated stream's URL. Optionally, you can pass a callback URL and be notified when the request status changes. This API requires an API key.
Example
This example assumes you have uploaded the media and subtitle files and have their keys.
Terminal
$
curl -X POST "https://api.xl8.ai/v1/dubbing/request" --header 'Authorization: Bearer <API_KEY>' --header 'Content-Type: application/json' --data-raw '{"language":"en-US", "voice_name":"en-US-F001", "subtitle_s3_key":"your@email.com/2022-05-18/cgeyw_video.en.srt", "subtitle_type":"srt", "media_s3_key":"your@email.com/2022-05-18/qozkz_video.mp4"}'
Output
>
{"status": 0, "request_id": "d720cd43569143b596ea0fce12345678"}

Retrieving Status

Use this API to retrieve the status of your dubbing request. The result contains status , which will be one of the following values: -1 (initializing), 0 (processing), 1 (successful), 2 (error), or 3 (partial error). This API requires an API key.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/dubbing/requests/d720cd43569143b596ea0fce12345678" --header "Authorization: Bearer <API_KEY>"
Output
>
{"status": 1, "request_id": "d720cd43569143b596ea0fce12345678", "created_at": "2022-05-18T11:45:48.833605Z", "updated_at": "2022-05-18T11:47:08.339090Z", "callback_url": "", "error_msg": "", "language": "en-US", "voice_name": "en-US-F001", "subtitle_s3_key": "your@email.com/2022-05-18/cgeyw_video.en.srt", "subtitle_type": "srt", "media_s3_key": "your@email.com/2022-05-18/qozkz_video.mp4", "dubbing_type": "VoiceOver", "options": {"original_audio_gain": "-9"}, "char_count": 183, "total_seconds": 11160, "result_audio_file_name": "cgeyw_video.en.mp3", "result_media_file_name": "cgeyw_video.en.VO.mp4", "subtitle_file_name": "video.en.srt", "media_file_name": "video.mp4"}

Downloading Results

Call this API to download the results from a successful dubbing request. The output contains a link to download the generated audio file or media file. This API requires an API key.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/dubbing/requests/d720cd43569143b596ea0fce12345678/download" --header "Authorization: Bearer <API_KEY>"
Output
>
{"status": 0, "request_id": "d720cd43569143b596ea0fce12345678", "audio_download_url": "https://...", "media_download_url": "https://..."}

LiveSubs

Supported languages for LiveSubs

This API retrieves the list of language pairs supported by Live Subs.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/e2e/languages" --header 'Authorization: Bearer <API_KEY>'
Output
>
{"status": 0, "languages": { "en": [ "es-419", "ko" ], "ko": [ "en" ]}}

Requesting Live Translation

This API creates a request to translate a live video stream. Live Subs takes HLS and RTMP sources as inputs, and returns a HLS stream URL with embedded WebVTT subtitles. If you have your own RTMP server, LiveSubs can also push the video stream, with burned-in subtitles, to your RTMP server's publish URL.
The API accepts following parameters:
  1. source_language: the language code of the source video stream to translate.
  2. target_languages: a list of language codes in which to add subtitles.
  3. original_endpoint: The live stream URL. An HTTP/HTTPS URL of the HLS master playlist or an RTMP url.
  4. target_protocol: The protocol of the output stream, "hls" or "rtmp". The default is hls.
  5. target_endpoint: Specify the publish URL of your RTMP server only, when target_protocol is set to rtmp.
  6. max_running_time_in_sec: The stream will shut down after specified time to avoid a request running longer than required. The default value is 5 hours.
The API returns a request_id, used to retrieve the request's status and get the generated stream's URL. It takes a few minutes to prepare the server and buffer the stream for stability. Optionally, you can pass a callback URL and be notified when the request status changes. This API requires an API key.
Example
Terminal
$
curl -X POST "https://api.xl8.ai/v1/e2e/hlslive/request" --header 'Authorization: Bearer <API_KEY>' --header 'Content-Type: application/json' --data-raw '{"source_language":"en", "target_languages":["ko"], "original_endpoint": "https://foo.bar/live/master.m3u8"}'
Output
>
{"status": 0, "request_id": "099f43824a73453faf102e112345678"}

Retrieving Status

Use this API to retrieve the status of your LiveSubs request. The result contains status , which will be one of the following values: -1 (initializing), 0 (running), 1 (stopped), 2 (error), or 3 (partial error). This API requires an API key.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/e2e/hlslive/requests/099f43824a73453faf102e112345678" --header "Authorization: Bearer <API_KEY>"
Output
>
{"status": 0, "request_id": "e05aadf8b9aabbccddeeff0123456789", "source_languages": ["en"], "target_languages": ["ko"], "original_endpoint": "https://foo.bar/live/master.m3u8", "target_protocol": "hls", "target_endpoint": "https://static.xl8.ai/hls/example/e05aadf8b9aabbccddeeff0123456789/master.m3u8", "total_running_time_in_sec": 552, "max_running_time_in_sec": 18000, "start_countdown_in_sec": 0, "created_at": "2022-05-13T05:17:05.290865Z", "updated_at": "2022-05-13T05:27:40.943424Z", "started_at": "2022-05-13T05:18:36.863627Z", "stopped_at": null, "error_msg": ""}

Stopping Stream

Call this API to stop the request once your live event is over. The request will stop automatically if your stream is aborted or reaches the maximum running time. This API requires an API key.
Example
Terminal
$
curl -X GET "https://api.xl8.ai/v1/dubbing/requests/d720cd43569143b596ea0fce12345678/download" --header "Authorization: Bearer <API_KEY>"
Output
>
{"status": 0, "request_id": "d720cd43569143b596ea0fce12345678", "audio_download_url": "https://...", "media_download_url": "https://..."}