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

# Media translation

> Async video and audio localization

export const apiKeyUrl = "https://www.vmeg.ai/open-api-setting";

Localize uploaded video or audio with a full **translate and dub** pipeline: speech recognition, script translation, AI dubbing (cloned or preset voices), and rendered output. Optional subtitles and lip sync. **Async only** — dubbed files arrive via [Webhook](/guides/webhooks).

<Info>
  This API **re-dubs** your media in the target language. It is not plain text translation and does not return only subtitles — you get new dubbed video or audio files.
</Info>

## Task types

| Request `taskType` | Meaning           |
| ------------------ | ----------------- |
| `vt`               | Video translation |
| `at`               | Audio translation |

If you request `at` but the material is video, the server may run **video translation (`vt`)** instead. Check `taskType` in the acceptance response and webhook.

## Workflow

<Steps>
  <Step title="Upload material">
    Finish the full [material upload](/guides/assets/material-upload) flow (including complete / instant upload), then use the registered `materialId`
  </Step>

  <Step title="Configure webhook">
    Set your webhook URL on <a href={apiKeyUrl}>API Configuration</a> and copy the generated secret for verification
  </Step>

  <Step title="Submit task">
    `POST /openapi/v1/task/media-translation/create-async` with `X-Idempotency-Key`
  </Step>

  <Step title="Receive results">
    [Webhook request body](/guides/webhook-request) when `event` is `openapi-media-translation`
  </Step>
</Steps>

## Request outline

Required fields include `taskType`, `source.materialId`, `language` (source/target locales), and `options` (dubbing, ASR, translation, etc.).

`source.materialId` must come from a **fully completed** [material upload](/guides/assets/material-upload) (or from [list materials](/guides/assets/materials) after a successful upload). Do not use a `materialId` from an in-progress gen-upload-url / multipart initiate response.

Use [Supported languages](/guides/supported-languages) for locale codes. For the full `options` tree, see the request body in [Create media translation (async)](/api-reference/media-translation/create-media-translation-async).

## Responses

* **HTTP Response** (immediate): acceptance — `taskId`, `status`, `createdAt`, effective `taskType`
* **Webhook** (on completion): deliverables in `data.result` (CDN URLs)

Do not expect final video/audio URLs in the `create-async` HTTP response.

## Voice fields in webhook results

Translated script lines and per-line TTS results may include **`voiceId`** and **`provider`**. Copy both exactly as returned — do not build or guess values.

| Field      | Meaning                                                               |
| ---------- | --------------------------------------------------------------------- |
| `voiceId`  | Stable voice ID (`sv_…` for presets, `cv_…` for clones)               |
| `provider` | Preset tier (`S1`, `S2`, …) or clone engine (`V1`–`V5`) for that line |

If you let users edit translated text and resubmit lines, **store and resend `voiceId` and `provider` together**. See [Voices](/guides/assets/voices).

## Task management

Poll `GET /openapi/v1/tasks/detail` as a fallback. See [Products overview](/guides/products/overview).
