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

# 创建视频翻译任务

> 将视频翻译为一种或多种支持的语言。

## 回调通知

视频翻译任务处理完成后，服务将向发起请求中提供的 `callback_url` 发送一个 **POST** 请求。

### 结构

<ResponseField name="code" type="integer">
  响应状态码。`0` 表示回调发送成功。
</ResponseField>

<ResponseField name="msg" type="string">
  响应消息，通常为 "ok"。
</ResponseField>

<ResponseField name="task_type" type="string">
  任务类型。枚举值：`video_translate`。
</ResponseField>

<ResponseField name="data" type="object">
  包含翻译结果的数据载体。

  <Expandable title="展开属性">
    <ResponseField name="task_id" type="string">
      视频翻译任务的唯一标识符。
    </ResponseField>

    <ResponseField name="name" type="string">
      视频翻译任务的名称。
    </ResponseField>

    <ResponseField name="language" type="string">
      视频翻译后的语言。
    </ResponseField>

    <ResponseField name="status" type="string">
      任务的执行状态。枚举值：`SUCCEEDED`、`FAILED`。
    </ResponseField>

    <ResponseField name="video_url" type="string">
      生成视频的访问/下载链接（当 status 为 SUCCEEDED 时有效）。
    </ResponseField>

    <ResponseField name="caption_url" type="string">
      字幕文件链接。如果在翻译视频时指定了 `enable_caption: true`，则仅在该情况下返回此字段。
    </ResponseField>

    <ResponseField name="error_message" type="string">
      当任务状态为 FAILED 时的详细错误信息。
    </ResponseField>
  </Expandable>
</ResponseField>

### 回调示例

```json theme={null}
{
    "code": 0,
    "msg": "ok",
    "task_type": "video_translate",
    "data": {
        "task_id": "vt-d6b6472bcf724d0399e06d1390cb964e",
        "name": "video-translate-1",
        "language": "English",
        "status": "SUCCEEDED",
        "video_url": "https://xiling-dh.bj.bcebos.com/micro-video-translate/task/2026-03-20/vte-hUQf28cbCuufjkdQ/c7298d67-638d-46c9-8914-97b70a825ca1.mp4",
        "caption_url": "https://meta-human-editor-test.cdn.bcebos.com/2026-03-16/e0c18130-fe7c-4fd2-906a-0181fb5994bc.ass",
        "error_message": ""
    }
}
```


## OpenAPI

````yaml POST /v1/video_translate
openapi: 3.1.1
info:
  title: Keevx API
  description: Keevx AI API，提供图片生成、图生视频和视频翻译服务。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.keevx.cn/
security:
  - bearerAuth: []
paths:
  /v1/video_translate:
    post:
      summary: 创建视频翻译任务
      description: 将视频翻译为一种或多种支持的语言。
      operationId: createVideoTranslateTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoTranslateRequest'
      responses:
        '200':
          description: 任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTranslateResponse'
        '400':
          description: 请求错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    VideoTranslateRequest:
      type: object
      description: 创建视频翻译任务。
      required:
        - target_languages
        - video_url
      properties:
        target_languages:
          type: array
          description: 目标语言代码列表
          items:
            type: string
          example:
            - English
            - Chinese
        speaker_num:
          type: integer
          description: 视频中的说话人数量。
          default: 0
          minimum: 0
          example: 1
        translate_audio_only:
          type: boolean
          description: 仅翻译音频，忽略面部，只翻译视频中的语音轨道。
          default: false
          example: true
        enable_dynamic_duration:
          type: boolean
          description: 拉伸或缩短视频片段，以增强不同语速语言之间的对话流畅性和翻译质量。
          default: true
          example: true
        enable_caption:
          type: boolean
          description: 是否生成字幕。
          default: false
          example: false
        name:
          type: string
          description: >-
            视频名称，字符长度小于 100。翻译后的视频名称格式为：目标语言 + "-" + name，例如
            English_myTestVideo。如果未传值或传空值，翻译后的视频名称格式为：目标语言 + "-" +
            videoTranslate + "-" +
            秒级时间戳，例如：English-videoTranslation-2020120123001。
          example: English-videoTranslation-2020120123001
        video_url:
          type: string
          format: uri
          description: 待翻译的视频文件 URL。
          example: https://example.com/test-video.mp4
        callback_url:
          type: string
          format: uri
          description: 任务完成回调通知 URL。
          example: https://your-server.com/callback
    VideoTranslateResponse:
      type: object
      description: 视频翻译任务创建响应
      required:
        - code
        - msg
        - data
      properties:
        code:
          type: integer
          description: 状态码（0 表示成功）
          example: 0
        msg:
          type: string
          description: 响应消息
          example: ok
        data:
          type: array
          description: 包含生成的任务 ID 和语言的数据
          items:
            type: object
            description: 包含语言和唯一 ID 的任务项
            required:
              - task_id
              - language
            properties:
              task_id:
                type: string
                description: 唯一任务 ID
                example: vt-d6b6472bcf724d0399e06d1390cb964e
              language:
                type: string
                description: 目标语言
                example: English
    Error:
      type: object
      required:
        - code
        - msg
      properties:
        code:
          type: integer
          format: int32
          example: 100001
        msg:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````