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

# Create video translate task

> Translates a video into one or more supported languages

## Callback Notification

After the video generation task is processed, the service will send a **POST** request to the `callback_url` provided in the initiation request.

### Structure

<ResponseField name="code" type="integer">
  Response status code. `0` indicates a successful callback transmission.
</ResponseField>

<ResponseField name="msg" type="string">
  Response message, usually "ok".
</ResponseField>

<ResponseField name="task_type" type="string">
  The type of the task. Enum: `video_translate`.
</ResponseField>

<ResponseField name="data" type="object">
  The payload containing the generation results.

  <Expandable title="Show properties">
    <ResponseField name="task_id" type="string">
      The unique identifier for the video generation task.
    </ResponseField>

    <ResponseField name="name" type="string">
      The name for the video generation task.
    </ResponseField>

    <ResponseField name="language" type="string">
      The language in which the video is translated.
    </ResponseField>

    <ResponseField name="status" type="string">
      The execution status of the task. Enum: `SUCCEEDED`, `FAILED`.
    </ResponseField>

    <ResponseField name="video_url" type="string">
      The URL to access/download the generated video (valid when status is SUCCEEDED).
    </ResponseField>

    <ResponseField name="caption_url" type="string">
      URL of the captions file, if generated. Returned only if 'enable\_caption: true' is specified when translating videos
    </ResponseField>

    <ResponseField name="error_message" type="string">
      Detailed error information if the task status is FAILED.
    </ResponseField>
  </Expandable>
</ResponseField>

### Callback Example

```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://storage.googleapis.com/xiling_us_central1_bucket/backend-saas-cdn/video-translate/9966750584897124421/sample_0.mp4",
        "caption_url": "https://storage.googleapis.com/xiling_us_central1_bucket/backend-saas-cdn/video-translate/9966750584897124421/sample_0.ass",
        "error_message": ""
    }
}
```


## OpenAPI

````yaml POST /v1/video_translate
openapi: 3.1.1
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.keevx.com/
security:
  - bearerAuth: []
paths:
  /v1/video_translate:
    post:
      summary: Translates a video into one or more supported languages
      description: Translates a video into one or more supported languages
      operationId: createVideoTranslateTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoTranslateRequest'
      responses:
        '200':
          description: Task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTranslateResponse'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    VideoTranslateRequest:
      type: object
      description: Create an video translation task. Supports models V, KL, and S.
      required:
        - target_languages
        - video_url
      properties:
        target_languages:
          type: array
          description: supported language codes
          items:
            type: string
          example:
            - English
            - Chinese
        speaker_num:
          type: integer
          description: Number of speakers in the video.
          default: 0
          minimum: 0
          example: 1
        translate_audio_only:
          type: boolean
          description: >-
            Translate only the audio, ignore the faces and only translate the
            voice track in this video.
          default: false
          example: true
        enable_dynamic_duration:
          type: boolean
          description: >-
            Stretch or shrink portions of your video to enhance conversational
            fluidity and translation quality between languages with different
            speaking rates
          default: true
          example: true
        enable_caption:
          type: boolean
          description: Generate subtitles
          default: false
          example: false
        name:
          type: string
          description: >-
            Video name, with a character length of less than 100, the name after
            video translation is: target language+"-"+name, such as
            English_myTestVideo; If the value is passed empty or not, the name
            of the ending name for video translation is: target
            language+"-"+videoTranslate+"-" second level timestamp, for example:
            English-videoTranslation-2020120123001
          example: English-videoTranslation-2020120123001
        video_url:
          type: string
          format: uri
          description: URL of the video file to be translated.
          example: https://example.com/test-video.mp4
        callback_url:
          type: string
          format: uri
          description: Callback URL for task completion notification.
          example: https://your-server.com/callback
    VideoTranslateResponse:
      type: object
      description: Task creation response wrapper
      properties:
        code:
          type: integer
          description: Status code (0 indicates success)
          example: 0
        msg:
          type: string
          description: Response message
          example: ok
        data:
          type: array
          description: Payload containing the generated task IDs and languages
          items:
            type: object
            description: Task item containing language and unique ID
            properties:
              task_id:
                type: string
                description: Unique Task ID
                example: vt-d6b6472bcf724d0399e06d1390cb964e
              language:
                type: string
                description: The target language
                example: English
            required:
              - task_id
              - language
      required:
        - code
        - msg
        - data
    Error:
      required:
        - code
        - msg
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 100001
        msg:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````