Translate subtitles
translateTranslate existing captions (subtitles or transcriptionJobId) into another language with Workers AI m2m100, keeping cue timing; returns SRT, VTT and JSON. Paid: 2 credits per minute; burn: true also burns the translation into the video (+4 credits/min; needs mediaUrl or fileId and a preset). Word-level highlight timing is not kept. To transcribe, translate and burn in one call use caption_video with translateTo; for a spoken (voice) translation use dub. Saved do-not-translate glossary terms are kept as is. 402 insufficient_balance with checkoutUrl when short; failed jobs refund.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"targetLanguage": "<targetLanguage>"
},
"name": "translate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| burn | No | true = also burn the translated captions into the video (+4 credits/min; needs mediaUrl or fileId and a preset). | |
| fileId | No | Uploaded media to burn into when burn is true. | |
| preset | No | Preset for the burn when burn is true. | |
| api_key | No | Only for a connection without an Authorization header: the token create_key returned (av_live_...). Pass it on every call to use that key in this same session, no reconnect or config change. Ignored when the connection already sends a key. It works like a password: create a new key if this conversation is shared. | |
| mediaUrl | No | Media to burn into when burn is true. | |
| faceAvoid | No | true = move captions off faces (samples faces at 2 fps, same price; result.faceAvoid.faceLayout). Shortcut for styleOverrides.faceAvoid. | |
| subtitles | No | Existing captions as SRT, WebVTT or AwesomeVideo JSON text. Skips transcription (no transcription charge). | |
| maxCredits | No | Spending cap for this call in credits (1 credit = 1 cent). If the price is higher the call fails with 422 before charging. | |
| highlightColor | No | #RRGGBB for highlightWords. Default #FACC15. | |
| highlightWords | No | Shortcut: words or phrases to color in every caption (accent/case-insensitive), e.g. ["AwesomeVideo", "gratis"]. Maps to styleOverrides.wordHighlights rule {id:"custom", words, color}; on highlighter-marker, ghost-keywords and brand-box it fills their keyword list in the preset colors. Same price. | |
| sourceLanguage | No | Language of the input captions or speech (ISO 639-1, e.g. en). Omit to auto-detect. | |
| styleOverrides | No | Per-call style changes deep-merged onto the preset (same fields as get_catalog {kind:'presets'} style; null removes a field), validated with the renderer schema and bundled fonts. Example {"fontSize":72,"maxWordsPerCaption":2,"wordEntrance":"bounce"}. Same price. No need to manage_preset {action:'create', type:'custom'}. Every field with examples: get_catalog {kind:'styles'}. | |
| targetLanguage | Yes | ISO 639-1 code such as es, fr, de, pt, it, ja, zh. Unsupported codes return invalid_language. | |
| transcriptionJobId | No | Id of a finished transcribe or caption_video job whose transcript to reuse (no new transcription charge). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Job id: pass it to get_job, resume_job, edit_transcript or as transcriptionJobId. | |
| kind | No | Job kind (transcribe, burn, caption, clips, shorts, trim, dub, translate, preview, metadata...). | |
| step | No | Current pipeline step while running. | |
| error | No | Failure reason when status is failed. | |
| result | No | Result when succeeded: url, files[{name, url}], clips, text... | |
| status | No | queued, running, succeeded or failed. | |
| progress | No | Progress (0-1) and ETA while running. | |
| warnings | No | Non-blocking notes. | |
| costCents | No | Credits charged (1 credit = 1 cent). | |
| expiresAt | No | When the result files are deleted. | |
| refundedCents | No | Credits refunded after a failure. |