> ## 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.

# 创建转写任务

> 在**与 vmeg.ai 相同的链路**上创建转写任务。任务会出现在网站**我的任务**中，打开 `editorUrl` 可查看和编辑转写稿。Webhook 会收到首次结果（event 为 `openapi-app-media-translation`，`data.taskType` 为 `transcription`），也可以轮询[查询任务状态](/zh/api-reference/app-synced/tasks/get-task-detail)直到 `status` 为 `finished`，再从 `result.srtEndpoint` 下载转写稿。积分按网站规则扣除。

`source` 接受 `materialId`（音频或视频素材）或 `youtubeUrl` 二选一；传 `sourceUrl`、`output`、`extraData` 返回 `400`。其他未知字段会被忽略。



## OpenAPI

````yaml /zh/api-reference/app-synced.json post /openapi/v1/app/task/transcription/create-async
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/task/transcription/create-async:
    post:
      tags:
        - 转写
      summary: 创建转写任务
      description: >-
        在**与 vmeg.ai 相同的链路**上创建转写任务。任务会出现在网站**我的任务**中，打开 `editorUrl`
        可查看和编辑转写稿。Webhook 会收到首次结果（event 为
        `openapi-app-media-translation`，`data.taskType` 为
        `transcription`），也可以轮询[查询任务状态](/zh/api-reference/app-synced/tasks/get-task-detail)直到
        `status` 为 `finished`，再从 `result.srtEndpoint` 下载转写稿。积分按网站规则扣除。


        `source` 接受 `materialId`（音频或视频素材）或 `youtubeUrl` 二选一；传
        `sourceUrl`、`output`、`extraData` 返回 `400`。其他未知字段会被忽略。
      operationId: appTranscriptionCreateAsync
      parameters:
        - $ref: '#/components/parameters/IdempotencyKeyRequired'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppTranscriptionCreateRequest'
      responses:
        '200':
          description: 任务已受理。`editorUrl` 为该任务的网站转写编辑器地址。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppTranscriptionAcceptedResponse'
components:
  parameters:
    IdempotencyKeyRequired:
      name: X-Idempotency-Key
      in: header
      required: true
      description: 创建任务或修改持久化数据的 `POST` 必填（最长 64 字符）。见 [幂等](/zh/guides/idempotency)。
      schema:
        type: string
        maxLength: 64
  schemas:
    AppTranscriptionCreateRequest:
      type: object
      required:
        - source
        - language
      properties:
        source:
          $ref: '#/components/schemas/AppTranscriptionSource'
        language:
          type: object
          description: 语言设置
          required:
            - source
          properties:
            source:
              type: string
              example: en-US
              description: 媒体的说话语言（必填），代码与网站一致。见[支持的语言](/zh/guides/supported-languages)。
        options:
          $ref: '#/components/schemas/AppTranscriptionOptions'
        title:
          type: string
          maxLength: 255
          description: '**我的任务**中显示的任务名（最多 255 个字符）。不传时取文件名或 YouTube 视频标题。'
      example:
        source:
          materialId: YOUR_MATERIAL_ID
        language:
          source: en-US
        options:
          asr:
            quality: standard
          speakers: auto
        title: Weekly meeting
    AppTranscriptionAcceptedResponse:
      allOf:
        - $ref: '#/components/schemas/OpenApiResponseBase'
        - type: object
          properties:
            data:
              type: object
              properties:
                taskId:
                  type: string
                  description: 任务 ID（与网站任务 ID 相同）
                taskType:
                  type: string
                  enum:
                    - transcription
                status:
                  type: string
                  enum:
                    - running
                    - finished
                    - failed
                  example: running
                createdAt:
                  type: string
                  description: 创建时间
                editorUrl:
                  type: string
                  description: 该任务的网站编辑器地址（登录同一 VMEG 账号）
                  example: >-
                    https://www.vmeg.ai/transcription/editor/2047316590123456789/
    AppTranscriptionSource:
      type: object
      description: '`materialId` 与 `youtubeUrl` 二选一。转写不支持 `sourceUrl`，传入返回 `400`。'
      properties:
        materialId:
          type: string
          description: >-
            音频或视频素材
            ID，来自[应用同源版上传](/zh/api-reference/app-synced/assets/materials/gen-upload-url)或[素材列表](/zh/api-reference/app-synced/assets/materials/list-materials)。其他文件类型返回
            `400`，不存在的 ID 返回 `404`。
        youtubeUrl:
          type: string
          description: 公开的 YouTube 视频链接。无法加载的链接返回 `400`。
    AppTranscriptionOptions:
      type: object
      description: 转写选项（均可省略）
      properties:
        asr:
          type: object
          description: 语音识别设置
          properties:
            quality:
              type: string
              enum:
                - quick
                - standard
              default: standard
              description: '`standard`（默认）：准确度更高。`quick`：出结果更快。与网站选项一致，其他值返回 `400`。'
        speakers:
          type: string
          default: auto
          example: auto
          description: 说话人数量：`auto`（默认）自动识别，或正整数，如 `"2"`。其他值返回 `400`。
    OpenApiResponseBase:
      type: object
      properties:
        code:
          type: integer
          example: 200
          description: 业务码；200 表示成功
        message:
          type: string
          example: ''
          description: 当 `code` 非成功时的说明信息
      required:
        - code
  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.