# 1. upload the video once - YouTube, Drive, S3, Vimeo or direct URL
curl -X POST https://api.rask.ai/api/library/v1/media/link \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"link": "https://example.com/onboarding.mp4", "name": "onboarding"}'
# 2. one project per subtitle language
for lang in es-mx fr-fr ja-jp; do
curl -X POST https://api.rask.ai/v2/projects \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d "{\"video_id\": \"$VIDEO_ID\", \"dst_lang\": \"$lang\"}"
done# When status is merging_done, download both subtitle files
P=$(curl -s https://api.rask.ai/v2/projects/$ID -H "Authorization: Bearer $TOKEN")
curl -s -o onboarding.es-mx.srt "$(echo $P | jq -r .translation_srt_path)"
curl -s -o onboarding.es-mx.vtt "$(echo $P | jq -r .translation_vtt_path)"



Send the video as a file, or post a link from YouTube, Google Drive, S3, Vimeo or any direct URL. One upload serves every subtitle language.
Pass the media id as video_id and one target language per project. Projects for different languages run in parallel.
Read status until it reaches merging_done, then download the .srt and .vtt files and store them on your side.
# pip install git+ssh://[email protected]/braskai/rask-sdk.git@main
import asyncio, urllib.request
from rask_sdk import clients, enums, schemas
LANGS = ["es-mx", "fr-fr", "ja-jp"]
async def subtitle(client, video_id, lang):
job = await client.create_project(data=schemas.ProjectCreate(video_id=video_id, dst_lang=lang))
while job.status is not enums.ProjectStatus.MERGING_DONE:
await asyncio.sleep(10)
job = await client.get_project(project_id=job.id)
# links are presigned for one hour - save the files right away
urllib.request.urlretrieve(job.translation_srt_path, f"video.{lang}.srt")
urllib.request.urlretrieve(job.translation_vtt_path, f"video.{lang}.vtt")
async def main():
client = clients.RaskSDKClient(client_id=CLIENT_ID, client_secret=CLIENT_SECRET)
media = await client.create_media_link(data=schemas.MediaCreateLink(link="https://example.com/onboarding.mp4"))
while media.status is enums.MediaStatus.PROCESSING:
await asyncio.sleep(5)
media = await client.get_media(media_id=media.id)
await asyncio.gather(*(subtitle(client, media.id, l) for l in LANGS))
asyncio.run(main())import time, requests
AUTH = "https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token"
API = "https://api.rask.ai"
token = requests.post(AUTH, auth=(CLIENT_ID, CLIENT_SECRET),
data={"grant_type": "client_credentials"}).json()["access_token"]
h = {"Authorization": f"Bearer {token}"}
pid = requests.post(f"{API}/v2/projects", headers=h,
json={"video_id": VIDEO_ID, "dst_lang": "de-de"}).json()["id"]
while (p := requests.get(f"{API}/v2/projects/{pid}", headers=h).json())["status"] != "merging_done":
time.sleep(10)
# translated subtitles: download the files
open("video.de-de.vtt", "wb").write(requests.get(p["translation_vtt_path"]).content)
# original-language captions: build a WebVTT file from the transcript segments
segs = requests.get(f"{API}/v2/projects/{pid}/transcription", headers=h).json()["segments"]
cues = [f"{s['start'].replace(',', '.')} --> {s['end'].replace(',', '.')}\n{s['src']['text']}" for s in segs]
open("video.en.vtt", "w").write("WEBVTT\n\n" + "\n\n".join(cues) + "\n")// no dependencies, Node 18+ global fetch
import { writeFile } from 'node:fs/promises';
const API = 'https://api.rask.ai';
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
const auth = await fetch('https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token', {
method: 'POST',
headers: { Authorization: 'Basic ' + btoa(`${CLIENT_ID}:${CLIENT_SECRET}`) },
body: new URLSearchParams({ grant_type: 'client_credentials' }),
}).then((r) => r.json());
const h = { Authorization: `Bearer ${auth.access_token}`, 'Content-Type': 'application/json' };
const call = (method, path, body) => fetch(API + path, { method, headers: h, body: body && JSON.stringify(body) }).then((r) => r.json());
const langs = ['es-mx', 'pt-br', 'ko-kr'];
const tracks = await Promise.all(langs.map(async (dst_lang) => {
let p = await call('POST', '/v2/projects', { video_id: VIDEO_ID, dst_lang });
while (p.status !== 'merging_done') { await sleep(10000); p = await call('GET', `/v2/projects/${p.id}`); }
const file = `subs/${dst_lang}.vtt`;
await writeFile(file, await ((await fetch(p.translation_vtt_path)).text()));
return `<track kind="subtitles" srclang="${dst_lang}" src="/${file}">`;
}));
console.log(tracks.join('\n')); // paste inside your <video> element# 1. token (valid 1 hour - cache and reuse it)
TOKEN=$(curl -s -X POST https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token \
-u "$CLIENT_ID:$CLIENT_SECRET" -d "grant_type=client_credentials" | jq -r .access_token)
# 2. create the project for one subtitle language
ID=$(curl -s -X POST https://api.rask.ai/v2/projects \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d "{\"video_id\": \"$VIDEO_ID\", \"dst_lang\": \"it-it\"}" | jq -r .id)
# 3. wait for merging_done
until [ "$(curl -s https://api.rask.ai/v2/projects/$ID -H "Authorization: Bearer $TOKEN" | jq -r .status)" = merging_done ]; do
sleep 10
done
# 4. save both subtitle files
P=$(curl -s https://api.rask.ai/v2/projects/$ID -H "Authorization: Bearer $TOKEN")
curl -s -o video.it-it.srt "$(echo $P | jq -r .translation_srt_path)"
curl -s -o video.it-it.vtt "$(echo $P | jq -r .translation_vtt_path)"<?php
use GuzzleHttp\Client;
$http = new Client(['base_uri' => 'https://api.rask.ai']);
$json = fn($r) => json_decode($r->getBody(), true);
$auth = $json((new Client)->post('https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token',
['auth' => [$clientId, $clientSecret], 'form_params' => ['grant_type' => 'client_credentials']]));
$h = ['Authorization' => 'Bearer ' . $auth['access_token']];
foreach (['es-mx', 'tr-tr'] as $lang) {
$p = $json($http->post('/v2/projects', ['headers' => $h, 'json' => [
'video_id' => $videoId, 'dst_lang' => $lang]]));
while ($p['status'] !== 'merging_done') {
sleep(10);
$p = $json($http->get("/v2/projects/{$p['id']}", ['headers' => $h]));
}
// presigned links, valid for one hour
file_put_contents("video.$lang.srt", file_get_contents($p['translation_srt_path']));
file_put_contents("video.$lang.vtt", file_get_contents($p['translation_vtt_path']));
} 0s created
11s transcription_started
87s translation_started
99s voiceover_started
154s merging_started
165s merging_done

es-mx and es-es alike. The project records glossary_version, so later edits never silently change finished work.Yes. Every Rask project returns subtitle files in SRT and WebVTT in the target language. Upload a video, create a project for each subtitle language, and download the files when the project is complete.
Two formats for every project: an SRT file and a WebVTT (VTT) file in the target language. The transcript is also available as JSON segments with timestamps, if your platform needs another caption format.
The subtitle files are in the target language. For captions in the original language, read the transcript segments: each one has the source text with a start and an end time, which converts to an SRT or VTT file in a few lines of code.
Subtitles are available in 135+ language and regional options, such as es-mx, pt-br and fr-ca, from 75 source languages. Each project takes one target language; create a project per language from the same upload.
Not yet. The API returns subtitle files for your player or video editing software. To get a video with subtitles burned in, use the Rask web app.
The files contain text and timing. Font, size, color and position are set in your video player, app or editing software, which keeps one subtitle file usable everywhere.
The files contain the spoken dialogue. Descriptions of music and sound effects for deaf and hard of hearing viewers are not generated automatically; add them in your own caption editing step.
Each transcript segment carries a speaker label in SPEAKER_XX format, so you can add speaker names when you build captions for interviews and dialogue.
Patch the text or timing of the segment through the API and regenerate the project. The subtitle files are updated together with the dubbed version. Regeneration is billed on the changed segments, with a one-minute minimum per run.
Download links are presigned and valid for one hour. Save the files to your own storage, or fetch the project again to get new links.
Yes. On plans with transcript import, upload source-language subtitles, an approved target-language SRT, or both when creating the project. Use existing captions as the source, or keep your approved translation for the target-language subtitles and dubbing.
Projects are billed per minute of video, rounded up to the next whole minute, from the same minutes pool as the Rask app. The price includes transcription, translation, subtitles and the dubbed version. Additional minutes cost $3/min on eligible standard plans. Enterprise pricing is tailored to your agreement.
API access is available on Creator Pro, Business and Enterprise plans, with capabilities determined by your plan. You generate your client id and secret in the app and start calling immediately. Enterprise terms, volume pricing and custom language coverage go through our team.