## Translate an uploaded video

`client.VideoTranslate.GenerateWithMedia(ctx, body) (*VideoTranslateGenerateWithMediaResponse, error)`

**post** `/v1/video-translate/generate-with-media`

Stages one bounded video upload and starts an asynchronous translation request.
Accepts the same settings as `POST /v1/video-translate/generate` as form fields.
Subtitles may be sent inline in the `config` field or as native file parts
`source_srt` and `target_srt.<language>` (for example `target_srt.de`); sending the
same subtitle both ways is rejected. Parts may arrive in any order; validation that
needs every field runs after the whole body is read but before a request is created,
and the staged video is discarded on every failure. Both transports produce the same
normalized, persisted config.

Limits: video 2 GiB; whole body 2 GiB + 9 MiB; part names 64 bytes; `config` field
6 MiB; other text fields 64 KiB; at most 11 SRT parts (one source plus one per
allowed target language); each SRT part 1 MiB (rejected, never truncated); all SRTs
5 MiB. `target_srt.<language>` must name a supported language; invalid names are
rejected before the part is read.

### Parameters

- `body VideoTranslateGenerateWithMediaParams`

  - `TargetLanguages param.Field[VideoTranslateGenerateWithMediaParamsTargetLanguagesUnion]`

    JSON array (for example `["de","fr"]`) or comma-separated value (`de,fr`).

    - `UnionString`

    - `type VideoTranslateGenerateWithMediaParamsTargetLanguagesArray []string`

  - `Video param.Field[Reader]`

  - `Config param.Field[string]`

    JSON-encoded `VideoTranslateConfig` object (at most 6 MiB). SRTs may be inline here or sent as the file parts below, but not both. Resource references such as `csv_resources` contain metadata only; do not send CSV bytes or base64.

  - `DisableBackgroundAudio param.Field[bool]`

    Defaults to false when omitted; set to true to disable background audio.

  - `DisableLipSync param.Field[bool]`

    Defaults to false when omitted; set to true to disable lip sync.

  - `Formality param.Field[bool]`

  - `Model param.Field[VideoTranslateGenerateWithMediaParamsModel]`

    Product speech model. `expressive` maps to Eleven v4 and is the default; `classic` maps to Eleven Multilingual v2.

    - `const VideoTranslateGenerateWithMediaParamsModelExpressive VideoTranslateGenerateWithMediaParamsModel = "expressive"`

    - `const VideoTranslateGenerateWithMediaParamsModelClassic VideoTranslateGenerateWithMediaParamsModel = "classic"`

  - `ReferenceID param.Field[string]`

  - `SourceLanguage param.Field[string]`

  - `SourceSrt param.Field[Reader]`

    Source-language SRT file part (filename must end in `.srt`; Content-Type empty, application/x-subrip, application/srt, text/srt, text/plain or application/octet-stream). Max 1 MiB.

  - `WebhookURL param.Field[string]`

    Same terminal callback contract as `VideoTranslateGenerateRequest.webhook_url`.

### Returns

- `type VideoTranslateGenerateWithMediaResponse struct{…}`

  - `RequestID string`

  - `Status VideoTranslateGenerateWithMediaResponseStatus`

    - `const VideoTranslateGenerateWithMediaResponseStatusSuccess VideoTranslateGenerateWithMediaResponseStatus = "success"`

### Example

```go
package main

import (
  "bytes"
  "context"
  "fmt"
  "io"

  "github.com/chamelaion/chamelaion-go/v2"
  "github.com/chamelaion/chamelaion-go/v2/option"
  "github.com/chamelaion/chamelaion-go/v2/shared"
)

func main() {
  client := githubcomchamelaionchamelaiongo.NewClient(
    option.WithBearerToken("My Bearer Token"),
  )
  response, err := client.VideoTranslate.GenerateWithMedia(context.TODO(), githubcomchamelaionchamelaiongo.VideoTranslateGenerateWithMediaParams{
    TargetLanguages: githubcomchamelaionchamelaiongo.F[githubcomchamelaionchamelaiongo.VideoTranslateGenerateWithMediaParamsTargetLanguagesUnion](shared.UnionString("string")),
    Video: githubcomchamelaionchamelaiongo.F(io.Reader(bytes.NewBuffer([]byte("Example data")))),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.RequestID)
}
```

#### Response

```json
{
  "status": "success",
  "request_id": "4c98dd00-a982-47d9-a8d6-e1f0b35a8944"
}
```
