# 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": "en-us"}'
# 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": "en-us",
"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、Vimeo、S3 链接或视频直链。您在产生任何费用前就能获得媒体 ID 和视频元数据。
将媒体 ID 作为 media_id 传入,并指定目标语言。将源语言留空即可自动识别语言。转录会立即开始。media_id
文稿片段一生成即可读取,因此您可以在译制媒体仍在处理时开始为录制内容建立索引。项目完成后即可下载字幕和媒体文件。
# pip install rask-sdk
from rask_sdk import Rask
rask = Rask() # reads RASK_API_KEY
uploaded = rask.jobs.wait(rask.uploads.upload_file("interview.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="en-us"
)
# the price you accepted is the ceiling
created = rask.projects.create_project(
media_id=media_id,
target_language="en-us",
expected_cost_minutes=estimate.total_minutes,
)
processed = rask.jobs.wait(created.id)
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": "en-us"}
# 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()
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: 'en-us' };
// 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());
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\":\"en-us\"}"
# 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 transcript and every other output
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' => 'en-us'];
// 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);no_audio_track, no_speech_detected and source_unavailable are specific enough to show directly to your own user, for example a video without speech. 0s queued
3s running transcribing
48s running translating
72s running voicing
128s running merging
150s succeeded/transcriptiontarget_subtitlestarget_subtitles_speakersdubbed_videodubbed_audiosource

es-mx 和 es-es 同样适用。项目会记录 glossary.version,因此后续编辑不会在您不知情的情况下改动已完成的内容。提供。提交视频文件或链接并创建项目后,通过 GET /v3/projects/{project_id}/transcript 即可读取带说话人标签和时间戳的文稿。转录是每个 Rask 项目的第一阶段,随后会生成译文、字幕和配音版本。
可以。向媒体端点提交 YouTube、Google Drive、Vimeo、S3 链接或直接下载链接,API 就会自行获取视频。您也可以直接上传视频文件。
可以。为每个视频创建一个项目,并行运行即可。先为每个项目估价,您就能在第一个项目启动前了解整个视频库的转录费用。
API 会自动识别不同的说话人,并为每个片段添加 SPEAKER_00 这样的说话人标签。如果您知道说话人人数,可以在创建项目时通过 num_speakers 传入人数。
API 可转录包括英语在内的 75 种源语言。将 source_language 留空即可自动识别语言,也可以传入 en 等语言代码。文稿可翻译为超过 135 种语言及地区变体,例如 en-us 或 es-mx。
准确度取决于视频本身。背景噪声、嘈杂的录制环境、多人同时讲话、口音和专业术语都会影响结果。您可以用自己的视频测试 API,并在发布前通过 API 修正任意片段。
API 以 JSON 格式分段返回文稿,每段都标有说话人和时间戳。您可以拼接各段文字,得到纯文本,也可以保留时间戳,方便检索文稿并定位到视频中的相应位置。API 还会提供 SRT 和 VTT 两种格式的目标语言字幕。
不支持。API 会返回文稿、文稿译文、字幕和配音版本。如需用人工智能生成摘要或会议纪要,您可以将文稿交给自己选择的摘要工具处理。
可以转录已录制的会议。您可以上传会议录像或录音文件。API 不会连接到会议平台,也不支持为正在进行的通话提供实时字幕或低延迟转录。
API 文档未列出固定的文件大小上限。应用套餐限制后,每个项目都会返回 source_duration_seconds 和 duration_seconds。如果您的视频特别长或需要大批量转录,请联系我们的团队。
每个项目按视频时长计费,不足一分钟的部分按一分钟计算。API 与 Rask 应用共用分钟额度。费用涵盖转录、翻译、字幕和配音版本。符合条件的标准套餐按 $3/分钟收取额外分钟费用。Enterprise 套餐按您的协议定价。
您可以在 Rask 应用中免费试用,用自己的视频测试转录效果,无需信用卡。Creator Pro、Business 和 Enterprise 套餐均支持 API 访问,具体功能取决于您的套餐。
Creator Pro、Business 和 Enterprise 套餐均支持 API 访问,具体功能取决于您的套餐。在应用中创建 API 密钥后,您即可开始调用 API。如需办理 Enterprise 套餐、咨询批量定价或定制支持的语种,请联系我们的团队。