Subtitles
集成
模型 id
veed/subtitles
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/veed/subtitles?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/veed/subtitles?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/veed/subtitles", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/zh/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.com/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "veed/subtitles",
"input": {
"video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass"
}
}
通过 Doitong API 调用 Subtitles 模型(veed/subtitles)。智能体文档:https://doitong.com/zh/developers/models/veed/subtitles.md
POST https://api.doitong.com/v1/run/veed/subtitles?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass"
}
如果响应状态为 "queued" 或 "running",请轮询 GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20,直到状态变为 "succeeded";文件位于 outputs[].url。使用相同请求体 POST https://api.doitong.com/v1/quote/veed/subtitles,可在运行前返回确切价格。
与示例类似的文件: $0.20 200 API 积分 运行前会测量你的文件 在此页面运行
你的新 API 密钥。 它仅在此时显示,并且已填入下方的代码和 API 密钥字段中。请妥善保密:切勿将其放入在浏览器中运行的代码。
构建请求
控件根据模型架构生成。更改控件时,代码和价格会同步更新。
POST
/run/veed/subtitles?wait=20
报价 → $0.20
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/veed/subtitles?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/veed/subtitles?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/veed/subtitles", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "veed/subtitles",
"input": {
"video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass"
},
"wait_seconds": 20
}
}
}
关于 Subtitles
使用必需的样式 `preset` 将渲染后的字幕添加到视频(`video_url`)中,共有 30 个预设。模型会自动转录;如果提供 `srt_file_url` 或 `srt_content`,则跳过转录。`language` 设置源语言以提高准确性,`translation_language` 用于翻译字幕。最多 100 个术语的 `vocabulary` 列表和 `customization` 覆盖项可进一步优化结果。
参数
发送规范名称或原生名称之一,不要同时发送两者。 规范名称
名称类型
默认值允许值
描述
video_url必填
video
类型url · video
≤ 2,083 个字符
用于添加字幕的源视频;上传文件或粘贴其 URL。
preset必填
类型enum
glasswhisperglide2fusionglideterminalhandwrittenbackdropbackdrop2simpleplainbeanscorpobooshadeplaycasper
另外 14 个
caprilowkeyvintadiegoalislaykittyhustlekarlsproutflexmintrizzvegas控制排版、颜色、布局和动画的样式选择,并根据输入上下文提供更丰富的渲染。基础预设使用 1 倍乘数,通过固定且轻量的样式提供可预测的结果:vegas, rizz, mint, flex, sprout, karl, hustle, kitty, slay, ali, diego, vinta, lowkey, capri, casper, shadeplay, boo, corpo, beans, plain, simple。
language可选
类型enum
af-ZAam-ETar-AEar-BHar-DZar-EGar-ILar-IQar-JOar-KWar-LBar-MAar-OMar-PSar-QAar-SA
另外 148 个
ar-TNast-ESaz-AZbabasbe-BYbg-BGbrbs-BAca-ESceb-PHckb-IQcs-CZcy-GBda-DKde-DEdyuel-GRen-AUen-GBen-INen-NZen-USeoes-ARes-BOes-CLes-COes-CRes-DOes-ECes-ESes-GTes-HNes-MXes-NIes-PAes-PEes-PRes-PYes-SVes-USes-UYes-VEet-EEeu-ESfa-IRfffi-FIfil-PHfofr-CAfr-FRfygagdgl-ESha-NGhawhe-ILhr-HRhsbhthu-HUhy-AMid-IDigis-ISit-ITja-JPja-Latn-JPjv-IDka-GEkabkam-KEkea-CVkk-KZko-KRkuky-KGlalb-LUlglijln-CDlo-LAlt-LTluo-KElv-LVmgmi-NZmk-MKmn-MNms-MYmt-MTnb-NOnl-NLnso-ZAny-MWoc-FRpl-PLps-AFpt-BRpt-PTro-ROrohru-RUrw-RWsahsk-SKsl-SIsmsn-ZWso-SOsq-ALsr-Latn-RSsr-RSsrdsssu-IDsv-SEsw-KEsw-TZtg-TJth-THtktntoktontr-TRts-ZAttuk-UAumb-AOur-INur-PKuz-UZvi-VNvrowo-SNxh-ZAyiyo-NGyue-Hant-HKzhzh-HKzh-TWzu-ZA源音频的语言,而非生成字幕的语言。将其与音频匹配可提高转录准确率。
translation_language可选
类型enum
abaceachaf-ZAakalzam-ETar-AEar-BHar-DZar-EGar-ILar-IQar-JOar-KWar-LB
另外 198 个
ar-MAar-OMar-PSar-QAar-SAar-TNawaayaz-AZbanbbcbe-BYbembewbg-BGbhobikbmbs-BAbtsbtxbuaca-ESceb-PHcggchmckb-IQcnhcocrhcrscs-CZcvcy-GBda-DKde-DEdindoidovdvdzeeel-GRen-AUen-GBen-INen-NZen-USeoes-ARes-BOes-CLes-COes-CRes-DOes-ECes-ESes-GTes-HNes-MXes-NIes-PAes-PEes-PRes-PYes-SVes-USes-UYes-VEet-EEeu-ESfa-IRfffi-FIfil-PHfjfr-CAfr-FRfygagaagdgl-ESgngomha-NGhawhe-ILhilhmnhr-HRhrxhthu-HUhy-AMid-IDigilois-ISit-ITja-JPja-Latn-JPjv-IDka-GEkk-KZko-KRkriktukuky-KGlalb-LUlglilijlmoln-CDlo-LAlt-LTltgluo-KEluslv-LVmaimakmgmi-NZminmk-MKmn-MNmni-Mteims-Arabms-MYmt-MTnb-NOnewnl-NLnrnso-ZAnusny-MWoc-FRompagpampappl-PLps-AFpt-BRpt-PTqurnro-ROromru-RUrw-RWscnsgshnsk-SKsl-SIsmsn-ZWso-SOsq-ALsr-Latn-RSsr-RSssstsu-IDsv-SEsw-KEsw-TZszltettg-TJth-THtitktntr-TRts-ZAttuguk-UAur-INur-PKuz-UZvi-VNxh-ZAyiyo-NGyuayue-Hant-HKzhzh-HKzh-TWzu-ZA将字幕翻译成的语言;要使用 `srt_content` 或 `srt_file_url` 获得最可靠的翻译,还应在 `language` 中提供源语言。未指定目标语言时,字幕保留原始口语语言。
srt_file_url可选
类型url · file
≤ 2,083 个字符
上传 .srt 文件或粘贴其 URL,以提供字幕而不是运行转录。
srt_content可选
类型string | null
SRT 格式的原始字幕文本,用于替代 srt_file_url。提供此值会跳过转录。
vocabulary可选
类型object[]
≤ 100 个项目
可选的转录词汇,仅在未提供 srt_content 和 srt_file_url 时生效。包括转录服务商经常拼写错误的品牌名称和专业术语,例如 "VEED" → "vid"。
vocabulary[].word必填
类型string
1 – 100 characters
提供术语的正确拼写,最好是你所在领域的品牌、产品名称或专业术语。
vocabulary[].replaces必填
类型string[]
1 – 20 items
每个拼写错误列出一次,以便替换为 `word`。匹配要求完整单词,但忽略大小写:`['vid']` 可匹配 `vid`、`Vid` 和 `VID`,无需分别为每种大小写添加条目。
customization可选
类型object
可选的预设定制;省略字段时保留默认值。覆盖设置可分别调整每个单词重要性层级的垂直位置、阴影强度、字体、字重和十六进制颜色。
customization.position可选
类型enum
topcenterbottom
静态字幕沿垂直轴的屏幕位置。
customization.shadow可选
类型enum
noneminmidmax
增强字幕在明亮或视觉复杂背景上的可读性。
customization.text_customizations可选
类型object
按层级设置文本外观,涵盖基础词和高亮词。
customization.text_customizations.baseline可选
类型object
所有转录词的默认文本外观,在单个词获得强调前显示。
customization.text_customizations.highlighted可选
类型object
中等级别词语的样式,预设通常通过更大的字号或更粗的字重来强调这些词。当词语被标记为值得注意时会自动进入此层级,包括关键名词、动作动词和显著形容词。
必填
规范名称,也可接受
文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件
输出
GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "veed/subtitles",
"status": "succeeded",
"created_at": "2026-10-20T12:00:00Z",
"started_at": "2026-10-20T12:00:02Z",
"completed_at": "2026-10-20T12:00:09Z",
"queue_position": null,
"cost": {
"credits": 200,
"usd": "0.20",
"charged": 200,
"refunded": 0
},
"input": {
"video_url": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4",
"preset": "glass"
},
"output": {
"video": {
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
"content_type": "video/mp4",
"file_name": "0-output.mp4",
"file_size": 1843200
}
},
"outputs": [
{
"type": "video",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
"content_type": "video/mp4",
"file_size": 1843200,
"width": 1280,
"height": 720,
"duration": 5,
"stored": true
}
],
"error": null,
"metrics": {
"inference_seconds": 6.8
},
"urls": {
"self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
你的文件,由你选择每个 outputs[].url 都是存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
每个模型的结构相同图像、视频和音频均包含 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
- video
- object {url, content_type, file_name, file_size}包含样式化字幕的渲染视频。
其他 VEED Fabric 变体
更多模型:视频转换
对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/veed/subtitles.md. 所有模型和指南: https://doitong.com/developers/llms.txt