跳转到内容

Workflow Utilities Auto Subtitle

集成

模型 id workflow-utilities/auto-subtitle
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/workflow-utilities/auto-subtitle?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"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

与示例类似的文件: $0.005 5 API 积分 · ≈ ₽0.53 运行前会测量你的文件 在此页面运行

获取 API 密钥
Utility · 视频

你的第一个结果将在此显示

在下方构建请求,并使用你的 API 密钥运行。输出会复制到我们的存储中,可永久保存或免费保存 7 天。

构建请求

控件根据模型架构生成。更改控件时,代码和价格会同步更新。

•必填 video_url
拖放文件,或

用于自动添加字幕的视频 URL。

高级 font_weight · position · language · font_name · font_color · highlight_color · stroke_color · background_color · font_size · stroke_width · background_opacity · y_offset · words_per_subtitle · enable_animation
font_weight 默认 bold

文本字重;典型的 TikTok 样式使用粗体或黑体。

position 默认 bottom

字幕沿垂直轴的位置。

默认 en

转录语言标识符,例如 'en'、'es'、'fr'、'de'、'it'、'pt'、'nl'、'ja'、'zh' 或 'ko'。也接受 'eng'、'spa' 或 'fra' 等 3 字母 ISO 标识符。

默认 Montserrat

从 fonts.google.com 选择的字体名称;接受任何 Google Font,包括 'Montserrat'、'Poppins' 和 'BBH Sans Hegarty'。

默认 white

用于未激活字幕词语的颜色。

默认 purple

应用于当前朗读词语的卡拉 OK 样式高亮颜色。

默认 black

应用于文本轮廓或描边的颜色。

默认 none

文本后方背景的颜色;'none' 和 'transparent' 都会禁用背景。

默认 100

字幕字体大小;TikTok 样式使用更大的文本。

默认 3

文本轮廓或描边宽度,单位为像素;0 表示禁用。

默认 0

背景不透明度,0.0 表示完全透明,1.0 表示完全不透明。

默认 75

垂直位移,单位为像素;正值向下移动,负值向上移动。

默认 3

字幕词数上限:1 表示单词显示,2–3 表示短语显示,8–12 表示每个片段显示完整句子。

POST /run/workflow-utilities/auto-subtitle?wait=20 报价 → $0.005
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/workflow-utilities/auto-subtitle?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"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

你的密钥会保留在此浏览器中:仅发送到 Doitong API;只有勾选“记住”后才会保存到 localStorage。 获取 API 密钥

关于 Workflow Utilities Auto Subtitle

转写视频中的语音,并将字幕烧录到视频中,同时突出显示当前说出的单词。样式选项包括任意 Google Font 名称、20-150 的字号、字重、文本和高亮颜色、描边、背景颜色和不透明度,以及顶部、居中或底部位置和垂直偏移。`words_per_subtitle` 的范围为 1 到 12,可开启或关闭弹跳动画。还会返回转写文本和单词时间信息。

参数

发送规范名称或原生名称之一,不要同时发送两者。 规范名称

名称类型 默认值允许值 描述
video_url必填 video
类型url · video
用于自动添加字幕的视频 URL。
language可选
类型string
默认值en
转录语言标识符,例如 'en'、'es'、'fr'、'de'、'it'、'pt'、'nl'、'ja'、'zh' 或 'ko'。也接受 'eng'、'spa' 或 'fra' 等 3 字母 ISO 标识符。
font_name可选
类型string
默认值Montserrat
从 fonts.google.com 选择的字体名称;接受任何 Google Font,包括 'Montserrat'、'Poppins' 和 'BBH Sans Hegarty'。
font_size可选
类型integer
默认值100
20 – 150
字幕字体大小;TikTok 样式使用更大的文本。
font_weight可选
类型enum
默认值bold
normalboldblack
文本字重;典型的 TikTok 样式使用粗体或黑体。
font_color可选
类型enum
默认值white
whiteblackredgreenblueyelloworangepurplepinkbrowngraycyanmagenta
用于未激活字幕词语的颜色。
highlight_color可选
类型enum
默认值purple
whiteblackredgreenblueyelloworangepurplepinkbrowngraycyanmagenta
应用于当前朗读词语的卡拉 OK 样式高亮颜色。
stroke_width可选
类型integer
默认值3
0 – 10
文本轮廓或描边宽度,单位为像素;0 表示禁用。
stroke_color可选
类型enum
默认值black
blackwhiteredgreenblueyelloworangepurplepinkbrowngraycyanmagenta
应用于文本轮廓或描边的颜色。
background_color可选
类型enum
默认值none
blackwhiteredgreenblueyelloworangepurplepinkbrowngraycyanmagentanonetransparent
文本后方背景的颜色;'none' 和 'transparent' 都会禁用背景。
background_opacity可选
类型number
默认值0
0 – 1
背景不透明度,0.0 表示完全透明,1.0 表示完全不透明。
position可选
类型enum
默认值bottom
topcenterbottom
字幕沿垂直轴的位置。
y_offset可选
类型integer
默认值75
-200 – 200
垂直位移,单位为像素;正值向下移动,负值向上移动。
words_per_subtitle可选
类型integer
默认值3
1 – 12
字幕词数上限:1 表示单词显示,2–3 表示短语显示,8–12 表示每个片段显示完整句子。
enable_animation可选
类型boolean
默认值true
启用带弹跳进入效果的字幕动画。
必填 规范名称,也可接受

文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "workflow-utilities/auto-subtitle",
  "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": 5,
    "usd": "0.005",
    "charged": 5,
    "refunded": 0
  },
  "input": {
    "video_url": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  },
  "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
    },
    "transcription": "string",
    "subtitle_count": 1,
    "words": [
      {}
    ],
    "transcription_metadata": {}
  },
  "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.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/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}包含自动生成字幕的视频。
transcription
string转录的完整文本。
subtitle_count
integer生成的字幕片段数量。
words
array of object | null转录服务提供的单词时间数据。
transcription_metadata
object | nullElevenLabs 为转录提供的额外元数据,包括语言、片段及其他详细信息。

更多模型:视频转换

对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/workflow-utilities/auto-subtitle.md. 所有模型和指南: https://doitong.com/developers/llms.txt