# 1. import the video
curl -X POST https://api.rask.ai/v3/media/import \
-H "Authorization: Bearer $RASK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://youtu.be/..."}'
# 2. the price first - free, and it changes nothing
curl -X POST https://api.rask.ai/v3/projects/estimate \
-H "Authorization: Bearer $RASK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"media_id": "...", "target_language": "de-de"}'
# 3. create the project - the price you accepted is the ceiling
curl -X POST https://api.rask.ai/v3/projects \
-H "Authorization: Bearer $RASK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"media_id": "...",
"target_language": "de-de",
"expected_cost_minutes": 12
}'# Wait on the job instead of polling: one request, up to 20 seconds.
curl -s "https://api.rask.ai/v3/jobs/$JOB_ID?wait_seconds=20" \
-H "Authorization: Bearer $RASK_API_KEY" | jq .status動画ファイルを送信するか、YouTube、Google Drive、S3、Vimeoのリンク、または動画の直接URLを送信します。1回のアップロードで、すべての対象言語の字幕を作成できます。
プロジェクトごとにmedia_idと対象言語を1つ指定します。言語の異なるプロジェクトは並行して実行されます。
ジョブが正常に完了したら、GET /v3/projects/{project_id}/subtitlesで字幕を.srtまたは.vtt形式で出力し、ご利用の環境に保存します。
# pip install rask-sdk
from rask_sdk import Rask
rask = Rask() # reads RASK_API_KEY
uploaded = rask.jobs.wait(rask.uploads.upload_file("webinar.mp4").id)
media_id = uploaded.result.media_id
# the price first - free, and it changes nothing
estimate = rask.projects.estimate_project(
media_id=media_id, target_language="de-de"
)
# the price you accepted is the ceiling
created = rask.projects.create_project(
media_id=media_id,
target_language="de-de",
expected_cost_minutes=estimate.total_minutes,
)
processed = rask.jobs.wait(created.id)
# the .srt and .vtt files are among the project outputs
for o in rask.exports.list_project_outputs(processed.result.project_id).data:
print(o.kind, o.url)import os, requests
API = "https://api.rask.ai/v3"
h = {"Authorization": f"Bearer {os.environ['RASK_API_KEY']}"}
job = requests.post(f"{API}/media/import", headers=h,
json={"url": "https://youtu.be/..."}).json()
media_id = requests.get(f"{API}/jobs/{job['id']}?wait_seconds=20",
headers=h).json()["result"]["media_id"]
order = {"media_id": media_id, "target_language": "de-de"}
# the price first - free, and it changes nothing
estimate = requests.post(f"{API}/projects/estimate", headers=h, json=order).json()
# the price you accepted is the ceiling
project = requests.post(f"{API}/projects", headers=h,
json={**order,
"expected_cost_minutes": estimate["total_minutes"]}).json()
# the .srt and .vtt files are among the project outputs
outputs = requests.get(f"{API}/projects/{project['project_id']}/outputs",
headers=h).json()
for o in outputs["data"]:
print(o["kind"], o["url"])// no dependencies, Node 18+ global fetch
const API = 'https://api.rask.ai/v3';
const h = {
Authorization: `Bearer ${process.env.RASK_API_KEY}`,
'Content-Type': 'application/json',
};
const imported = await fetch(`${API}/media/import`, {
method: 'POST', headers: h,
body: JSON.stringify({ url: 'https://youtu.be/...' }),
}).then(r => r.json());
const job = await fetch(`${API}/jobs/${imported.id}?wait_seconds=20`, { headers: h })
.then(r => r.json());
const order = { media_id: job.result.media_id, target_language: 'de-de' };
// the price first - free, and it changes nothing
const estimate = await fetch(`${API}/projects/estimate`, {
method: 'POST', headers: h, body: JSON.stringify(order),
}).then(r => r.json());
// the price you accepted is the ceiling
const project = await fetch(`${API}/projects`, {
method: 'POST', headers: h,
body: JSON.stringify({ ...order, expected_cost_minutes: estimate.total_minutes }),
}).then(r => r.json());
// the .srt and .vtt files are among the project outputs
const outputs = await fetch(`${API}/projects/${project.project_id}/outputs`, { headers: h })
.then(r => r.json());
outputs.data.forEach(o => console.log(o.kind, o.url));API=https://api.rask.ai/v3
AUTH="Authorization: Bearer $RASK_API_KEY"
JSON="Content-Type: application/json"
# 1. import the video, then wait for the media id
JOB=$(curl -s -X POST $API/media/import -H "$AUTH" -H "$JSON" \
-d '{"url": "https://youtu.be/..."}' | jq -r .id)
MEDIA=$(curl -s "$API/jobs/$JOB?wait_seconds=20" -H "$AUTH" | jq -r .result.media_id)
ORDER="{\"media_id\":\"$MEDIA\",\"target_language\":\"de-de\"}"
# 2. the price first - free, and it changes nothing
CAP=$(curl -s -X POST $API/projects/estimate -H "$AUTH" -H "$JSON" \
-d "$ORDER" | jq -r .total_minutes)
# 3. the price you accepted is the ceiling
ID=$(curl -s -X POST $API/projects -H "$AUTH" -H "$JSON" \
-d "$(jq -c --argjson cap "$CAP" '. + {expected_cost_minutes:$cap}' <<<"$ORDER")" \
| jq -r .project_id)
# 4. collect the .srt and .vtt files
curl -s $API/projects/$ID/outputs -H "$AUTH" \
| jq -r '.data[] | "\(.kind)\t\(.url)"'<?php
use GuzzleHttp\Client;
$http = new Client([
'base_uri' => 'https://api.rask.ai/v3/',
'headers' => ['Authorization' => 'Bearer ' . getenv('RASK_API_KEY')],
]);
$job = json_decode($http->post('media/import',
['json' => ['url' => 'https://youtu.be/...']])->getBody(), true);
$media = json_decode($http->get("jobs/{$job['id']}?wait_seconds=20")->getBody(), true);
$order = ['media_id' => $media['result']['media_id'], 'target_language' => 'de-de'];
// the price first - free, and it changes nothing
$estimate = json_decode($http->post('projects/estimate',
['json' => $order])->getBody(), true);
// the price you accepted is the ceiling
$project = json_decode($http->post('projects', ['json' => $order + [
'expected_cost_minutes' => $estimate['total_minutes'],
]])->getBody(), true);
// the .srt and .vtt files are among the project outputs
$outputs = json_decode(
$http->get("projects/{$project['project_id']}/outputs")->getBody(), true); 0s queued
3s running transcribing
48s running translating
70s succeeded the .srt and .vtt files are in the project outputs

