Skip to content
DashboardGet API Key

Translate an uploaded video

video_translate.generate_with_media(VideoTranslateGenerateWithMediaParams**kwargs) -> VideoTranslateGenerateWithMediaResponse
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.

ParametersExpand Collapse
target_languages: Union[str, Sequence[str]]

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

One of the following:
str
Sequence[str]
video: FileTypes
config: Optional[str]

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.

maxLength6291456
disable_background_audio: Optional[bool]

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

disable_lip_sync: Optional[bool]

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

formality: Optional[bool]
model: Optional[Literal["expressive", "classic"]]

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

One of the following:
"expressive"
"classic"
reference_id: Optional[str]
maxLength255
source_language: Optional[str]
source_srt: Optional[FileTypes]

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.

webhook_url: Optional[str]

Same terminal callback contract as VideoTranslateGenerateRequest.webhook_url.

formaturi
maxLength2048
ReturnsExpand Collapse
class VideoTranslateGenerateWithMediaResponse: …
request_id: str
formatuuid
status: Literal["success"]

Translate an uploaded video

import os
from chamelaion import Chamelaion

client = Chamelaion(
    bearer_token=os.environ.get("CHAMELAION_BEARER_TOKEN"),  # This is the default and can be omitted
)
response = client.video_translate.generate_with_media(
    target_languages="string",
    video=b"Example data",
)
print(response.request_id)
{
  "status": "success",
  "request_id": "4c98dd00-a982-47d9-a8d6-e1f0b35a8944"
}
{
  "error": "target_languages must contain at least one language"
}
{
  "error": "duplicate target language \"de\""
}
{
  "error": "input must be a video file"
}
{
  "error": "config must be a valid JSON object"
}
{
  "error": "config.source_srt is not a valid SRT file: Line 2: invalid time format, 00:00:01 --> 00:00:02, expecting in '00:00:04,139 --> 00:00:04,799' format"
}
{
  "error": "config.target_srts.fr: language \"fr\" is not listed in target_languages"
}
{
  "error": "source_srt must be supplied either in config or as a multipart file, not both"
}
{
  "error": "config.speaker_voices key \"speaker-1\" must be a non-negative integer speaker ID such as \"1\""
}
{
  "error": "speaker_voices references unknown or unavailable voice IDs: \"missing-voice\""
}
{
  "error": "missing authorization header"
}
{
  "error": "invalid authorization format"
}
{
  "error": "missing token"
}
{
  "error": "invalid token"
}
{
  "error": "unauthorized"
}
{
  "error": "multipart request exceeds the size limit (2 GiB video plus 9 MiB for form fields, config and SRT files)"
}
{
  "error": "rate limit exceeded"
}
{
  "error": "internal error"
}
Returns Examples
{
  "status": "success",
  "request_id": "4c98dd00-a982-47d9-a8d6-e1f0b35a8944"
}
{
  "error": "target_languages must contain at least one language"
}
{
  "error": "duplicate target language \"de\""
}
{
  "error": "input must be a video file"
}
{
  "error": "config must be a valid JSON object"
}
{
  "error": "config.source_srt is not a valid SRT file: Line 2: invalid time format, 00:00:01 --> 00:00:02, expecting in '00:00:04,139 --> 00:00:04,799' format"
}
{
  "error": "config.target_srts.fr: language \"fr\" is not listed in target_languages"
}
{
  "error": "source_srt must be supplied either in config or as a multipart file, not both"
}
{
  "error": "config.speaker_voices key \"speaker-1\" must be a non-negative integer speaker ID such as \"1\""
}
{
  "error": "speaker_voices references unknown or unavailable voice IDs: \"missing-voice\""
}
{
  "error": "missing authorization header"
}
{
  "error": "invalid authorization format"
}
{
  "error": "missing token"
}
{
  "error": "invalid token"
}
{
  "error": "unauthorized"
}
{
  "error": "multipart request exceeds the size limit (2 GiB video plus 9 MiB for form fields, config and SRT files)"
}
{
  "error": "rate limit exceeded"
}
{
  "error": "internal error"
}