# 1. upload an audio or video file by link
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/interview.mp3", "name": "interview"}'
# 2. create the project - speech recognition starts automatically
# src_lang is optional: leave it out and the language is detected
curl -X POST https://api.rask.ai/v2/projects \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d "{\"video_id\": \"$MEDIA_ID\", \"dst_lang\": \"es-mx\"}"# Read the transcript: one object per segment
curl -s https://api.rask.ai/v2/projects/$ID/transcription -H "Authorization: Bearer $TOKEN" \
| jq '.segments[] | {speaker, start, end, text: .src.text}'



Send an audio or video file as multipart form data, or post a link from YouTube, Google Drive, S3, Vimeo or any direct URL. You get a media id and the file metadata before you spend anything.
Pass the media id as video_id and a target language. Add the source language or the number of speakers if you know them. Recognition starts immediately.
Read the transcript as soon as its segments are available, while the translated media continues processing. Download subtitle and media files when the project is complete.
# pip install git+ssh://[email protected]/braskai/rask-sdk.git@main
import asyncio
from rask_sdk import clients, enums, schemas
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/interview.mp3"))
while media.status is enums.MediaStatus.PROCESSING:
await asyncio.sleep(5)
media = await client.get_media(media_id=media.id)
# src_lang omitted: the source language is detected automatically
job = await client.create_project(data=schemas.ProjectCreate(video_id=media.id, dst_lang="es-mx"))
while job.status is not enums.ProjectStatus.MERGING_DONE:
await asyncio.sleep(10)
job = await client.get_project(project_id=job.id)
transcript = await client.get_project_transcription(project_id=job.id)
for seg in transcript.segments:
print(seg.start, seg.end, seg.speaker, seg.src.text)
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}"}
with open("interview.mp3", "rb") as f:
media = requests.post(f"{API}/api/library/v1/media", headers=h,
params={"kind": "audio"}, files={"data": f}).json()
while media["status"] == "processing":
time.sleep(5)
media = requests.get(f"{API}/api/library/v1/media/{media['id']}", headers=h).json()
pid = requests.post(f"{API}/v2/projects", headers=h, json={
"video_id": media["id"], "dst_lang": "es-mx", "num_speakers": 2}).json()["id"]
while requests.get(f"{API}/v2/projects/{pid}", headers=h).json()["status"] != "merging_done":
time.sleep(10)
# write the source transcript as an .srt file
segments = requests.get(f"{API}/v2/projects/{pid}/transcription", headers=h).json()["segments"]
with open("interview_en.srt", "w") as out:
for i, s in enumerate(segments, 1):
out.write(f"{i}\n{s['start']} --> {s['end']}\n{s['speaker']}: {s['src']['text']}\n\n")// no dependencies, Node 18+ global fetch
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());
let media = await call('POST', '/api/library/v1/media/link', { link: 'https://example.com/webinar.mp4' });
while (media.status === 'processing') { await sleep(5000); media = await call('GET', `/api/library/v1/media/${media.id}`); }
let p = await call('POST', '/v2/projects', { video_id: media.id, src_lang: 'en', dst_lang: 'de-de' });
while (p.status !== 'merging_done') { await sleep(10000); p = await call('GET', `/v2/projects/${p.id}`); }
const { segments } = await call('GET', `/v2/projects/${p.id}/transcription`);
segments.forEach((s) => console.log(`[${s.start}] ${s.speaker}: ${s.src.text}`));
console.log(p.translation_vtt_path); // German subtitles for your player# 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. upload a local audio file
MEDIA_ID=$(curl -s -X POST "https://api.rask.ai/api/library/v1/media?kind=audio" \
-H "Authorization: Bearer $TOKEN" -F "data=@podcast_episode.mp3" | jq -r .id)
# 3. create the project once the media status is ready
ID=$(curl -s -X POST https://api.rask.ai/v2/projects \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d "{\"video_id\": \"$MEDIA_ID\", \"dst_lang\": \"fr-fr\"}" | jq -r .id)
# 4. when status is merging_done, read the transcript with speaker labels
curl -s https://api.rask.ai/v2/projects/$ID/transcription -H "Authorization: Bearer $TOKEN" \
| jq -r '.segments[] | "\(.start) \(.speaker): \(.src.text)"'<?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']];
$media = $json($http->post('/api/library/v1/media/link', ['headers' => $h, 'json' => [
'link' => 'https://example.com/interview.mp3']]));
while ($media['status'] === 'processing') {
sleep(5);
$media = $json($http->get("/api/library/v1/media/{$media['id']}", ['headers' => $h]));
}
$p = $json($http->post('/v2/projects', ['headers' => $h, 'json' => [
'video_id' => $media['id'], 'dst_lang' => 'es-mx']]));
while ($p['status'] !== 'merging_done') {
sleep(10);
$p = $json($http->get("/v2/projects/{$p['id']}", ['headers' => $h]));
}
$t = $json($http->get("/v2/projects/{$p['id']}/transcription", ['headers' => $h]));
foreach ($t['segments'] as $s) {
echo $s['start'], ' ', $s['speaker'], ': ', $s['src']['text'], PHP_EOL;
}{"segments": [
{"speaker": "SPEAKER_00", "start": "00:00:00,320", "end": "00:00:07,316", "status": "done",
"src": {"text": "Thanks for joining us. Let's start with the new release.", "lang": "en"},
"dst": {"text": "Gracias por acompañarnos. Empecemos con la nueva versión.", "lang": "es-mx"}},
{"speaker": "SPEAKER_01", "start": "00:00:07,640", "end": "00:00:11,900", "status": "done",
"src": {"text": "Sure. The biggest change is the reporting view.", "lang": "en"},
"dst": {"text": "Claro. El cambio más grande es la vista de reportes.", "lang": "es-mx"}}
]}

es-mx and es-es alike. The project records glossary_version, so later edits never silently change finished work.Yes. Speech recognition is the first stage of every Rask project. Upload audio or video, create a project, and read the transcript as segments with speaker labels and timestamps from GET /v2/projects/{id}/transcription. The same project translates the transcript and returns subtitles and dubbed audio.
The API accepts 75 source languages. Leave src_lang empty and the language is detected automatically, or pass a two-letter code such as en or de. The transcript can be translated into 135+ language and regional options.
Yes. Upload audio files in MP3, WAV, FLAC or M4A, such as podcasts, interviews and recorded calls, and the project transcribes them the same way as video.
Yes. Different speakers are detected automatically, and each segment carries a speaker label in SPEAKER_XX format. Pass num_speakers if you know the count, and correct the speaker of any segment through the API.
No. Timestamps are segment-level: each segment has a start and an end time in HH:MM:SS,mmm format. That is the timing captions and subtitles use. If you need a timestamp for every word, choose a dedicated speech to text API.
No. Rask transcribes complete, pre-recorded audio and video. For real time captions, voice agents, conversational AI and contact centers, where text has to arrive while a person is still speaking, a streaming speech to text API is the better fit.
Accuracy depends on the audio: microphones, accents, overlapping speech and background noise all matter. Test the API on a sample of your own recordings, and correct any segment through the API before you publish or translate it.
Recognition does not take a custom vocabulary list. Correct specific words in the transcript through the segments endpoint. When the transcript is translated, a glossary keeps product names, proper nouns and domain terms consistent.
The finished project includes subtitle files in SRT and VTT in the target language. The source language transcript comes as JSON segments with start and end times, which convert to SRT in a few lines of code.
Yes. On plans with transcript import, provide an existing source transcript, an approved target-language translation, or both as SRT files or timed text segments when creating the project. Rask can translate your source script or use your approved translation for dubbing.
Projects are billed per minute of audio or video, rounded up to the next whole minute, from the same minutes pool as the Rask app. The price includes transcription, translation, voiceover and subtitles. Additional minutes cost $3/min on eligible standard plans. Enterprise pricing is tailored to your agreement. If you only need a transcript, a dedicated speech to text API costs less.
Start with a free trial in the Rask app, no card required, to test transcription and translation on your own files. API access is available on Creator Pro, Business and Enterprise plans, with capabilities determined by your plan.
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.