> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vmeg.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 下载转写稿

> 以 SRT（默认）或 JSON 格式下载已完成转写任务的转写稿。内容为网站编辑器中的最新版本（包含你的修改），与网站导出的原文字幕一致。

SRT 直接作为纯文本响应体返回（`Content-Type: application/x-subrip; charset=UTF-8`），不包在 JSON 外层结构里。`format=json` 时返回常规 JSON 结构，`data.segments` 与 SRT 条目一一对应，时间为整数毫秒。出错时统一返回 JSON 结构，HTTP 状态为 200，错误码在 body 的 `code` 中：`400` 参数不合法；`404` 该 `taskId` 不是你账号下的转写任务（翻译任务的 ID 也返回 `404`）；`409` 任务尚未完成或转写稿尚未就绪（等 `status` 变为 `finished` 后重试）。

请不要设置 `Accept` 请求头，或设为 `Accept: */*`。如果 `Accept` 只包含非 JSON 类型（例如只有 `application/x-subrip`），出错时可能无法正常返回错误信息。



## OpenAPI

````yaml /zh/api-reference/app-synced.json get /openapi/v1/app/tasks/transcription/srt
openapi: 3.1.0
info:
  title: VMEG 开放 API（应用同源版）
  description: >-
    与独立版协议一致，但任务、素材、克隆音色都在你的 VMEG
    网站账号里：任务出现在**我的任务**，可在编辑器继续编辑并重新导出。支持媒体翻译、转写和声音克隆。结果通过 Webhook（只推首次结果，event
    为 `openapi-app-media-translation`）或轮询 `GET /openapi/v1/app/tasks/detail`
    获取。见[独立版与应用同源版](/zh/guides/choose-api)。


    文中链接的指南按独立版编写，步骤相同，把路径前缀 `/openapi/v1` 换成 `/openapi/v1/app` 即可。
  version: 1.0.0
servers:
  - url: https://api.vmeg.ai
    description: 生产环境
security:
  - apiKeyAuth: []
tags:
  - name: 媒体翻译
    x-group: 视频与音频翻译配音
    description: >-
      在与 vmeg.ai 相同的链路上翻译配音已上传的视频/音频或 YouTube
      链接。首轮即产出配音成片，任务同时出现在**我的任务**，可继续编辑并重新导出。结果通过
      Webhook（只推首次结果）或轮询[查询任务状态](/zh/api-reference/app-synced/tasks/get-task-detail)获取。
  - name: 转写
    description: >-
      在与 vmeg.ai 相同的链路上转写已上传的视频/音频或 YouTube
      链接。任务出现在**我的任务**，可在转写编辑器中打开。完成后可下载最新的转写稿（包含你在网站上的修改），格式为 SRT 或 JSON。
  - name: 声音克隆
    x-group: 声音克隆
    description: 用一段短录音克隆音色。音色保存到网站**我的音色**，返回 `cv_*`，可用于翻译配音任务。
  - name: 任务管理
    x-group: 任务状态与历史
    description: 列出、查看或删除你 VMEG 账号下的视频/音频翻译和转写任务，包括在网站创建的任务。
  - name: 资产 - 素材
    x-group: 上传文件（素材）
    description: 上传并管理网站素材库（**我的资产**）里的文件。完成上传（单文件或分片）后，把 `materialId` 传给 create-async。
  - name: 资产 - 音色
    x-group: 音色（预设与克隆）
    description: 列出系统预设音色（`sv_*`），管理你的克隆音色（`cv_*`，与网站**我的音色**相同）。
paths:
  /openapi/v1/app/tasks/transcription/srt:
    get:
      tags:
        - 转写
      summary: 下载转写稿
      description: >-
        以 SRT（默认）或 JSON 格式下载已完成转写任务的转写稿。内容为网站编辑器中的最新版本（包含你的修改），与网站导出的原文字幕一致。


        SRT 直接作为纯文本响应体返回（`Content-Type: application/x-subrip;
        charset=UTF-8`），不包在 JSON 外层结构里。`format=json` 时返回常规 JSON
        结构，`data.segments` 与 SRT 条目一一对应，时间为整数毫秒。出错时统一返回 JSON 结构，HTTP 状态为
        200，错误码在 body 的 `code` 中：`400` 参数不合法；`404` 该 `taskId` 不是你账号下的转写任务（翻译任务的
        ID 也返回 `404`）；`409` 任务尚未完成或转写稿尚未就绪（等 `status` 变为 `finished` 后重试）。


        请不要设置 `Accept` 请求头，或设为 `Accept: */*`。如果 `Accept` 只包含非 JSON 类型（例如只有
        `application/x-subrip`），出错时可能无法正常返回错误信息。
      operationId: appTranscriptionSrt
      parameters:
        - name: taskId
          in: query
          required: true
          description: 转写任务 ID
          schema:
            type: string
        - name: format
          in: query
          required: false
          description: '`srt`（默认）纯文本 SRT | `json` JSON 句段。不区分大小写，其他值返回 `400`。'
          schema:
            type: string
            enum:
              - srt
              - json
            default: srt
        - name: speakers
          in: query
          required: false
          description: >-
            为 `true` 时，有说话人信息的 SRT 条目前加 `[Speaker N] `。默认 `false`；`true`/`false`
            以外的值返回 `400`。JSON 始终包含 `speaker`。
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: 默认返回 SRT 文本；`format=json` 时返回 JSON 结构。
          content:
            application/x-subrip:
              schema:
                type: string
                example: |
                  1
                  00:00:00,000 --> 00:00:05,960
                  Welcome to VMEG.

                  2
                  00:00:06,120 --> 00:00:09,480
                  Let's get started.
            application/json:
              schema:
                $ref: '#/components/schemas/AppTranscriptResponse'
components:
  schemas:
    AppTranscriptResponse:
      allOf:
        - $ref: '#/components/schemas/OpenApiResponseBase'
        - type: object
          properties:
            data:
              type: object
              description: 转写稿（format=json）
              properties:
                taskId:
                  type: string
                  description: 任务 ID（与网站任务 ID 相同）
                segments:
                  type: array
                  items:
                    $ref: '#/components/schemas/AppTranscriptSegment'
                  description: 转写句段，按开始时间排序，已去掉空句
    OpenApiResponseBase:
      type: object
      properties:
        code:
          type: integer
          example: 200
          description: 业务码；200 表示成功
        message:
          type: string
          example: ''
          description: 当 `code` 非成功时的说明信息
      required:
        - code
    AppTranscriptSegment:
      type: object
      properties:
        index:
          type: integer
          description: 序号，从 1 开始，与 SRT 序号一致
          example: 1
        start:
          type: integer
          format: int64
          description: 开始时间（毫秒）
          example: 0
        end:
          type: integer
          format: int64
          description: 结束时间（毫秒）
          example: 5960
        text:
          type: string
          description: 句段文本
          example: Welcome to VMEG.
        speaker:
          type: string
          description: 说话人标签，如 `1`；没有说话人信息时不返回
          example: '1'
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        在 **`Authorization`** 请求头中传入 API Key（`Bearer <api_key>`）。见
        [鉴权](/zh/guides/authentication)。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.