es-mx と es-es の両方に使えます。各プロジェクトには glossary.versionが記録されるため、後から用語集を編集しても、完成済みの成果物が知らないうちに変わることはありません。はい。Raskのすべてのプロジェクトで、翻訳先の言語の字幕ファイルをSRTとWebVTTの両形式で取得できます。動画をアップロードし、字幕の言語ごとにプロジェクトを作成してください。プロジェクトが完了したら、ファイルをダウンロードできます。
どのプロジェクトでも、翻訳先の言語の字幕をSRTとWebVTT(VTT)の2形式で取得できます。ご利用のプラットフォームで別の字幕形式が必要な場合は、文字起こしをタイムスタンプ付きのJSONセグメントとして取得することもできます。
字幕ファイルは翻訳先の言語で出力されます。元の言語の字幕には、文字起こしのセグメントをご利用ください。各セグメントには原文と開始・終了時刻が含まれているため、数行のコードでSRTまたはVTTファイルに変換できます。
75の言語を原語として、es-mx、pt-br、fr-caなど、言語と地域別のバリエーションを合わせて135を超える選択肢から字幕の翻訳先を選べます。翻訳先はプロジェクトごとに1言語です。複数の言語に翻訳する場合は、同じアップロード素材から言語ごとにプロジェクトを作成してください。
現時点では対応していません。APIは、プレーヤーや動画編集ソフトで使える字幕ファイルを返します。字幕を焼き付けた動画が必要な場合は、RaskのWebアプリをご利用ください。
字幕ファイルにはテキストと表示タイミングが含まれます。フォント、サイズ、色、表示位置は動画プレーヤーやアプリ、編集ソフト側で設定するため、同じ字幕ファイルをどの環境でも利用できます。
字幕ファイルに含まれるのは発話内容です。耳の聞こえない方や聞こえにくい方に向けた音楽や効果音の説明は自動生成されません。字幕を編集する際に追加してください。
文字起こしの各セグメントには、SPEAKER_XX形式の話者ラベルが付きます。このラベルを使って、インタビューや会話の字幕に話者名を追加できます。
APIのPATCHリクエストで該当セグメントのテキストまたは表示タイミングを修正し、プロジェクトを再生成してください。字幕ファイルと吹き替え版が同時に更新されます。再生成の課金対象は変更したセグメントのみで、1回につき最低1分からです。
ダウンロードリンクは署名付きで、有効期限は1時間です。ファイルをご自身のストレージに保存するか、プロジェクト情報を再取得して新しいリンクを取得してください。
はい。文字起こしのインポートに対応するプランでは、プロジェクト作成時に、元の言語の字幕と翻訳先の言語の承認済みSRTファイルのどちらか一方、または両方をアップロードできます。既存の字幕を翻訳元として使ったり、承認済みの翻訳をそのまま字幕と吹き替えに使ったりできます。
プロジェクトごとに動画の長さを1分単位で切り上げて計算し、Raskアプリと共通の利用可能分数から差し引きます。料金には文字起こし、翻訳、字幕、吹き替え版が含まれます。対象の標準プランでは、追加分の料金は$3/minです。Enterpriseの料金は契約内容に応じて決まります。
Creator Pro、Business、Enterpriseの各プランでAPIを利用できます。利用できる機能はプランによって異なります。アプリ内でAPIキーを作成すると、すぐにAPIを呼び出せます。Enterpriseの契約条件、大口利用料金、個別の言語対応については、担当チームにご相談ください。