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

# 查询任务状态与结果

> 轮询单个任务。`status` 为 `finished` 时，`result.outputs[0]` 是最新的成片。

`finished` 不是最终状态：在网站编辑器重新导出会把任务置回 `running`，导出失败则变为 `failed`。之前的成片仍保留在 `result.outputs` 中，`result.outputs[0]` 始终是最近一次成功导出的成片。



## OpenAPI

````yaml /zh/api-reference/app-synced.json get /openapi/v1/app/tasks/detail
openapi: 3.1.0
info:
  title: VMEG 开放 API（应用同源版）
  description: >-
    与独立版协议一致，但任务、素材、克隆音色都在你的 VMEG 网站账号里：任务出现在**我的任务**，可在编辑器继续编辑并重新导出。结果通过轮询 `GET
    /openapi/v1/app/tasks/detail` 获取（无
    Webhook）。见[独立版与应用同源版](/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
      链接。首轮即产出配音成片，任务同时出现在**我的任务**，可继续编辑并重新导出。结果请轮询[查询任务状态](/zh/api-reference/app-synced/tasks/get-task-detail)。
  - 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/detail:
    get:
      tags:
        - 任务管理
      summary: 查询任务状态与结果
      description: >-
        轮询单个任务。`status` 为 `finished` 时，`result.outputs[0]` 是最新的成片。


        `finished` 不是最终状态：在网站编辑器重新导出会把任务置回 `running`，导出失败则变为 `failed`。之前的成片仍保留在
        `result.outputs` 中，`result.outputs[0]` 始终是最近一次成功导出的成片。
      operationId: appTasksDetail
      parameters:
        - name: taskId
          in: query
          required: true
          schema:
            type: string
          description: 任务 ID（与网站任务 ID 相同）
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppTaskDetailResponse'
components:
  schemas:
    AppTaskDetailResponse:
      allOf:
        - $ref: '#/components/schemas/OpenApiResponseBase'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/AppTaskDetailData'
    OpenApiResponseBase:
      type: object
      properties:
        code:
          type: integer
          example: 200
          description: 业务码；200 表示成功
        message:
          type: string
          example: ''
          description: 当 `code` 非成功时的说明信息
      required:
        - code
    AppTaskDetailData:
      type: object
      description: 应用同源版任务详情
      properties:
        taskId:
          type: string
          description: 任务 ID（与网站任务 ID 相同）
        taskType:
          $ref: '#/components/schemas/AppTaskType'
        status:
          type: string
          enum:
            - running
            - finished
            - failed
        editorUrl:
          type: string
          description: 该任务的网站编辑器地址（登录同一 VMEG 账号）
        result:
          type: object
          properties:
            title:
              type: string
              description: '**我的任务**中显示的任务名'
            userMessage:
              type: string
              description: '`status` 为 `failed` 时的失败原因（与网站展示一致）'
            outputs:
              type: array
              items:
                $ref: '#/components/schemas/AppTaskOutput'
              description: 成片列表，按时间倒序
    AppTaskType:
      type: string
      enum:
        - vt
        - at
      description: '`vt` 视频翻译 | `at` 音频翻译'
    AppTaskOutput:
      type: object
      properties:
        videoUrl:
          type: string
          description: 成片视频 URL（音频翻译为空）；开启口型同步时即为口型同步后的成片
        audioUrl:
          type: string
          description: 成片音频 URL
        lipsyncVideoUrl:
          type: string
          description: 网站编辑器中生成的口型预览，通常为空；口型同步成片请取 `videoUrl`
        thumbnailUrl:
          type: string
          description: 缩略图 URL
        createdAt:
          type: string
          description: 导出时间
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        在 **`Authorization`** 请求头中传入 API Key（`Bearer <api_key>`）。见
        [鉴权](/zh/guides/authentication)。

````