# 1. import the video - YouTube, Drive, Vimeo or a direct URL
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": "es-mx"}'
# 3. create the dubbing 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": "es-mx",
"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ドライブ、S3、Vimeo、および直接ダウンロードURLです。費用が発生する前に、メディアIDと詳細な技術メタデータが返されます。
メディアIDを media_id として渡し、翻訳先の言語を指定します。オプションで、独自の原稿や用語集を追加することも可能です。ダビングはすぐに開始されます。
status(ステータス)が succeeded(成功)になるまで確認し、ダビングされた動画、音声トラック、字幕ファイルをダウンロードします。
# pip install rask-sdk
from rask_sdk import Rask
rask = Rask() # reads RASK_API_KEY
uploaded = rask.jobs.wait(rask.uploads.upload_file("q3-launch.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="es-mx"
)
# the price you accepted is the ceiling
created = rask.projects.create_project(
media_id=media_id,
target_language="es-mx",
expected_cost_minutes=estimate.total_minutes,
)
processed = rask.jobs.wait(created.id)
outputs = rask.exports.list_project_outputs(processed.result.project_id).data
print(next(o.url for o in outputs if o.kind == "dubbed_video"))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": "es-mx"}
# 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()
outputs = requests.get(f"{API}/projects/{project['project_id']}/outputs",
headers=h).json()
print(next(o["url"] for o in outputs["data"] if o["kind"] == "dubbed_video"))// 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: 'es-mx' };
// 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());
const outputs = await fetch(`${API}/projects/${project.project_id}/outputs`, { headers: h })
.then(r => r.json());
console.log(outputs.data.find(o => o.kind === 'dubbed_video')?.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\":\"es-mx\"}"
# 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 dubbed video
curl -s $API/projects/$ID/outputs -H "$AUTH" \
| jq -r '.data[] | select(.kind == "dubbed_video") | .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' => 'es-mx'];
// 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);
$outputs = json_decode(
$http->get("projects/{$project['project_id']}/outputs")->getBody(), true); 0s queued
3s running transcribing
48s running translating
72s running voicing
128s running merging
150s succeeded

es-mx および es-es 同様に。プロジェクトの記録 glossary.versionのため、後から編集しても完成した作業が勝手に変更されることはありません。APIアクセスはCreator Pro、Business、Enterpriseプランでご利用いただけます(機能はプランにより異なります)。アプリでAPIキーを作成すれば、すぐに利用を開始できます。Enterpriseプランのご契約、大量利用時の割引、カスタム言語への対応については、チームまでお問い合わせください。
Authorization: BearerヘッダーにAPIキーを1つ設定するだけです。トークンの交換や更新作業は必要ありません。連携ごとに必要な権限を持つ専用のキーを発行し、それぞれの月間利用上限額を設定できます。
待機機能付きの非同期処理です。プロジェクトを作成すると、すぐにジョブが返されます。「GET /v3/jobs/{job_id}?wait_seconds=20」を呼び出すと、ダビングが完了した瞬間にリクエストが返されるため、処理を一時停止してポーリングを繰り返すループ処理はもう必要ありません。
有料の処理にはすべて、実際の料金と同じ計算式を用いた無料の見積もり機能があります。その数値を expected_cost_minutes として送ると上限額になり、その金額以下であればそのまま課金され、それを超える場合はリクエストが失敗して課金されません。また、APIキーごとに月間の利用上限額を設定することも可能です。
スペイン語、フランス語、ドイツ語、ポルトガル語、ヒンディー語、日本語、韓国語など、135以上の言語に対応しています。必要に応じて地域別のバリエーションにも対応しており、target_language には単なる「es」ではなく「es-mx」を指定できます。元の言語は自動検出されますが、手動で設定することも可能です。対応言語コードの詳細な一覧はAPIドキュメントをご確認ください。カタログにない言語については、実現可能性や提供可能なオプションについて当社チームにお問い合わせください。
インスタントボイスクローンでは、対応しているターゲット言語に対して、ソース動画内の話者の声が使用されます。再利用可能なカスタムボイスクローンを使用する場合は、話者の同意を得て Rask アプリ内で作成し、API を通じて割り当てます。結果は、ソース音声、選択した言語、および音声によって異なります。
動画の長さ、話者の数、ターゲット言語、キューの深さによって異なります。文字起こしから結合までの各段階でステータスが報告されるため、ユーザーに進捗状況をリアルタイムで表示できます。
7 つの動画形式(MP4、MOV、MKV、AVI、WebM、M4V、3GP)と 4 つの音声形式(MP3、WAV、FLAC、M4A)に対応しています。また、ファイルをアップロードする代わりに、YouTube、Google ドライブ、S3、Vimeo、または直接の URL から取り込むことも可能です。
元の音声から話し手を自動で識別して分離し、それぞれの言語の声を設定します。設定は話し手ごとに変更できるほか、あらかじめ人数が分かっている場合は、プロジェクト作成時に人数を指定することも可能です。
はい。.srtファイルをアップロードして文字起こしを作成し、プロジェクト作成時にそのIDを指定できます。また、APIに文字起こしを任せた後で、セグメントごとに台本を編集することも可能です。
完成したプロジェクトでは、動画や音声トラックに加えて、吹き替えのタイミングに合わせた.srtおよび.vtt形式の字幕ファイルを利用できます。
TypeScript、Python、Go、Java、PHPの5つの言語に対応しており、これらは同一のOpenAPI仕様から生成され、仕様書と同時に公開されています。それぞれ82の操作すべてを網羅しており、見積もり機能やジョブの待機機能も利用できます。ノーコードでの連携には、n8nノードも用意されています。
変更された部分のみが対象となります。編集および追加されたセグメントの長さを合計し、1分単位で切り上げるため、数行の修正であれば約1分分の費用となります。